System Design · Middle · Question 3 of 75
How would you design an infinite feed with thousands of posts?
- ✓Correct answer: Cursor loading via
IntersectionObserverplus list virtualization - 2Load all posts in one request and hide the extra ones with CSS
- 3Fetch new posts on a timer every 2 seconds
Explanation
A sentinel element near the end of the list triggers loading the next page. Virtualization keeps only visible items in the DOM. Also consider: restoring scroll position when navigating back, images with explicit dimensions, new posts at the top without the feed "jumping".