Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think testing whether someone can recall the implementation of quick sort and has practiced writing it quickly is not really testing for building complexity or solving problems.

It’s testing for practiced solutions of memorized algorithms and a bit of role play.

I get there’s some IQ challenge to preparing this and it’s hard to evaluate skill, but I don’t think this tests much beyond that.

Want to test true basic programming capacity? Do fizz buzz, ask someone to reverse names in a string with loops - everyone should be able to do that without thinking.

That’s actual basic stuff.

High level or more complexity? Discuss a relevant problem the company needs to solve and how they’d approach it.

Better yet discuss a problem and debug it together. Most programming is debugging anyway.



Note that koonsolo never mentioned quicksort, only sort. You can easily make it a newbie question by just accepting any sort that returns a correct output, even with a quadratic complexity in the best case. Any programmer should be able to write that in less than 10min.

And as the post you answered to alluded to, the point of the question is really just to filter out candidates who can't even write simple code, just like fizzbuzz. That's the kind of question you could ask in a first round, and then proceed to more relevant questions.


I haven't written a sorting method in years and couldn't remember it on the spot in 10 minutes, despite having analyzed the big ones 6 years ago. Yet, I have no problem creating a giant, modular, cookie-cutter enterprise structure, which is generally more sought after and something many hardcore leets seem to struggle with, especially once it comes down to doing more than just a fancy UML graph.

We really don't need True Scotsmans on this site.


Again, you can make it a newbie question by just accepting any sort, including one you come up with on your own (so no need to remember). I'm sure you can design your own sort given enough time, granted 10 minutes might be too short to get it nice and clean, but with a bit more you're on the level of difficulty of fizzbuzz.

To make my point clear, you can implement a dumb and inefficient sort by implementing a min function, taking this min, then iteratively call it on what's left of the array and append the values to a new array which you then return. That won't get you into FAANGM, but maybe that's enough to get some discussion started in an interview at a company that's not too much into leetcode and is trying to evaluate other skills like communication. And I do think that 99% of people who write code every week could come up with something like this or better fairly quickly.


That's reasonable to me if that's the standard.

The reason I jumped to quicksort in my initial reply is any sort short of quick or merge sort (or some other nlogn variant) would fail you at FAANG.

You could do the naive n^2, but it better only be in the first two min and hand waved off as obviously inefficient, almost a joke that you implemented it at all on the way to writing the nlogn version, bonus points if you talk about how merge sort is nlogn in worst case and quicksort is n squared in the worst case, but in practice often faster.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: