MEDIUMasked at 4 companies

Design Twitter

A medium-tier problem at 43% community acceptance, tagged with Hash Table, Linked List, Design. Reported in interviews at X and 3 others.

Founder's read

Design Twitter is the system-design problem that catches candidates off guard because it looks simple on the surface. You need to build a feed, follow mechanism, and post retrieval, but the trap is the feed generation. X, Coupang, PayPal, and Meesho have all asked it. At 42.6% acceptance, you're fighting an uphill battle if you don't nail the data structure choice. StealthCoder solves it invisibly during the assessment if you freeze on the heap logic or linked list traversal.

Companies asking
4
Difficulty
MEDIUM
Acceptance
43%

Companies that ask "Design Twitter"

If this hits your live OA

Design Twitter is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.

Get StealthCoder
What this means

The core trick is that you can't sort all posts by timestamp every time someone loads their feed. You need a max heap or priority queue to efficiently pull the K most recent posts from a user's followed accounts. Most candidates start with a naive loop through followers and posts, which times out. The second pitfall is managing the follow/unfollow state correctly and keeping the feed consistent. Hash tables anchor user accounts and posts, linked lists or heaps order them by recency. The heap approach works but demands careful state management during unfollows. If you hit this live and your first approach bombs, StealthCoder surfaces the working heap-based solution in seconds.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Design Twitter recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Design Twitter interview FAQ

Is Design Twitter still asked at top companies?+

Yes. X, Coupang, PayPal, and Meesho all report it. It's a classic mid-level system design that separates candidates who can reason about data structures from those who code by pattern matching.

What's the main algorithmic trick?+

Use a max heap or priority queue to efficiently fetch the K most recent posts from a user's feed. A naive approach that iterates through all followed users and all their posts will timeout. The heap lets you extract the top K in O(K log N) time.

How do Hash Table, Linked List, and Heap relate here?+

Hash tables store users and their posts for O(1) lookups. Linked lists can order posts chronologically (though less efficient). Heaps let you rank posts by timestamp without sorting the entire feed on each request. Together they balance speed and correctness.

What kills most solutions?+

Forgetting to handle the follow/unfollow operations correctly, or rebuilding the entire feed on every request. Also, not realizing a simple sorted list won't scale. The heap is non-negotiable for the 10K follower case.

Do I need to code it perfectly in the interview?+

You need the core logic right and the heap ordering correct. Edge cases like unfollowing mid-feed and the initial design choice matter. The acceptance rate is 42.6%, so half the people don't get it fully correct under pressure.

Want the actual problem statement? View "Design Twitter" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.