Remitly interview question

Implement an LRU cache. Assume Java.

Interview Answer

Anonymous

Feb 6, 2019

After the previous question, seeing this one got an eye-roll from me. I was no longer on a roll. I think the interviewer saw the eye roll and didn't appreciate it as he was pretty stiff after that. I mentioned that I'd never do this in Java as it's effectively a one-liner give the Collections package. "Yeah, in practice, but I want you to do the problem to see how you think." So I had fun stumbling along ... made a false start (I plead lunch-brain, had a carb-heavy lunch just before), but I paused when I realized my mistake, regrouped and solved it.

1