Anthropic-style Python performance and correctness practice
Measure a slow path, then verify that fewer operations still produce the same results.
What did Anthropic's published performance take-home test?
Anthropic describes an earlier performance-engineering take-home that asked candidates to optimize a parallel tree traversal on a simulated accelerator. For practice, measure how much work an implementation does and verify that the optimized output matches the baseline. Check your own invitation for the current assignment and AI rules.
Anthropic’s technical evaluation designPraxisAI practice drill
Count calls before timing an optimization
A report normalizes each ID with a pure function and preserves input order. Run it on [A, B, A, A, B], then memoize the result for each distinct input during the run.
Expected result. The baseline calls the normalizer five times and the memoized version calls it twice. The output still has five entries in the original order.
Repository exercises
Search and filter this trackFind the work worth removing
Measure the smallest case that reveals repeated or unnecessary work.
Keep results stable
Hold on to an earlier result and check whether the next call changes it.