Anthropic Interview Questions
Practice the exact questions companies are asking right now.
Design a distributed web crawler
Problem Design a web crawler that starts from one or more seed URLs and continuously discovers and fetches pages. Requirements - Inputs: One or more s...
Implement staircase printing and distributed mode/median
Problem A: Print a “staircase” pattern Implement a function that prints a staircase with n rows. Input - An integer n (n >= 1) Output - Print n lines....
Generate outputs for images and pipelines
You are given m input images and n processing pipelines. - Each pipeline is an ordered list of k operations (e.g., resize, rotate, crop, blur, color t...
Optimize HTTP requests for speed and limits
You are building a service that needs to send HTTP requests to a large number of URLs (for example, a simple web crawler or data fetcher). The naive i...
Find duplicate files and apply image operations
Part A — Find duplicate files by content You are given a list of directory records. Each record is a string describing a directory path followed by on...
Implement file deduplication at scale
Write a program to deduplicate files in a very large directory tree. Identify groups of identical files without loading entire files into memory. Outl...
Design a single- and multi-threaded web crawler
Web Crawler (single-threaded, then multi-threaded) You are given: - A starting URL startUrl (e.g., "http://news.example.com/a/index.html"). - An inter...
Design an in-memory banking service
Design an in-memory banking service supporting timestamped operations and edge-case semantics. Implement: ( 1) create_account(id, t): Create a new acc...
How would you scale batch image pipelines?
Design a system to process m input images with n pipelines, producing m×n outputs. - Pipelines are sequences of image operations (resize/rotate/filter...
Detect duplicate files efficiently
You are given access to a very large file system containing file paths and read access to file contents. Design an algorithm to identify groups of fil...
Convert stack samples to execution trace
You are given sampling-profiler output: a list of Sample objects ordered by timestamp ascending. Each Sample has (t: float, stack: list[str]) where st...
Optimize a core kernel for throughput
You are given a mocked “core kernel” function (similar in spirit to a GPU kernel / tight compute loop) that is functionally correct but slow. Task - O...
Estimate VRAM and compare model parallelism
You are reasoning about GPU memory and parallelism for a transformer-like workload dominated by matrix multiplications. Part 1: Can one matmul’s tenso...
Design distributed median and mode
Distributed System Design: Global Median and Global Mode at Massive Scale Context You are designing a distributed analytics system that must compute t...
Design a low-latency ML inference API
System Design: Low‑Latency ML Inference API (Real‑Time) Context You are designing an in‑region, synchronous inference API used by product surfaces (e....
Parse and Reconstruct Stack Trace
Given a multi-line stack trace string from a single thread (e.g., each frame is in the form 'at Module::Function(file:line)'), design and implement a ...
Implement crawler, dedup, and persistent LRU
Question LeetCode 1236. Web Crawler: Crawl web pages starting from a given URL within the same hostname. LeetCode 609. Find Duplicate File in System: ...
Simulate stack traces from logs
Given a list of log entries describing function calls, each formatted as "<id> <event> <timestamp>" where event ∈ {START, END} and timestamps are inte...
Design production-ready dedup service
System Design: Production-Ready File Deduplication Service Context Design a multi-tenant cloud service that stores files and achieves space savings vi...
Discuss culture and collaboration
Behavioral & Leadership: Team Culture, Feedback, Ambiguity, and Disagree-and-Commit Context: You are interviewing for a Software Engineer role during ...