Caches From Scratch
An Anthropic cache round often starts with a one-line memoization import, and then the interviewer takes the import away. You rebuild the structure under it, and then the interviewer changes a rule that structure depends on. The base rebuild, an LRU from a hash map and a doubly linked list, is worked in Data Structures & Parsing. Each problem here starts where that one stops.
Two of the problems change the cache's rules. One has to survive a crash, and the other evicts by how often a key was used. Another gives you an LRU someone else wrote and asks what's wrong with it. The last two each take away a different library piece, the dict every other problem relies on and the plain string a text editor sits on, and ask you to build the replacement.
AnthropicPremium lesson · Coding round
The 5 Anthropic problems are below.
- A Premium questionCoding · Medium
- A Premium questionCoding · Hard
- A Premium questionCoding · Medium
+ 2 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the Anthropic questions$49 a year · all 100 companies · cancel anytime
From 20,000+ candidate reports, forum threads behind logins and write-ups in Chinese.
Anthropic interview guideKnow what Anthropic asks before you walk in.
33 coding · 5 system design · 14 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.