4 ms·
I dealt with this recently. Was asked to implement a LRU cache. I knew the trick, use two data structures to keep things sorted and accessible in constant time.
by irl_zebra 9y ago
I dealt with this recently. Was asked to implement a LRU cache. I knew the trick, use two data structures to keep things sorted and accessible in constant time. Could do it in my sleep. Had to pretend I had never seen it before, started with a non optimize d solution and added the correct pieces to make it optimal. Interviewer seemed miffed, kept adding tests to see if my algorithm would get the wrong answer and seemed upset that I got it right. It was bizarre. Didn't get the job, didn't remember the answers to a few of the other questions, though I found them post interview.
- bogomipz 9y ago>"...Interviewer seemed miffed," Probably because you deprived them of the opportunity to feel superior because they knew the answer and you didn't. You probably dodged a bullet - would you want to work with someone that got "miffed" during an interview because you knew the answer to something?