Design Twitter
Design a social media platform similar to Twitter but incorporating Amazon-style product features such as product recommendations, shopping integration, or e-commerce functionality.
Asked at:

Amazon
Asana
Twitter+Commerce is a social microblogging and discovery platform where people post short updates, follow others, and consume a fast, personalized feed that also surfaces shoppable products, recommendations, and in-app checkout. Think Twitter’s real-time feed blended with Amazon-style product discovery, ratings, and purchase flows. Interviewers ask this to see if you can merge two heavy hitters: a low-latency social feed (read-heavy, fanout trade-offs, real-time updates) with reliable e-commerce (multi-step workflows, inventory, payments, idempotency). They’re testing whether you can define clear boundaries between social and commerce domains, scale hot paths, and keep transactional integrity while maintaining a crisp user experience.
Common Functional Requirements
Most candidates end up covering this set of core functionalities
Users should be able to post short updates with optional media and product attachments or tags.
Users should be able to follow accounts and see a personalized, real-time home timeline that mixes followed content with recommended products.
Users should be able to search and discover tweets and products, view product details in-app, and add items to a shopping cart.
Users should be able to complete checkout securely, including payment, inventory reservation, order confirmation, and delivery status notifications.
Common Deep Dives
Common follow-up questions interviewers like to ask for this question
This is the critical hot path. Interviewers want to see whether you can separate retrieval from ranking, precompute what’s possible, and choose the right fanout strategy while handling celebrity traffic and cache efficiency. - Consider a dual strategy: fanout-on-write for the majority of users and fan-in-on-read for celebrities to avoid write amplification and hot partitions; cache per-user home timelines in Redis with short TTLs. - Separate retrieval and ranking: fetch candidates (followed, recent, and product recommendations) quickly, then apply a lightweight, bounded-time re-ranker; enforce timeouts and degrade gracefully to cached results if ranking is slow. - Use an append-only event stream (e.g., Kafka) to drive feed materialization jobs and invalidate caches; precompute lightweight per-user lists so your read path mostly hits Redis and only falls back to storage on cache miss.
Mixing social and product data naively leads to slow queries and brittle schemas. Interviewers look for clean data domain separation with the right indexing/search choices and denormalization strategies. - Keep separate search indices for tweets and products (e.g., tweets in a social index, products in a catalog index) and combine results at the application layer; avoid cross-domain joins on the hot path. - Denormalize frequently queried fields (e.g., author handle, product price and availability) into each document to keep searches single-hop; use write-time pipelines to update both storage and search. - For product discovery, consider a dedicated search engine with faceting, synonyms, and typo-tolerance; for tweets, tune recency and engagement signals; apply strict latency budgets and fallback to cached query results.
Checkout is a multi-step workflow with external dependencies (payment processors, fulfillment). Interviewers want to see sagas, idempotency, and recovery paths that prevent overselling or double-charging. - Implement a saga: reserve inventory, authorize payment, create order, capture funds; on failure, compensate (release inventory, void authorization) and emit events to keep systems in sync. - Use idempotency keys on client-initiated actions (place order, pay) and the outbox pattern to atomically persist state changes and publish events (via Kafka) to avoid duplicates under retries. - Separate inventory reservation from finalization, with TTLs on holds; enforce at-least-once processing with deduplication and build reconciliation jobs for eventual consistency.
The goal is to blend taste (social) with intent (shopping) without hurting latency. Interviewers look for a streaming + batch architecture, feature stores, and fast re-ranking at request time. - Maintain a feature store fed by batch pipelines (daily aggregates) and streaming updates (near-real-time behavior) so you can serve up-to-date candidate sets without expensive joins. - Generate product/tweet candidates offline, then do lightweight real-time re-ranking per user/request; keep the online model simple (e.g., linear or tree-based) to meet latency. - Use event streams (e.g., Kafka) to capture interactions for online learning signals and guardrails (freshness, diversity, safety) to avoid echo chambers and spam.
Relevant Patterns
Relevant patterns that you should know for this question
A Twitter-like feed and notifications (likes, retweets, order status) demand push or near-real-time updates. You need fanout triggers, cache invalidations, and streaming events to keep timelines and carts/orders fresh without heavy polling.
Home timelines, product pages, and search results are read-heavy. Precomputation, caching (per-user feeds, product details), and denormalized indexes are essential to hit sub-200 ms p95 while handling massive fanout and spikes.
E-commerce flows—inventory reservation, payment authorization/capture, order creation, refunds—are multi-step and cross-service. Sagas, idempotency, and compensations ensure correctness under failures and retries.
Relevant Technologies
Relevant technologies that could be used to solve this question
Similar Problems to Practice
Related problems to practice for this question
Both require low-latency, personalized feeds with a mix of followed content and recommendations, plus strategies like fanout, caching, and ranking pipelines.
Checkout needs reliable payment authorization/capture, idempotency keys, and webhook/event handling, mirroring Stripe-like concerns around correctness and retries.
Managing product listings, inventory/availability, user actions at scale, and search/discovery patterns aligns with e-commerce domain modeling and consistency needs.
Red Flags to Avoid
Common mistakes that can sink candidates in an interview
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Mid August, 2025
Asana
Staff
Late January, 2025

Amazon
Mid-level
Design twitter but with some Amazon product twists
Your account is free and you can post anonymously if you choose.