Cache eviction policies: LRU vs random vs p2c

Every so often I interview senior software engineers for Amazon. Where I ask more or less same questions in each interview. One of them requires adding a caching logic to get better results. I’ve noticed that the interviewee make one of to mistakes that blocks them from standing out as a software engineers: they don’t know, or talk about conditions under which a cache will do the best. Primarily, how a request frequency distribution affects cache performance. they don’t know the standard library of a programming language of their choice. Here, we will try to address those issues. ...

September 15, 2024 · 8 min · Anton Golubtsov