← Anthropic Interview Insights

Anthropic·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

System design round at Anthropic for a software engineer role, focused entirely on designing Instagram's backend. Pretty deep dive covering feed generation, scaling, and recommendations. The kind of interview where you realize halfway through how many moving parts there actually are.

Questions Asked (8)

Q1

Design the backend for a photo-sharing app like Instagram, including photo uploads, a home feed, and the follow graph.

System DesignData ModelingAPI & Integrations
Author's notes

Big open-ended opener.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale (e.g., daily active users, upload volume, feed latency). Then design the core components—photo upload pipeline, feed generation, and follow graph—focusing on data models, storage choices, and trade-offs. Finally, discuss scaling strategies like caching, sharding, and asynchronous processing.

Pro tip: Emphasize the trade-off between fan-out on write vs. read for feed generation, and propose a hybrid approach for celebrities. This shows you understand real-world complexities beyond basic designs.

1. Clarify Requirements and Scale

Ask about expected scale (users, photos, follows), latency requirements, and features like feed ranking. Establish assumptions to guide design decisions.

2. Design Photo Upload and Storage

Outline the upload flow: client requests pre-signed URL, uploads directly to object storage (e.g., S3), then metadata is saved in a database. Include image processing (resizing, thumbnails) via asynchronous workers.

3. Design the Follow Graph

Model the follow relationship in a graph database or a relational table with indexes. Discuss sharding strategies (e.g., by user ID) and caching for fast follower/following lookups.

4. Design the Home Feed

Compare fan-out on write (push) vs. fan-out on read (pull) for feed generation. Propose a hybrid approach: push for normal users, pull for celebrities. Include caching and ranking.

5. Address Scalability and Trade-offs

Discuss scaling components: CDN for media, database sharding, caching layers (Redis), and message queues for async tasks. Highlight trade-offs like consistency vs. latency.

Key Points to Mention

  • Use of object storage (e.g., S3) for photos and CDN for delivery.
  • Data model for follow graph: adjacency list with sharding by user ID.
  • Feed generation strategies: fan-out on write vs. read, and hybrid for celebrities.
  • Caching strategies: Redis for feed and follow lists.
  • Asynchronous processing with message queues for image resizing and feed updates.
  • Trade-offs: consistency vs. availability, latency vs. cost.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How would you generate a user's home feed? Compare fan-out on write versus fan-out on read and explain which you'd pick for a read-heavy system.

System DesignTechnical Trade-offs
Author's notes

This is where the interview got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the home feed generation problem and the two main strategies: fan-out on write (push) and fan-out on read (pull). Compare their trade-offs in terms of latency, storage, and complexity, then justify your choice for a read-heavy system, likely favoring fan-out on write with optimizations like hybrid approaches for high-profile users.

Pro tip: Mention that real-world systems often use a hybrid approach, such as fan-out on write for most users but fan-out on read for celebrities with millions of followers, to balance write and read costs. This shows you understand practical scalability trade-offs.

1. Clarify requirements and assumptions

Ask about scale (users, followers, read/write ratio), latency requirements, and consistency needs. State assumptions if not provided.

2. Explain fan-out on write

Describe how new posts are immediately pushed to followers' precomputed feeds. Highlight pros (fast reads) and cons (expensive writes, storage duplication).

3. Explain fan-out on read

Describe how feeds are generated on demand by pulling posts from followed users. Highlight pros (cheap writes, no duplication) and cons (slow reads, complex queries).

4. Compare trade-offs

Contrast write amplification, read latency, storage cost, and complexity. Use metrics like fan-out factor and read/write ratio.

5. Choose and justify for read-heavy system

Select fan-out on write (or hybrid) because it optimizes for read-heavy workloads by precomputing feeds, ensuring low-latency reads. Mention caching and denormalization.

