3 ms·
You know, I used to feel the same way, "good at my job bad at leetcode", but after asking around a bit, now I'm genuinely wondering how many people out there ac
by ashleyn 4y ago
You know, I used to feel the same way, "good at my job bad at leetcode", but after asking around a bit, now I'm genuinely wondering how many people out there actually can get optimal solutions on leetcode problems without any practice - which seems to be the real insecurity that gets under people's skin when they write another lamentation on the state of tech hiring.
It sounds to me like the primary purpose of these difficult DSA questions seems less about accurately gauging one's ability to do the job and more about paring down a veritable tidal wave of applicants that big-name companies like FAANG routinely get. As such I don't think it's so unreasonable to get demolished by these kinds of problems if you haven't done any practice at all on them. Rather than looking at it as an indictment of your programming skill, it's probably more indicative of you not having trained enough for the "FAANG-lympics". They're all basically competitive programming problems. Of course you're going to get demolished if you haven't trained for a competition.
With that in mind I think if you look at smaller shops, they may not give you these academic-tier math questions (I know we sure as hell don't), more stuff like fizzbuzz or recursive factorial or any other very trivial whiteboard style question. At least where I work I know we don't get people beating the door down, and if we just cargo-culted Google's process on the comparative trickle of applicants, we wouldn't get any asses in the seats at all. Of course we also can't afford to pay FAANG-tier wages.
I guess you can look at it like this: the highest paying jobs all have the most difficult interviews. Almost everyone I talked to literally practiced to do them, it's not a talent thing, or might not be anyway. This can be avoided by applying to smaller, less-paying shops, so I guess it's ultimately a question of how much you're willing to practice and for what salary.
- roflyear 4y agoWhat's a few example problems that you'd be surprised people can solve?
- Ismail-Maj 4y agoIt's not a LeetCode problem but I'd be impressed if someone can come up with the 4-liner recursive solution for the Tower of Hanoi problem. https://cses.fi/problemset/task/2165 https://cses.fi/problemset/task/2165 https://www.mathsisfun.com/games/towerofhanoi.html https://www.mathsisfun.com/games/towerofhanoi.html https://www.geeksforgeeks.org/c-program-for-tower-of-hanoi/ https://www.geeksforgeeks.org/c-program-for-tower-of-hanoi/
- roflyear 4y agoYeah it is a weird problem. I actually got asked a similar problem about seven or eight years ago (but was not presented as a tower of hanoi problem) - and the interviewer asked if I could come up with a closed-form solution. I think one does exist and is not too crazy to understand but that was a trip.
- sudosysgen 4y agoYou can use the the recursive solution to generate the closed form solution. The interviewer was asking you for the closed form solution to see if you could exactly compute the complexity of a recursion.
- deleted 4y ago[deleted]