3 ms·
It's probably better to think of it as the building blocks for answering more complicated questions. E.g. you write an algorithm and one of the followups the in
by jldugger 7y ago
It's probably better to think of it as the building blocks for answering more complicated questions. E.g. you write an algorithm and one of the followups the interviewer asks you is the runtime of it. Well, you used a hash table, so lookups are constant time, but you iterate over the keys, which is is linear in the size of the table. So when you do some work linear in the size of the input for each item in the table, you can work out that's a quadratic algo. That sort of thing.
- koube 7y agoThat's how I thought of it when I was studying leetcode, and that's the advice I give to other people when they ask how I got my job. Each leetcode solution was another tool in my toolbox. The more tools you have, the easier it will be to put two things together for a larger solution, or to modify a tool to fit a new problem. I understand the resistance to flash cards as rote memorization without being able to build upon them, I think that's a cogent criticism. At the same time I think some people will be able to take advantage of this to build their toolbox. And as a minor note, I personally love when people can name an algorithm or concept. There was one interview that I think I completely failed, but I was able to name (but not write out) a concept. I actually incorrectly name dropped Hamming distance, when it was actually the Levenshtein distance, but I was able to diagram the concept behind it. I passed that interview (to my tremendous surprise), and I think the name drop and the simple diagram helped.