Anthropic coding interview

Round 5 of 8 · 23 questions reported

See the whole loop
Length
55 min
Format
Live coding on a realistic, multi-part problem, a different one from the screen
They grade
Complete, runnable code; senior candidates are expected to think of the test cases themselves
AI use
No AI
Heads-up
Usually one or two coding rounds across the onsite. Some 2026 loops add a separate round where you write and review code with Claude Code in a hosted editor; there AI use is expected.

Questions Anthropic asks in this round 23

  • Image transform pipeline with a wall-clock budgetCodingApply a fixed sequence of image transforms (grayscale, flip, scale, blur, rotate) to every image in a directory, then speed the batch up with threads or processes to hit a…
    Last asked Oct 2026
  • Deduplicate files by size then content hashCodingWalk a directory tree and group files with identical content. Compare file sizes first so large files are hashed only when sizes collide, then hash the rest. Be ready to discuss…
    Last asked Sep 2026
  • Concurrent same-host web crawlerCodingImplement a web crawler that finds every page reachable from a start URL on the same host, and fetches pages concurrently. You are given a blocking helper: Write: python def…
    Last asked Oct 2026
  • Fix a function-cache key function, then make it durableCodingA small memoizing cache for arbitrary callables has a broken key function that mishandles positional versus keyword arguments and defaults. Fix the keying first, then extend the…
    Last asked Sep 2026
  • Reconstruct call stacks from enter and exit tracesCodingA profiler gives you call stacks sampled over time, outermost frame first. Turn them into function start and end events, then go the other way: replay start/end events into stacks…
    Last asked Sep 2026
  • Multi-step task with an LLM tool-use loopCodingIn a notebook with docs open, solve a multi-step problem by writing code that calls a language model as a building block: design the prompts and the loop that invokes tools and…
    Last asked Sep 2026
  • Distributed mode and median across worker shardsCodingYou are given a cluster of k worker nodes, numbered 0 to k - 1. Each worker holds its own unsorted slice (shard) of a large integer dataset. A worker can read only its own shard…
    Last asked Sep 2026
  • Greedy longest-match tokenizerCodingImplement a greedy longest-match tokenizer. You are given a string text and a list dictionary. Each entry has the form "<key:<id". key is a non-empty token string and id is its…
    Last asked Sep 2026
  • Weighted data batcher with deterministic resumeCodingBuild a sampler that draws weighted batches from a dataset registry and can resume deterministically from a saved offset, including the edge case where the batch size does not…
    Last asked May 2026
  • Thread-safe task queue on a linked listCodingA task queue was written for one thread: a singly linked list with head and tail, where put appends at the tail and get removes from the head. Explain what goes wrong when many…
    Last asked Feb 2026
  • Repair a looping bootloader programCodingA tiny bootloader stores its program as a list of text instructions. Each entry has the form "<op <value", where value is a signed integer. The machine has one accumulator, which…
    Last asked Jul 2026
  • Kernel-optimization take-home scored by speedupCodingA two-hour take-home that replaces the coding screen. AI tools are allowed. You get a simulator for a small accelerator and a working but slow kernel; your score is the speedup in…
    Last asked Dec 2025
  • Review a series of pull requestsCodingYou get two or three pull requests, each harder than the last, in Python or Java. Read each one, leave comments as you would on a real review, and point out bugs, design problems…
    Last asked Aug 2026
  • Cloud storage with user quotas and backupsCodingDesign an in-memory cloud storage service. The interview has four parts. Each part adds methods, and every earlier method must keep working. Implement a class CloudStorage. File…
    Last asked Jul 2026
  • Running cost of streamed token usageCodingToken usage for model requests arrives as a stream of usage records rather than all at once. Compute what the usage costs, keeping the totals correct as each new record arrives…
    Last asked Jul 2026
  • Threshold infection spread on a gridCodingA lab tracks a disease across a rectangular field of cells. You are given an m x n grid where 0 is a healthy cell and 1 is an infected cell, and an integer threshold. Each day…
    Last asked Jul 2026
  • Neural network forward and backward pass from scratchCodingBuild a small neural network and a loss function by hand, without an autodiff library. Write the forward pass, then derive and code the backward pass that computes the gradient of…
    Possibly retired
  • Implement a trie (prefix tree)CodingImplement a prefix tree over strings: insert a word, check whether a whole word is present, and check whether any stored word starts with a given prefix. Design the classes so…
    Possibly retired
  • In-memory note-taking system with keyword searchCodingDesign an in-memory note-taking system, SecondBrainSystem. Each note gets a unique id and carries metadata about when it was created and last modified. Callers pass the current…
  • Minimum workers with first-free job assignmentCodingJobs arrive as (jobid, start, end) with half-open times start, end). Workers are numbered 0, 1, 2, ... Part 1. Process jobs by start time (ties by job id). Each job goes to the…