Design the Instagram Direct Inbox With Ordering and Unread Counts
Last updated: November 29, 2026
Quick Overview
Design the Instagram Direct inbox: the list of conversations sorted by most recent activity, with an accurate unread badge per thread and a total unread count on the app icon, synced across devices.
Meta
November 29, 20260
0
0 solved
Design the Instagram Direct inbox: the list of conversations sorted by most recent activity, with an accurate unread badge per thread and a total unread count on the app icon, synced across devices.
Instead of the full chat system, this question zooms in on the inbox index, which is where read amplification and counter consistency bite. Interviewers look for a per-user denormalized index and careful counter semantics.
What the Interviewer Expects
- Design a per-user inbox index sorted by last activity
- Define unread count semantics precisely
- Keep counts consistent across devices
- Handle message requests and folders
- Discuss write amplification for group threads
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you avoid the badge showing 3 when the inbox shows 2 unread threads?
- How would you support pinning threads to the top?
- What breaks if a user is in 20,000 threads?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: list threads by last message time, paginate, unread badge per thread, total unread threads on the icon, mark as read on any device clears it everywhere, separate Primary/General/Reques...
High-Level Design
Messages live in a thread store keyed by thread_id. The inbox is a separate per-user inbox index with rows (user_id, folder, last_activity_ts, thread_id) plus a small per-thread member state `...