Describe how you would implement a newsfeed such as facebook.

User can post and follow other user. User can also comment, upvote & downvote posts.
We need to show user their newsfeed. Posts in newsfeed will be sorted on followed users post, upvote-downvote, number of comments & timestamp of post.

  1. How will you design this problem?
  2. How will you handle the possibility of comments/upvote/downvote on comments?
  3. How will you design code to handle different sorting mechanisms?
Comments (5)