Key Points to Mention

  • Fan-out on write (push) precomputes feeds, making reads O(1) but writes O(followers).
  • Fan-out on read (pull) computes feeds on demand, making writes O(1) but reads O(following) and potentially slow.
  • Read-heavy systems benefit from fan-out on write due to low read latency, but it can be costly for users with many followers.
  • Hybrid approach: use fan-out on write for normal users and fan-out on read for celebrities to mitigate write amplification.
  • Storage and write amplification trade-offs: fan-out on write duplicates data, increasing storage and write load.
  • Caching and precomputation are key to achieving low-latency reads in a read-heavy system.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

A celebrity account has 50 million followers and posts something. How do you handle the write storm under fan-out on write?

System DesignTechnical Trade-offs
Author's notes

Follow-up to the feed question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements, then explain the fan-out on write model and its bottleneck with 50M followers. Propose a hybrid approach that combines fan-out on write for most users with fan-out on read for celebrities, and discuss trade-offs like latency, consistency, and cost.

Pro tip: Mention that you would monitor and dynamically adjust the threshold for when to switch between fan-out strategies based on real-time load, showing awareness of operational complexity.

1. Clarify Requirements

Ask about expected read/write patterns, latency requirements, and consistency needs to tailor the solution.

2. Explain Fan-out on Write

Describe how fan-out on write works and why it causes a write storm with 50M followers (e.g., 50M writes per post).

3. Propose Hybrid Approach

Suggest using fan-out on write for normal users and fan-out on read for celebrities, merging results at read time.

4. Address Trade-offs

Discuss trade-offs: increased read latency for celebrity posts, complexity of merging, and potential inconsistency.

5. Optimize and Scale

Mention optimizations like caching, async processing, and dynamic threshold adjustment based on load.

Key Points to Mention

  • Fan-out on write vs. fan-out on read
  • Hybrid approach for celebrities
  • Write amplification and its impact
  • Read-time merging and caching strategies
  • Trade-offs in latency, consistency, and cost
  • Dynamic threshold and monitoring

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

How would you partition the feed store and user data across many nodes, and why use consistent hashing instead of a simple modulo approach?

System DesignTechnical Trade-offs
Author's notes

Consistent hashing came up and I was glad I'd reviewed it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and access patterns of the feed store and user data, then propose a partitioning strategy that balances load and minimizes reshuffling. Explain consistent hashing as a solution to the remapping problem of modulo hashing, and discuss trade-offs like virtual nodes and replication.

Pro tip: Mention that consistent hashing is used in real systems like Dynamo and Cassandra, and that virtual nodes help with load balancing—this shows practical awareness beyond textbook theory.

1. Clarify requirements and data characteristics

Ask about data size, read/write ratio, latency requirements, and whether the feed is user-specific or global. This determines partitioning key choice (e.g., user ID for user data, feed ID for feeds).

2. Explain modulo hashing and its limitations

Describe how simple modulo (hash(key) % N) distributes data but causes massive reshuffling when N changes (e.g., adding/removing a node), leading to cache misses and downtime.

3. Introduce consistent hashing and how it works

Explain the hash ring, where nodes and keys are mapped to a circle; keys are assigned to the next node clockwise. Adding/removing a node only affects a fraction of keys.

4. Address load balancing and replication

Discuss virtual nodes (each physical node mapped to multiple points on the ring) to avoid hotspots, and replication (e.g., N replicas) for fault tolerance and availability.

5. Compare trade-offs and mention real-world use

Acknowledge that consistent hashing adds complexity but is essential for dynamic scaling; cite systems like Dynamo, Cassandra, or Redis Cluster that use it.

Key Points to Mention

  • Modulo hashing causes remapping of almost all keys when node count changes, leading to cache misses and data movement.
  • Consistent hashing minimizes remapping: only K/N keys are moved on average when a node is added/removed.
  • Virtual nodes improve load distribution and allow heterogeneous node capacities.
  • Replication strategies (e.g., N replicas) ensure fault tolerance and high availability.
  • Partitioning key choice (e.g., user ID vs. feed ID) affects data locality and query patterns.
  • Real-world systems like Amazon Dynamo, Apache Cassandra, and Redis Cluster use consistent hashing.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

Walk me through how you'd design a 'people you may want to follow' recommendation feature.

System DesignProduct Sense & Ideation
Author's notes

Saved this for the end and honestly ran a bit low on time.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the product context and requirements, then outline a high-level system design covering data sources, candidate generation, ranking, and serving. Emphasize scalability, evaluation metrics, and iteration, while discussing trade-offs and potential challenges.

Pro tip: Demonstrate product sense by linking technical choices to user value and business goals, and proactively discuss how you'd measure success and iterate based on feedback.

1. Clarify Requirements

Ask questions to understand the product goals, scale, and constraints. Define what 'follow' means and the success metrics.

2. Data & Signals

Identify relevant data sources such as user profiles, interactions, and social graph. Discuss how to handle sparse data and cold start.

3. Candidate Generation

Describe methods to generate a pool of potential followees, e.g., collaborative filtering, graph-based approaches, or content similarity.

4. Ranking & Scoring

Explain how to rank candidates using a model that predicts likelihood of follow or engagement, incorporating features and business rules.

5. Serving & Evaluation

Outline the serving architecture (batch/real-time), A/B testing, and offline/online evaluation metrics to iterate.

Key Points to Mention

  • Cold start problem and how to handle new users
  • Scalability and latency considerations for real-time recommendations
  • Use of machine learning models (e.g., matrix factorization, deep learning) for ranking
  • Evaluation metrics: precision@k, recall, NDCG, and online metrics like follow rate
  • Privacy and ethical considerations in using user data
  • Feedback loops and continuous improvement based on user interactions

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q6

A user follows 5,000 accounts. How do you keep their feed load fast under fan-out on write, and what does fan-out on read cost them?

System DesignTechnical Trade-offs
Author's notes

Shorter follow-up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scale and requirements, then compare fan-out on write vs. read for a user following 5,000 accounts. Propose a hybrid approach that precomputes feeds for active users and falls back to on-read merging for inactive or high-fan-out cases, while discussing caching and ranking to keep loads fast.

Pro tip: Emphasize that the real bottleneck is often the tail latency of merging thousands of sources, so use tiered caching and precomputation for active users, and consider a pull-based fallback for the long tail to avoid write amplification.

1. Clarify requirements and constraints

Ask about user activity patterns, feed freshness requirements, and read/write ratios to determine the appropriate trade-off.

2. Analyze fan-out on write

Explain that on write, each post is pushed to all followers' feeds, which for 5,000 followees means a user's feed is precomputed but writes are expensive and can cause high latency for celebrities.

3. Analyze fan-out on read

Explain that on read, the feed is assembled by pulling from all 5,000 followees at request time, which shifts cost to reads and can cause slow feed loads due to merging and ranking thousands of items.

4. Propose a hybrid solution

Suggest precomputing feeds for active users (fan-out on write) and using fan-out on read for inactive users or those following many high-volume accounts, with caching layers to speed up reads.

5. Discuss optimizations and trade-offs

Mention techniques like ranking at write time, using a fast in-memory store (e.g., Redis) for precomputed feeds, and limiting the number of followees considered for real-time merging.

Key Points to Mention

  • Fan-out on write: precompute feeds, fast reads, but high write amplification and latency for users following many accounts.
  • Fan-out on read: no precomputation, but read latency grows with number of followees (5,000) and requires merging/ranking at request time.
  • Hybrid approach: precompute for active users, on-read for inactive or high-fan-out users.
  • Caching strategies: use Redis or similar for precomputed feeds, and cache merged results for on-read.
  • Ranking and freshness: consider ranking at write time to reduce read-time computation, and set freshness SLAs.
  • Scalability: handle celebrities with special logic (e.g., pull their posts separately) to avoid write storms.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q7

