 All Problems
Design Twitter
medium
design
hash table
heap
amazon
microsoft

Design a simplified version of Twitter where users can post tweets, follow/unfollow, and see the 10 most recent tweets in their news feed.

  • void postTweet(int userId, int tweetId)
  • List<Integer> getNewsFeed(int userId) — 10 most recent tweet IDs from userId and followees.
  • void follow(int followerId, int followeeId)
  • void unfollow(int followerId, int followeeId)

Constraints: 1 <= userId, followeeId <= 500

Run to check your code against the sample cases, or submit to run every case