Anthropic Interview Questions
Practice the exact questions companies are asking right now.
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....
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...
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...
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...
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...
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...
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...
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...
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: ...
Optimize MapReduce performance
MapReduce Model and Optimization for Parallel Efficiency and Network Utilization Context You are designing a large-scale batch processing job (e.g., f...
Convert stack samples to trace events
Question Implement convertToTrace(samples) that, given a chronologically ordered vector of stack samples (each sample contains a timestamp and a call-...
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...
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...
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...
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 ...
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...
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...
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....
Design a desktop AI chat frontend
Design a Frontend Architecture for a Cross-Platform Desktop Conversational AI App Context You are designing the frontend architecture for a cross-plat...