Live data from Hacker News

The Lesson to Unlearn

paulgraham.com

471–480 of 588 posts

Re: The Lesson to Unlearn

#471

Earlier quoted context omitted.

I was a hiring manager at a big company for years. We never did coding tests, and I like to think that I made good choices every time. I kept a high-functioning team together, under fairly humble pay, and stressful, sometimes demoralizing, conditions, for decades. I'm mediocre, at best, at these tests. I don't come from a traditional CS background (started as an EE). I tend to take unusual, hybrid approaches to solvi…

The big problem with using a software portfolio is that plenty of competent engineers don't have impressive work that they can share. If you don't (or can't, because of other obligations like parenting) code in your free time and aren't a recent graduate, you probably don't have much to show. Of course, difficult whiteboard interviews that require studying to pass have the same problems probably and give less useful…

I know. I'm fortunate to have one. Like I said, I completely realize that it isn't usual for people to have portfolios; especially ones with the scope of mine.

I just feel that it's rather self-destructive to ignore those rare instances where they exist.

Re: The Lesson to Unlearn

#472

Earlier quoted context omitted.

You don’t need edit distance. The solution is literally a for loop and three if statements. The fact that you can’t stop and think for a few seconds about how you might solve this means you’ve been on autopilot for many years now. This is a proxy test to weed out people who work on autopilot and never think.

Are you proposing brute forcing it? Depending on requirements that might be fine, but I doubt FB would like that kind of solution. If they did, they'd have a different kind of question.

1st for loop with first word with charecter counts map and second for loop subtracting counts from frist map. See whats remaining in the end, either a map with 1 char left or 1 char left in second. so O(m + n).

abc , adc

a - 1

b - 1

c - 1

after second word loop

b - 1, d

Re: The Lesson to Unlearn

#473
I think there are some good insights to be gleaned from this essay, as with a lot of pg's essays. The perspective of the guy who founded and ran Y Combinator is always an interesting one to hear from.

However for this essay in particular, had I been among the set of draft readers, I would have suggested toning down the “I hadn't realized X until now, so now I think other people haven't realized X either” message.

Back in college I remember noticing choices of “better learning vs better grade” and deliberately choosing the former with a proudly “screw the authorities” attitude. I'm sure plenty of other Tara Ploughmans could say the same.

Re: The Lesson to Unlearn

#474
post #370

Earlier quoted context omitted.

If you can't stop bad people from accumulating, you will have a problem no matter how selective is your hiring process.

Can't you just unhire them?

Firing is too hard for humans, and too easy for bureaucracies.

Re: The Lesson to Unlearn

#475

Earlier quoted context omitted.

You don’t need edit distance. The solution is literally a for loop and three if statements. The fact that you can’t stop and think for a few seconds about how you might solve this means you’ve been on autopilot for many years now. This is a proxy test to weed out people who work on autopilot and never think.

Are you proposing brute forcing it? Depending on requirements that might be fine, but I doubt FB would like that kind of solution. If they did, they'd have a different kind of question.

This isn't "brute force." It's solving the specific problem posed rather than a generalization, which in this case is both easier and more efficient (since there are cases in which you could terminate the loop early).

Re: The Lesson to Unlearn

#476
post #264

As somebody who has designed some of the tests Paul Graham is complaining about, it really is hard from the other side! For example, it's long been known in the physics education research community that students come away from introductory courses with very little physical understanding, even if they can do the plug and chug problems on typical tests just fine. Students can all recite Newton's third law, but immediat…

To illustrate just how hard: much of my work in academia was assisting in designing experiments or analyzing data for other people working on PhDs in "how to design decent tests" (i.e., Instructional Psychology). There was an entire department of the university dedicated to studying just that problem.

Re: The Lesson to Unlearn

#477

  In theory, tests are merely what their name implies:
  tests of what you've learned in the class. In theory
  you shouldn't have to prepare for a test in a class any
  more than you have to prepare for a blood test. In
  theory you learn from taking the class, from going to
  the lectures and doing the reading and/or assignments,
  and the test that comes afterward merely measures how
  well you learned.
That was always how I approached tests in college. While everyone around me was stressing out, not once did I actively study for finals. Finals week is for relaxing, sleeping, watching movies, reading books, and having parties in between tests. Because, y'know, learning the stuff on the test was what the whole frickin' semester was for, and if you weren't paying attention up to now, what makes you think you can learn it all over a weekend?

I was constantly amazed at how many of my peers, who were paying good money to learn stuff at school, were utterly shocked by that philosophy. I really wish more students understood it.

Re: The Lesson to Unlearn

#478

Earlier quoted context omitted.

> Write a function to return if two words are exactly "one edit" away, where an edit is: Inserting one character anywhere in the word (including at the beginning and end) Removing one character Replacing exactly one character I've been writing code my entire life, and I've been employed as a software developer for longer than I'd care to admit. I don't have a quick answer to that problem. I know there's an algorithm…

Look up "edit distance"... it is one of the first problems an Algorithms course will discuss that can be solved by dynamic programming. But ya, no way anyone is coming up with that unless they have seen it before.

An algorithm for "do these strings differ by an edit distance of at most 1?" is much simpler, and should be easy to figure out. No dynamic programming required.

Re: The Lesson to Unlearn

#479

Earlier quoted context omitted.

Are you proposing brute forcing it? Depending on requirements that might be fine, but I doubt FB would like that kind of solution. If they did, they'd have a different kind of question.

1st for loop with first word with charecter counts map and second for loop subtracting counts from frist map. See whats remaining in the end, either a map with 1 char left or 1 char left in second. so O(m + n). abc , adc a - 1 b - 1 c - 1 after second word loop b - 1, d

I might be misunderstanding, but doesn't that treat 'abc' and 'cba' as distance 0?

Regardless, I was also thinking Levenshtein is sub-optimal, and that you can probably solve it in O(n+m).

Even if you go for Levenshtein first, you should identify a simple modification to stop calculating the matrix early if the distance is necessarily greater than 1. Get a bit fancier and you can just 'go down the diagonal' and greatly optimize the algorithm.

Re: The Lesson to Unlearn

#480
post #479

Earlier quoted context omitted.

1st for loop with first word with charecter counts map and second for loop subtracting counts from frist map. See whats remaining in the end, either a map with 1 char left or 1 char left in second. so O(m + n). abc , adc a - 1 b - 1 c - 1 after second word loop b - 1, d

I might be misunderstanding, but doesn't that treat 'abc' and 'cba' as distance 0? Regardless, I was also thinking Levenshtein is sub-optimal, and that you can probably solve it in O(n+m). Even if you go for Levenshtein first, you should identify a simple modification to stop calculating the matrix early if the distance is necessarily greater than 1. Get a bit fancier and you can just 'go down the diagonal' and great…

ah yea, sorry i misread the question.
Post reply on HN