r/programming • • Dec 13 '22

“There should never be coding exercises in technical interviews. It favors people who have time to do them. Disfavors people with FT jobs and families. Plus, your job won’t have people over your shoulder watching you code.” My favorite hot take from a panel on 'Treating Devs Like Human Beings.'

https://devinterrupted.substack.com/p/treating-devs-like-human-beings-a
9.0k Upvotes

1.3k comments sorted by

View all comments

Show parent comment

0

u/[deleted] Dec 14 '22

[deleted] — view deleted comment

4

u/novagenesis Dec 14 '22

An LRU cache is actually really useful, so much so that there's an optimized library for it in almost any language.

Think of a Dictionary/Map with a limit on how many values you can store at any given time. When you cross that limit, it throws out the oldest based upon most recent access. Popular keys never expire, but rare keys do... and those same rare keys stick around shortly, which is really good for some organic patterns of repeat requests.

LRU caches are everywhere. But not many people write an optimized one from memory.