Instagram Feed System Design: Interview Question Explained @KGPTalkie
Instagram Feed System Design: Interview Question Explained  @KGPTalkie
Uploaded November 2026 | Updated November 2026, 20 hours ago
Five new posts arrive, and you scroll into five you've already seen. In a System Design Interview you get exactly this question: "Design the Instagram feed."

System Design Interview, Day 008. Most candidates say "fetch the posts of everyone the user follows from the database, and sort by time". One line like that, and the round is over. Crores of users, each following hundreds of accounts, and that query on every feed open: the database goes down.

- Fix 1: a ready-made feed for every user. A feed cache, say in Redis, holds a list of post IDs per user, newest first, capped (say at 500 IDs) so older ones drop off. Opening the feed is just reading that list
- Fix 2: how the list gets filled. A new post is saved to storage and the database, then an event goes onto a queue. Fan-out workers look up the author's followers and add the post ID to every follower's list. It's async, so the person posting never waits
- Fix 3: celebrities. For an account with crores of followers, don't fan out. Their posts are pulled and merged into your list when you open the feed. That's the hybrid
- Fix 4: ranking and hydration. Take the top few hundred candidates from the list and order them with a ranking model: who you interact with, how new the post is, how many likes it's getting. Then hydrate: from the IDs, fetch the real post, the photo's CDN link and the like count. And filter out deleted posts and posts from blocked accounts
- The question after that: "New posts arrive at the top while the user scrolls. What happens on the next page?" With offset paging ("the next twenty after the first twenty"), five new posts shift everything and the user sees five posts again. The fix: a cursor. Return the post shown last with every page and start the next page right after it. For a ranked feed, save the session's ranked list for a while and let the cursor move through it

Say this in the round and you stand out: a ready feed cache for every user, async fan-out, pull for celebrities, ranking and hydration, and pagination with a cursor.

Next System Design Interview episode: design Uber's ride matching. Comment and tell me: which feed do you prefer, by time or ranked?

kgptalkie.com

#shorts #SystemDesign #SystemDesignInterview #InstagramFeed #FanOut #NewsFeed #BackendInterview #InterviewPrep #SoftwareEngineering #DistributedSystems #Pagination #KGPTalkie
Instagram Feed System Design: Interview Question ExplainedProduction RAG for Finance with Qwen 3.8 27B: Fully Local Ollama + Qdrant (Live)AI Chatbot Hallucination: The Bot Promised the Wrong Refund | AI System Design InterviewSentencePiece Tokenizer Explained | Tokenization Without SpacesProduction RAG for Finance with NVIDIA Nemotron 3.5 Lightning: Fully Local Ollama + Qdrant (Live)Ryzen AI Halo vs DGX Spark: $700 Apart, Almost the Same Speed #shortsFine-Tune Gemma 3 270M on MacBook with Unsloth Studio (No Code)Hindi vs English Tokens: Why Hindi Needs 3x MoreWhy Transformers Replaced RNNs: 499 Steps vs Just One | LLM InterviewRun a Coding AI on Your Own Laptop (8B, No GPU) #shortsClaude Opus 5.5 vs GPT-6.1 Sol: 5 Real Coding Tests, Is the Expensive One Better?Nemotron 3.5 Lightning 33B vs Claude Haiku 5.5: 5 Real Coding Tests, RTX 5090 vs the Cloud
Laxmi Kant | KGP Talkie |

Instagram Feed System Design: Interview Question Explained

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER