← Better.com Interview Insights

Better.com·Software Engineer·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Did a system design round at Better.com where they asked me to build a mini version of the Twitter timeline. Not a ton of context given upfront, which made it interesting.

Questions Asked (1)

Q1

Design a simplified version of the Twitter home timeline.

System DesignData ModelingTechnical Trade-offs
Author's notes

I jumped straight into the feed fanout problem and probably spent too long debating push vs pull before they nudged me toward actual data modeling.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale (e.g., number of users, tweets per day, read/write ratio), then design a high-level architecture that separates tweet writing from timeline reading, using a fan-out-on-write approach with caching for active users. Discuss trade-offs between push and pull models, and dive into data modeling, storage choices, and handling of edge cases like celebrity users.

Pro tip: Proactively discuss the hybrid approach for celebrities (fan-out-on-write for most, fan-out-on-read for high-follower accounts) to show you understand real-world scalability challenges. Also, mention monitoring and metrics to ensure the system meets latency SLAs.

1. Clarify Requirements and Scale

Ask questions to understand functional and non-functional requirements: number of users, daily active users, tweets per day, read vs. write ratio, latency expectations, and consistency needs. Estimate scale (e.g., 500M tweets/day, 200M DAU) to inform design decisions.

2. High-Level Architecture

Propose a microservices-based architecture with separate services for tweet posting, timeline generation, and user graph. Use a message queue (e.g., Kafka) to decouple tweet creation from fan-out, and a cache (e.g., Redis) to store precomputed timelines for fast reads.

3. Data Modeling and Storage

Design schemas for tweets (tweet_id, user_id, content, timestamp), follows (follower_id, followee_id), and timelines (user_id, tweet_id, timestamp). Choose storage: a distributed SQL database (e.g., Cassandra) for tweets and follows, and Redis sorted sets for timeline caching.

4. Timeline Generation Strategy

Explain fan-out-on-write: when a user tweets, push the tweet to followers' timeline caches. For celebrities with millions of followers, use a hybrid approach: fan-out-on-read for them, merging their tweets at read time. Discuss trade-offs: write amplification vs. read latency.

5. Scaling and Trade-offs

Address scaling: sharding by user_id, replication for fault tolerance, and caching strategies. Discuss trade-offs: consistency vs. availability (AP vs. CP), latency vs. cost, and how to handle hotkeys and thundering herd. Mention monitoring and metrics.

Key Points to Mention

  • Fan-out-on-write vs. fan-out-on-read and the hybrid approach for celebrities
  • Use of caching (Redis) for precomputed timelines and sorted sets for ordering
  • Data sharding and replication strategies for scalability and fault tolerance
  • Message queues (Kafka) for asynchronous processing and decoupling
  • Trade-offs: consistency vs. availability, latency vs. cost, and write amplification
  • Handling edge cases: deleted tweets, new followers, and inactive users

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