Hacker News new | ask | show | jobs
by reledi 4773 days ago
> Each time I sit down to brush up on the details of Prim's algorithm or the exact implementation of quicksort, my eyes glaze over and I start thinking about how I'd much rather be building or tinkering with something. So that's what I end up doing.

Nailed it.

Another interesting thing I noticed about myself in technical interviews is that I have a lot of trouble doing things that I would have no trouble with if I'm tutoring someone. Perhaps it's the anxiety, and practice will surely help, but see above, I'd rather spend my time tinkering with stuff than preparing for interviews.

2 comments

>I'd rather spend my time tinkering with stuff than preparing for interviews

If we're talking about raw programming skill, I would say that actually learning these fancy algorithms will pay off more than (random) tinkering. It's the difference between directed and undirected practice. Undirected practice only takes you so far. To truly get good at something one must do deliberate, directed practice consistently.

I agree with you. However, learning the algorithms is different than preparing for technical interviews IMO.

I've learned many algorithms and implemented most of the ones I've learned, but if I haven't recently coded them repeatedly or studied them rigorously, I likely won't be able to code them up on the spot when asked to. But because I learned them in the past, I would be able to recognize which algorithm (from the ones I've learned) best suits the problem.

In rea world programming, those algorithms have very little practical use other than the "gee-whiz" factor.

If you understand algorithms in general, then I think thats enough. Its sort of like being able to play a single song on the guitar is great, but to have the skill to play any song is even better. On the same token, being able to write any algorithm is a much better skill than being able to write out a single algorithm.

Has anybody here ever actually been asked to exactly implement quicksort?
Yes, by Microsoft in 2001. (Strangely, by a non-technical recruiter who wouldn't have known if it were correct or not anyway; apparently he was trying to "gauge my confidence".)
More than once. Also, merge sort, heap sort, and some problem specific variations of these.
quicksort, shellsort, then implement it for parametric type.
I am not even sure what implementing it for a parametric type means... can someone point me to a link?
Parametric type means to take the type as a parameter; parent was probably asked to use Generics in C# or Java or C++ templates.
Ah, ok