When a user unfollows someone, what happens to posts that were already pushed into their precomputed feed?

System DesignTechnical Trade-offs
Author's notes

Tricky edge case I hadn't fully thought through.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's feed architecture (push vs. pull) and the consistency requirements. Then discuss the trade-offs between immediate removal, lazy filtering, and eventual consistency, and propose a solution that balances user experience with system performance.

Pro tip: Mention that the right approach depends on product requirements and scale; for example, at Anthropic's scale, a hybrid approach with lazy filtering and asynchronous cleanup is often optimal. Also, consider the user's perception: they expect the unfollowed user's posts to disappear promptly, but a slight delay is acceptable if performance is maintained.

1. Clarify the system architecture

Ask whether the feed is precomputed (push model) or generated on read (pull model), and whether it's a social graph like Twitter. This determines the scope of the problem.

2. Identify the core challenge

Explain that precomputed feeds contain posts from followed users, so unfollowing creates stale entries. The challenge is to remove or hide those posts without disrupting the user experience or overloading the system.

3. Evaluate trade-offs of possible solutions

Compare immediate removal (costly, may cause latency spikes), lazy filtering (cheap but adds read-time overhead), and asynchronous cleanup (eventual consistency). Discuss pros and cons of each.

4. Propose a hybrid approach

Suggest a combination: mark the unfollow event, filter out posts from unfollowed users at read time, and asynchronously remove them from the precomputed feed in the background. This balances performance and consistency.

5. Address edge cases and scalability

Discuss handling of re-follows, large fan-out, and ensuring the solution scales with millions of users. Mention monitoring and metrics to validate the approach.

Key Points to Mention

  • Push vs. pull feed models and their implications for unfollow handling
  • Trade-offs between immediate consistency and system performance
  • Lazy filtering at read time to hide posts from unfollowed users
  • Asynchronous background cleanup to remove stale posts
  • Handling re-follows and ensuring idempotency
  • Scalability considerations for large social graphs

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q8

How would you evolve a strictly chronological feed into a ranked feed without rebuilding the whole pipeline?

System DesignTechnical Trade-offs
Author's notes

Didn't get deep into this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the current pipeline and constraints, then propose an incremental, hybrid approach that layers ranking on top of the existing chronological feed. Focus on decoupling ranking from ingestion, using feature flags and A/B testing to validate changes without disrupting the pipeline.

Pro tip: Emphasize the importance of maintaining a fallback to the chronological feed and using shadow mode to compare ranked vs. chronological results before full rollout. This shows you prioritize reliability and data-driven decisions.

1. Clarify Requirements and Constraints

Ask about the current pipeline architecture, latency requirements, scale, and what 'ranked' means (e.g., engagement, relevance). Understand why a full rebuild is undesirable.

2. Design a Hybrid Architecture

Propose keeping the existing ingestion and storage layers, but adding a ranking service that consumes the chronological feed and reorders items. Use a feature store for ranking signals.

3. Implement Incrementally with Feature Flags

Roll out ranking behind a feature flag, starting with a small percentage of traffic. Use A/B testing to measure impact and allow instant rollback to chronological.

4. Monitor and Iterate

Set up metrics for engagement, latency, and system health. Use shadow mode to compare ranked vs. chronological without affecting users, then gradually increase traffic.

5. Address Trade-offs and Scalability

Discuss trade-offs like increased latency, complexity, and cost. Propose caching, precomputation, or approximate ranking to meet performance goals.

Key Points to Mention

  • Decoupling ranking from ingestion to avoid pipeline rebuild
  • Feature flags and gradual rollout for risk mitigation
  • A/B testing and shadow mode for validation
  • Fallback to chronological feed for reliability
  • Use of a feature store for ranking signals
  • Trade-offs: latency, cost, complexity, and user experience

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.