I try to avoid those sorts of questions, but it's hard for me to come up with better alternatives.
I try to avoid those sorts of questions, but it's hard for me to come up with better alternatives.
I try to work on soft skills during the interview, I found those to be way more important than knowing to invert a tree.
How does one converse through a problem? How would you go about solving this bug.
I usually do something really simple like
logMessage(from, to, content) {} searchMessageBySender(senderName) {} getMessages() {}
Have the candidate fill in the interface and walk through what the choices are and what are the ups/downs of their solution.
- it's not too short or too long
- there's no trick, it's just a matter of being thorough
- it's pretty concrete (modern languages have that in their standard lib) and/or might actually come up someday in your day-to-day job
And in my opinion, what matters even more is that your full round of interviews shouldn't be just 5 slots of algo questions. One or two should be enough. I like combinations of a take-home challenge (keep it short!), pair programming sessions and architecture / systems design discussions.