Function-Call LRU Cache: Argument Key Generation and Crash Recovery from a Log
Company: Anthropic
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: hard
Interview Round: Onsite
Overview: A Python exercise that builds an LRU cache for memoizing function calls. Part one asks how to generate a reliable cache key from a function and its arguments; part two adds crash recovery through an append-only log file, testing record framing, durability, torn writes and replay of the cache state.
Read the full Anthropic Software Engineer interview experience this question came from