Anthropic Coding Interview Questions
20 coding questions reported by candidates who interviewed at Anthropic, out of 37 Anthropic questions we track. They average 3.1/5 difficulty (medium). Most common topics: Parsing, String, Python, Hashmap. 12 were reported asked within the last year, most recently in October 2026.
Practice Anthropic questions →Difficulty
- 2/5 — easy2
- 3/5 — medium14
- 4/5 — hard4
Asked for SWE (19), MLE (6), Infra (1)
Reported Anthropic coding questions
Crash-Resilient LRU Memoization Cache
3/5This reported Anthropic interview question requires you to build a caching mechanism that remembers function outputs while handling argument normalization and recency-based evictions. The exercise examines your understanding of state management, hash keys, and resilient data structures that can withstand unexpected interruptions. You must ensure that parameter ordering does not affect cache hits while keeping memory usage under control. The full problem specifications and the complete model solution require a subscription.
asked October 2026Longest-Match Tokenization with UNK and Optional UNK-Run Compression
3/5Tokenise text against a fixed vocabulary by always taking the longest match available at the current position, falling back to an unknown token one character at a time. This Anthropic question then adds a rule that collapses consecutive unknown tokens, which quietly changes what the greedy scan has to remember. You will bound the match length by the vocabulary, keep the scan linear in practice, and handle the boundary where a fallback meets a real token. A subscription unlocks the full problem and the verified solution.
asked June 2026StringHashmapGreedyCoding Q6 — Longest-Match Tokenizer
3/5Start from the obvious nested-loop tokeniser that takes the longest vocabulary match at each position, then improve it under the interviewer's direction. This Anthropic round is scored on the iterations rather than the first answer: merging runs of unknown tokens, bounding the scan by the longest vocabulary entry, and replacing the inner loop with a trie. You will keep each refinement behaviour-preserving and be able to state what it bought. Subscribers can read the complete problem and every stage of the solution.
asked June 2026String ProcessingGreedyTrieDeduplicate Files
3/5This reported Anthropic interview question asks you to scan a directory tree and group files that contain identical data. It evaluates your file system navigation skills, hashing strategies, and ability to optimize algorithms progressively for performance over large volumes of data. You must carefully design your approach to avoid unnecessary file reads while accurately identifying duplicates. To access the full problem details, optimization guidelines, and the complete model solution, a subscription is required.
asked June 2026Coding Q2 — File Deduplication
3/5Scan a directory tree and group files whose contents are byte-identical, cheaply enough that you are not hashing everything you touch. This Anthropic question is short to state and scored on the follow-ups: comparing by size first, choosing a digest, and reasoning about whether the job is bound by disk or by processor. You will exclude files with no partner from the output, handle unreadable paths, and say how the approach holds up on a very large tree. A subscription unlocks the complete problem and the reference solution.
asked June 2026FilesystemHashingPythonStack sample conversion to event tracing
3/5In this reported Anthropic coding assessment, candidates must transform periodic profiler call stack logs into chronological trace events showing function durations. The task evaluates your data parsing abilities and algorithmic efficiency when dealing with nested execution snapshots. Access to the comprehensive problem description, test suite, and optimal code solution requires a paid subscription.
asked June 2026Bank Systems (OA)
4/5This multi-tiered systems design and coding challenge, reported as an online assessment for Anthropic software engineering roles, requires you to build a robust in-memory banking engine. Over several escalating phases, you will handle user account creation, secure fund transfers, transaction histories, and advanced auditing rules efficiently. The assessment measures your ability to design clean APIs and manage stateful business logic under tight constraints. The comprehensive problem statement and optimal model solution are available exclusively to subscribers.
asked June 2026Infection Simulation in a Grid
3/5Work out how many rounds it takes for an infection to cover a grid, where a clean cell only falls once enough of its four orthogonal neighbours are already infected. Asked at Anthropic, the threshold is what breaks the usual flood-fill instinct: a cell can sit adjacent to the infection for several rounds and still resist. You will update the whole grid in lockstep, recount neighbours each round, and recognise the case where some cells never become infected. The full problem and the model solution are available with a subscription.
asked June 2026GraphBFSGridIn-memory database
3/5This data structures and systems design task, featured in Anthropic online assessments, requires you to construct a feature-rich in-memory database across multiple levels of increasing difficulty. You will implement nested key-value storage, condition-based filtering, expiration timers for records, and transactional snapshot capabilities. The test assesses your capability to design efficient indexing structures and maintain clean state management in memory. Reviewing the complete prompt requirements and the expert model solution requires an active subscription.
asked May 2026OA — Worker / Employee Grant Management
3/5An Anthropic online-assessment design question in four levels: keep a log of when each staff member arrives and leaves, rank people by hours on site, hold a raise until their following shift, then add company-wide periods that pay twice the usual amount. You will treat shifts as intervals, merge overlapping bonus periods and keep per-person state consistent. Subscribe for the full statement, tests and the reference class.
asked May 2026Online AssessmentCodesignalOOPCrawling the web
3/5In this systems-focused coding challenge from Anthropic interviews, you are tasked with building a web crawler capable of discovering reachable hyperlinks within a designated domain starting from a seed address. You will progressively evolve your design from a straightforward single-threaded traversal to an efficient, concurrent architecture that handles network boundaries and deduplication smoothly. The evaluation checks your grasp of graph traversal, concurrency control, and asynchronous programming patterns. Access to the detailed specifications and optimal solution requires a subscription.
asked May 2026Cloud Storage Systems
3/5This popular Anthropic coding assessment requires candidates to build an in-memory hierarchical cloud file storage system that handles increasingly sophisticated retrieval and management operations across multiple progressive levels. The exercise tests your data structure design choices, algorithmic efficiency, and ability to handle edge cases cleanly under time constraints. The complete problem statement, test cases, and model solution require a subscription.
asked March 2026LLM-Oriented String Processing (Phone Screen)
3/5Clean up a raw multi-line transcript and turn it into structured turns, applying a fixed sequence of text rules before any parsing happens. Reported in an Anthropic phone screen, this question rewards following the specification in the stated order, because reordering two of the cleanup steps changes the output. You will strip internal markers, normalise whitespace, drop blank lines, and decide what to do with a line that has no recognisable speaker. Subscribers can read the complete problem and the reference pipeline.
StringParsingText ProcessingStack Trace Suffix Matching
3/5Match truncated crash reports against a library of complete stack traces, where only the frames nearest the failure survived collection. This Anthropic question is a suffix-matching problem, and the efficient answer indexes the known traces once instead of rescanning them per query. You will choose between reversed tries, suffix hashing, and plain comparison, return every trace that matches rather than the first, and define the result order. Subscribers get the complete problem and the reference implementation.
StringsParsingHashingFile Profiler
2/5Write a small utility that reports the shape of a text file: how many lines, how many words, how often one chosen word appears, and how many bytes it occupies. Asked at Anthropic, this question is about the cases around the edges rather than the counting itself, and the test cases you volunteer are the answer. You will handle an empty file, a file with no trailing newline, and an input too large to hold in memory at once. The full problem and the model solution require a subscription.
StringFileParsingDebug / Fix an Extremely Randomized Trees (ExtraTrees) Implementation in NumPy
4/5Repair a NumPy-only implementation of a randomised decision-forest learner that either crashes, predicts wrongly, or fails to reproduce its own results. This Anthropic debugging round is about reading someone else's array code: the bugs hide in indexing, in split selection, and in how the random state is threaded through. You will get the unit tests passing without reaching for another library, and explain which defect caused which symptom. Subscribers can read the complete problem and the corrected implementation.
NumPyDebuggingTree Based ModelsHigh-Concurrency Prompt Template Deduplication (Array + Hash Map)
4/5Normalise a large batch of prompt templates into canonical keys and count how often each distinct shape appears, so an engineering team can see what it is really paying for. This Anthropic question specifies the cleanup rules precisely, including how placeholder names collapse, and then asks about doing the work under concurrency. You will apply the rules in the right order, pick a key representation that hashes cheaply, and discuss safe counting across threads. A subscription unlocks the complete problem and the reference solution.
StringHashmapArraysImplement an LRU Cache (HashMap + Doubly Linked List) and Debug an Existing Implementation
3/5Build a fixed-capacity cache that evicts whatever was touched least recently, with both reads and writes running in constant time, then fix a version that is subtly wrong. This Anthropic round pairs construction with debugging: the hash map and the linked list have to stay in agreement on every path, and most planted bugs break exactly that. You will handle updates to an existing key, eviction at capacity, and the sentinel nodes that keep the list logic honest. Subscribers get the full problem and the verified implementation.
LRUHashmapLinked ListThread-Safe Linked List Task Queue Transformation (Linked List + Concurrency Discussion)
4/5Reverse a task list in consecutive blocks of fixed size, leaving a short final block untouched, and then explain how to do it while other threads are reading. This Anthropic question starts as a pointer exercise and turns into a concurrency discussion about readers, tail appends, and what guarantees your rewiring actually offers. You will cover the edge cases that break naive pointer surgery and propose a locking or copy strategy that survives concurrent access. The complete problem and reference solution require a subscription.
Linked ListConcurrencyThread SafetyPython Class and Data Structures
2/5Assemble a small container class that keeps a unique collection, returns it in order, exposes hash values, and finds an element by halving the search space. This Anthropic warm-up is really about choosing the right built-in for each operation and knowing what each one costs. You will keep the sorted view consistent with the underlying set, decide when to re-sort, and handle lookups for elements that are not present. The full problem and the model implementation are available to subscribers.
PythonClassData Structures
Recent Anthropic interview experiences
Full loops shared by candidates, every round included.
Anthropic — a narrow coding pass, then a 40-min HM behavioral round
I barely passed Anthropic's phone coding round, then got a 40-minute hiring-manager round that was all classic behavioral. One note on a concurrency prep hint that never actually came up. Still waiting on the result.
Anthropic onsite — "why Anthropic", a cloud-capacity data analysis, and SQL
A non-SWE-flavored loop that surprised people: heavy on culture fit plus a data-analysis task that needed some cloud-capacity intuition, and some SQL — but no traditional coding or system-design round. Commenters kept asking what role this even was.
Anthropic "Coding Interview with Claude" — the new work-with-AI format
Got Anthropic's newer interview format where the entire point is writing and reviewing code using AI tools — tool access is provided and you don't need to set anything up in advance. I applied through the online application; best guess is it's an infra role. Sharing the actual prompt they sent since a few people hadn't seen this format.
Anthropic coding interview FAQ
- What coding questions does Anthropic ask?
- 20 reported coding questions, most often on Parsing, String, Python, Hashmap, Greedy.
- How hard is the Anthropic coding interview?
- The reported coding questions average 3.1 out of 5: 2 at 2/5, 14 at 3/5, 4 at 4/5.
- Are these Anthropic coding questions recent?
- The most recent report is from October 2026, and 12 were reported within the last twelve months. Dates come from the interview reports themselves.