4 ms·
I think leetcode medium level of questions can be fair game. With only a moderate amount of practice, anyone who writes software professionally should be able t
by _huayra_ 5y ago
I think leetcode medium level of questions can be fair game. With only a moderate amount of practice, anyone who writes software professionally should be able to spot common patterns, or at least get in the right direction by the end of the interview.
Even if you concede my position (and I know a lot of folks think all these questions are impossible / unfair), at the end of the day they're just a terrible signal of whether someone will be good at their actual job.
The folks that I've interviewed who really ace these puzzles often (but not always) end up writing terrible code, e.g. cryptic variable names, lots of use of indices into vector / array data structures instead of something more idiomatic like iterators and std::algorithm stuff.
My current approach is to show some subtle C++ gotchas and ask the candidate what will go wrong (e.g. where is the undefined behavior?). I don't even expect candidates to get all of them, as many of them are hard even outside of the interview set and setting. Then I ask them to write a hash table for values with large data (i.e. where using std::vector as a bucket would be a bad choice due to the 2x'ing of size on resizing) and just see what they write. The main thing I expect is for them to demonstrate that they know the stdlib stuff (e.g. std::list, std::forward_list, std::hash, templates, etc) and can explain the tradeoffs.
Surprisingly, far fewer people pass my interview despite it not being some obtuse mental brain teaser, but those that do have been great colleagues.