LinkedIn Feed
Design a professional-network feed with relevance ranking, connections, and activity fan-out.
Problem Statement
Design the LinkedIn Feed: a personalized professional feed showing posts, articles, videos, polls, job updates, company updates, and network activity from a member's connections, followed people, companies, groups, and second-degree network.
At interview scale, assume hundreds of millions of active members, a massive professional graph, heavy read traffic, bursty content creation around work hours, and strict relevance expectations. The feed must rank items by professional value, relationship strength, engagement, freshness, and intent while avoiding spam, repeated stories, and consumer-social noise.
The hard part is not rendering a list of posts. It is maintaining a continuously changing economic graph, producing low-latency personalized rankings, blending bidirectional connections with one-way follows, supporting hybrid fanout, logging dwell-time signals, and preserving trust because professional recommendations can affect jobs, hiring, sales, and reputation.
Business use case
LinkedIn Feed keeps members engaged with useful professional updates: colleagues changing jobs, hiring posts, industry articles, company news, events, skill content, and opportunities. It drives sessions, ad inventory, creator reach, job discovery, sales engagement, and network growth.
Unlike a generic social feed, the value comes from professional relevance and economic graph context. A weaker but professionally aligned second-degree signal can beat a strong entertainment signal, and employers, recruiters, creators, and members all care about trust, deduplication, and fair distribution.
Functional Requirements
Serve a personalized ranked feed for a member with cursor-based pagination.
Ingest posts, articles, videos, polls, job updates, company updates, reactions, comments, follows, and connection changes.
Support bidirectional connections, one-way follows, company follows, group follows, and second-degree candidate discovery.
Rank feed items using relevance, relationship strength, freshness, engagement, dwell time, content quality, and member intent.
Deduplicate repeated stories, reshares, job updates, and notifications for the same professional event.
Support hybrid fanout so highly connected creators and companies do not overload follower inboxes.
Emit notifications for important network activity without duplicating the feed experience.
Provide moderation, privacy filtering, and blocked-member filtering before content is shown.
Non-Functional Requirements
Latency
Feed open should return the first page in under 300ms p99 within a region, with the ranking service budget kept below roughly 120ms. Post creation can tolerate 500ms to 1s p99 because fanout and notifications are asynchronous.
Availability
The read path should target 99.99 percent availability. If ranking, notifications, or analytics degrade, the system should still serve a safe cached or fallback feed rather than an empty page.
Read-heavy scalability
Members read far more feed pages than they create posts. Scale feed reads independently with precomputed candidate lists, per-member feed caches, stateless feed services, and ranking services that can shed expensive features under load.
Freshness
Important professional events such as new jobs, hiring posts, and close connection updates should appear within seconds to minutes. Less critical articles and viral posts can arrive through slower batch candidate generation.
Consistency and privacy
Connection acceptances, blocks, visibility changes, deleted posts, and company permissions must be enforced before display. Feed order can be eventually consistent, but privacy filters cannot be stale in a way that leaks restricted content.
Ranking quality
The system must optimize for professional relevance, not only clicks. Dwell time, hides, skips, follows, connection degree, job intent, company interest, and content quality should influence ranking while preventing engagement bait.
Cost efficiency
Avoid full recomputation of every member's feed on every graph or content update. Use hybrid fanout, candidate pools, approximate counters, tiered storage, and feature computation pipelines so high-degree entities remain affordable.
Capacity Estimation
Assumptions
Assume 300M daily active members, each opening feed 8 times per day, and each request returning 20 visible items after scoring roughly 500 candidates. Assume 30M new feed-eligible items per day across posts, articles, videos, job updates, polls, reshared updates, and company updates.
Assume 5B engagement and impression events per day, including views, clicks, reactions, comments, hides, skips, and dwell-time beacons. Assume 15B graph edges after storing bidirectional connections as two directed edges and one-way follows as one directed edge. Use a 10x peak multiplier for regional daytime spikes.
Daily feed opens
2.4B requests per day
300M daily active members times 8 feed opens
Average feed read QPS
27,800 reads per second
2.4B divided by 86,400 seconds
Peak feed read QPS
278,000 reads per second
10x average peak during workday windows
New feed items
30M per day
Posts, articles, videos, polls, company updates, jobs, and reshared items
Average content write QPS
347 writes per second
30M divided by 86,400 seconds
Peak content write QPS
3,470 writes per second
10x peak for creator and company activity bursts
Ranking candidates scored
1.2T candidates per day
2.4B feed opens times 500 candidates before pruning
Engagement events
5B events per day
Impressions, clicks, reactions, comments, hides, skips, and dwell pings
Feed item storage
90 GB raw per day
30M items times roughly 3 KB metadata before media payloads
Graph storage
about 1 TB raw
15B directed edges times about 64 bytes per edge before replication and indexes
Hot feed cache
500 GB to 1 TB
Cached candidate IDs, cursors, and features for tens of millions of recently active members
Calculations
- Feed requests: 300M daily active members times 8 feed opens is 2.4B requests per day. 2.4B divided by 86,400 seconds is about 27,778 read QPS, rounded to 27,800. With a 10x peak, plan for about 278,000 read QPS.
- Content writes: 30M feed-eligible items per day divided by 86,400 seconds is about 347 writes per second. With a 10x peak, plan for about 3,470 writes per second.
- Ranking work: 2.4B daily feed opens times 500 candidate items means 1.2T candidate scoring decisions per day before pruning, deduplication, and pagination.
- Visible impressions: if each feed open shows about 20 items, the system records about 48B potential visible slots per day. Not all become true impressions because users may stop scrolling before every item is viewed.
- Event volume: 5B engagement and dwell-time events per day at 300 bytes each is about 1.5 TB raw per day. A 90-day hot analytics window is about 135 TB raw before replication, compression, and indexes.
- Feed item storage: 30M items per day times about 3 KB metadata is about 90 GB raw per day. One year is about 33 TB raw before media storage, search indexes, replicas, and compaction overhead.
- Graph storage: 15B directed edges times roughly 64 bytes is about 960 GB raw. With replicas, adjacency indexes, tombstones, and edge attributes, reserve several TB.
- Cache memory: caching 200 candidate IDs plus small feature snapshots for 50M recently active members can exceed 500 GB after object overhead. Use tiered cache and refresh lazily.
API Design
/api/v1/feed?memberId={memberId}&cursor={cursor}&limit=20Returns a personalized ranked feed page. The cursor encodes the pagination window, dedup state, and ranking session so refreshes do not show the same professional story repeatedly.
Response
{
"memberId": "member_123",
"items": [
{
"feedItemId": "feed_987",
"contentType": "job_update",
"actorId": "company_42",
"reason": "Hiring update from a company you follow",
"rankScore": 0.931,
"createdAt": "2026-07-26T07:05:00Z"
}
],
"nextCursor": "cursor_after_ranked_page",
"servedAt": "2026-07-26T07:06:00Z"
}
200— Ranked feed returned401— Authentication required403— Member cannot access this feed429— Rate limit exceeded
/api/v1/postsCreates a feed-eligible item such as a text post, article share, video, poll, job update, or company update. The synchronous path stores content and emits an activity event; fanout and notifications run asynchronously.
Request
{
"actorId": "member_123",
"actorType": "member",
"contentType": "article",
"visibility": "connections_and_followers",
"text": "Lessons from scaling a professional feed",
"mediaRefs": ["media_555"],
"targetCompanyId": null
}
Response
{
"feedItemId": "feed_987",
"status": "accepted",
"createdAt": "2026-07-26T07:05:00Z",
"fanoutState": "queued"
}
201— Post accepted400— Invalid content, visibility, or media401— Authentication required403— Actor cannot post for this entity429— Creator rate limit exceeded
/api/v1/feed/eventsRecords feed interactions such as impressions, clicks, reactions, comments, hides, skips, and dwell-time measurements. These events update ranking features asynchronously.
Request
{
"memberId": "member_123",
"feedItemId": "feed_987",
"eventType": "dwell",
"dwellMs": 4200,
"position": 3,
"rankingSessionId": "session_abc",
"occurredAt": "2026-07-26T07:06:12Z"
}
Response
{
"accepted": true
}
202— Event queued400— Invalid event payload401— Authentication required429— Event rate limit exceeded
/api/v1/connectionsCreates or accepts a bidirectional connection. The graph service stores two directed edges, updates relationship features, and emits activity for feed and notification pipelines.
Request
{
"requesterId": "member_123",
"targetMemberId": "member_456",
"action": "accept"
}
Response
{
"connectionId": "conn_789",
"status": "connected",
"connectedAt": "2026-07-26T07:04:30Z"
}
200— Connection updated400— Invalid connection transition401— Authentication required403— Connection blocked by privacy rules409— Conflicting graph state
/api/v1/followsCreates a one-way follow edge for a member, company, school, group, creator, topic, or hashtag. Follow edges influence candidate generation but do not imply bidirectional access.
Request
{
"followerId": "member_123",
"targetId": "company_42",
"targetType": "company"
}
Response
{
"followId": "follow_456",
"status": "following"
}
201— Follow created400— Invalid target401— Authentication required403— Follow not allowed
/api/v1/notifications?memberId={memberId}&cursor={cursor}Returns network activity notifications such as connection accepts, job changes, mentions, comments, hiring updates, and high-signal post activity.
Response
{
"memberId": "member_123",
"notifications": [
{
"notificationId": "notif_111",
"type": "connection_job_change",
"actorId": "member_456",
"feedItemId": "feed_987",
"read": false
}
],
"nextCursor": "cursor_after_notification"
}
200— Notifications returned401— Authentication required403— Member cannot access these notifications
Keep feed reads separate from interaction logging and notification reads. Feed reads are latency-sensitive and should be allowed to degrade to cached candidate lists, while events and notifications can be queued, deduplicated, and processed asynchronously.
Database Design
The logical data model separates the professional graph, feed content, event stream, and materialized candidate caches. The serving path should avoid joins across all of these stores on every request; instead, candidate generation and feature pipelines prepare compact records for the feed service.
Connections are bidirectional professional relationships, but they are stored as two directed adjacency edges after acceptance. Follows are one-way and can target people, companies, groups, schools, topics, or hashtags. Feed items reference actors and entities so ranking can reason about economic graph context.
| member_id | uuid | Primary key for a LinkedIn member |
| headline | varchar(256) | Professional headline used by ranking and display |
| industry | varchar(128) | Industry affinity signal |
| geo_region | varchar(64) | Coarse region for relevance and compliance |
| profile_visibility | varchar(32) | Public, connections, private, or restricted |
| created_at | timestamp | Account creation time |
| status | varchar(32) | Active, restricted, deleted, or spam-suspected |
| source_id | uuid | Member or entity that owns the outgoing edge |
| target_id | uuid | Member, company, group, school, topic, or hashtag target |
| target_type | varchar(32) | member, company, group, school, topic, or hashtag |
| edge_type | varchar(32) | connection, follow, block, mute, or invitation |
| strength_score | float | Recent interaction and professional affinity score |
| status | varchar(32) | Pending, active, blocked, muted, or removed |
| created_at | timestamp | Edge creation or acceptance time |
| updated_at | timestamp | Last interaction or privacy update time |
| feed_item_id | uuid | Primary key for a feed-eligible story |
| actor_id | uuid | Member, company, or system entity that produced the item |
| actor_type | varchar(32) | member, company, group, job, or platform |
| content_type | varchar(32) | text, article, video, job, poll, reshare, or company_update |
| visibility | varchar(64) | Public, connections, followers, group, company_admins, or targeted |
| dedupe_key | varchar(128) | Groups repeated stories such as the same job change or reshared article |
| quality_score | float | Spam, trust, content quality, and policy score |
| created_at | timestamp | Creation time used for freshness |
| status | varchar(32) | Active, deleted, hidden, under_review, or blocked |
| event_id | uuid | Unique event id for deduplication |
| member_id | uuid | Member who saw or interacted with the item |
| feed_item_id | uuid | Feed item involved in the event |
| event_type | varchar(32) | impression, click, dwell, reaction, comment, hide, skip, or report |
| position | int | Ranked position at serving time |
| dwell_ms | int nullable | Dwell time for ranking feedback |
| ranking_session_id | varchar(64) | Correlates a served page with subsequent events |
| occurred_at | timestamp | Client or server event time |
| member_id | uuid | Target member whose candidate inbox is materialized |
| feed_item_id | uuid | Candidate item id |
| source_reason | varchar(64) | Connection, follow, second_degree, job_match, group, or company |
| pre_rank_score | float | Cheap score used before online ranking |
| inserted_at | timestamp | When the candidate was added |
| expires_at | timestamp | Candidate expiry for staleness control |
Indexes
- graph_edges.source_id, edge_type, status supports adjacency lookup for candidate generation.
- graph_edges.target_id, edge_type supports reverse fanout and audience estimation.
- feed_items.actor_id, created_at supports fetching recent actor activity.
- feed_items.dedupe_key helps suppress repeated stories.
- feed_events.member_id, occurred_at supports recent negative feedback and dwell features.
- materialized_feed_candidates.member_id, pre_rank_score, inserted_at supports quick candidate reads for active members.
Relationships
Members create feed items and own outgoing graph edges. A bidirectional connection is represented by two active directed edges, while a follow is one directed edge. Feed events reference both the member and the feed item so the ranking pipeline can learn from impressions, reactions, hides, and dwell time.
The online feed service should not perform a relational join across all tables for each page. It reads candidate IDs from cache or materialized candidate storage, hydrates compact item records, asks the graph and privacy layer for eligibility, and sends features to the ranker.
NoSQL alternatives
At large scale, use specialized stores: a graph or adjacency-list KV store for edges, a document or wide-column store for feed item metadata, an event log such as Kafka for interactions, an OLAP lake for analytics, and Redis or a distributed cache for materialized candidates.
The graph store should support fast outgoing adjacency lookup, reverse lookup for fanout estimation, and edge attributes such as relationship strength. The feed item store should be partitioned by feed_item_id and optionally by actor_id for creator timelines. The materialized candidate store is naturally keyed by member_id with time-bucketed candidate lists.
High-Level Architecture
The online read path is client to API gateway to feed service, which reads cached candidates, checks graph and privacy constraints, hydrates content, ranks candidates, and returns a page. Posting, graph changes, fanout, feature updates, dwell logging, and notifications are asynchronous through the activity bus.
The design uses a hybrid feed architecture. Active members and normal-degree creators get materialized candidate lists so feed open is fast. High-degree creators, companies, jobs, and viral posts are pulled or selectively fanned out at read time so one update does not write to tens of millions of inboxes.
The graph service is a first-class dependency because professional relevance depends on connection degree, follows, muted edges, blocked members, shared companies, schools, groups, skills, and second-degree context. This is the main distinction from a generic Facebook-style friend feed: relationship type and economic context matter as much as raw engagement.
Ranking is isolated behind a service so models and feature sets can evolve. The feed service should be able to fall back to a simpler freshness plus graph-strength score when the online ranker or feature store is degraded.
Request Flow
- 1
Feed request is authenticated
The client calls GET /api/v1/feed. The API gateway validates the member session, applies rate limits, extracts locale and device context, and forwards the request to the feed service with the member id and cursor.
- 2
Candidate list is loaded
The feed service reads a per-member candidate list from the feed cache or materialized candidate store. The candidate list contains recent items from connections, followed entities, groups, jobs, topics, and selected second-degree sources.
- 3
Cache miss triggers online candidate generation
If the candidate cache misses or is stale, the feed service asks the graph service for adjacency lists and relationship features, fetches recent actor items, adds promoted professional opportunities, and limits the candidate set before ranking.
- 4
Privacy and eligibility filters run
The service removes deleted posts, blocked actors, muted authors, restricted company updates, private group content, expired jobs, spam-suspected content, and items that violate the member's visibility rules.
- 5
Content is hydrated
The feed service fetches compact item metadata from the content store and media metadata from the edge-backed media layer. Hydration is bounded so missing attachments do not block the entire page.
- 6
Ranking scores professional relevance
The ranking service scores candidates using relationship strength, connection degree, follow intent, industry match, job-seeking intent, freshness, engagement quality, dwell-time history, hides, reports, and content quality.
- 7
Deduplication and diversity are applied
The feed service collapses repeated stories by dedupe key, limits consecutive posts from the same author or company, balances content types, and avoids showing the same job update or article reshare repeatedly across pages.
- 8
Page and cursor are returned
The service returns the top items, ranking reasons, and a cursor that preserves pagination state. The cursor helps avoid duplicates when the member scrolls while new professional activity is arriving.
- 9
Engagement events update future ranking
Impressions, clicks, reactions, comments, hides, skips, and dwell-time pings are written to the activity bus. Stream processors update counters, member features, graph strength, notification rules, and future candidate generation.
Core Components
Feed Service
Coordinates candidate retrieval, filtering, hydration, ranking, pagination, and deduplication.
The Feed Service is stateless and latency-sensitive. It reads candidate IDs, calls graph and content services, invokes ranking, applies business rules, returns a page, and emits impression events asynchronously. It owns graceful degradation when dependencies fail.
Graph Service
Serves the professional graph used for eligibility and relevance.
It stores bidirectional connections as two directed edges and one-way follows as directed edges. It also supports blocks, mutes, shared entities, second-degree expansion, relationship strength, and reverse fanout estimation.
Ranking Service
Scores feed candidates for professional value.
The ranker combines model scores and rules using relationship features, content features, member intent, dwell time, engagement quality, freshness, and trust signals. It should support feature fallbacks, model versioning, and online experiments.
Feed Cache
Stores hot per-member candidate lists and pagination state.
The cache keeps feed open fast for active members. Entries should expire quickly, include dedup state, and be refreshable in the background. It should tolerate partial misses and avoid stampedes through request coalescing.
Content Store
Durable source of truth for feed items and metadata.
It stores posts, articles, job updates, polls, videos, company updates, moderation status, visibility, dedupe keys, and quality scores. Large media payloads belong in object storage and CDN, while the feed serving record remains compact.
Activity Event Bus
Connects writes, interactions, fanout, notifications, and ranking features.
Kafka, Pulsar, or a similar log receives post creates, graph changes, impressions, dwell events, reactions, comments, hides, reports, and notification triggers. Consumers update candidate stores, feature stores, analytics, and alerts.
Notification and Fanout Workers
Materialize candidate updates and send high-signal network notifications.
Workers decide whether to push a story into follower candidate lists, delay it for pull-based retrieval, or create a notification. They apply audience limits, dedupe keys, priority, quiet hours, and relevance thresholds.
Trust and Moderation Layer
Protects the feed from spam, scams, scraping, and low-quality professional content.
The moderation layer scores content, actors, companies, jobs, and engagement patterns. It can downrank, remove, review, or block items before fanout and before display. This is essential because professional feeds influence hiring and reputation.
Deep Dive
Professional graph modeling
LinkedIn has more relationship types than a generic friend graph. A connection is bidirectional and usually implies stronger visibility and trust. A follow is one-way and means interest without reciprocal access. Companies, schools, groups, topics, newsletters, creators, and jobs are also graph entities.
A practical store represents everything as directed edges with attributes: edge type, status, created time, source, target type, interaction strength, privacy flags, and recent engagement. When two members connect, write two active directed edges. When one member follows a company, write one edge.
Candidate generation should weight degree differently. First-degree connection posts are strong candidates, followed company updates are intent-driven candidates, and second-degree posts need proof such as shared industry, mutual connections, job relevance, or high-quality engagement. Blocks and mutes must be negative edges checked before ranking.
Hybrid fanout strategy
Pure fanout-on-write is expensive for high-degree creators, large companies, and job boards because one post could write to millions of member inboxes. Pure fanout-on-read is too slow for every feed open because it must scan many actors and rank too much fresh content.
Use hybrid fanout. Normal members and moderate-degree creators fan out candidate IDs to active followers and close connections. High-degree creators, companies, jobs, and viral stories are stored in actor timelines and pulled during feed read based on relevance and quotas. Inactive members receive fewer precomputed candidates and are refreshed lazily when they return.
The threshold should be dynamic. Fan out more when the author has a small, high-affinity audience. Pull more when the audience is huge, low-affinity, or content quality is uncertain. This keeps freshness without turning celebrity and company posts into write amplification events.
Ranking for professional relevance
Professional relevance is not the same as entertainment engagement. A job opening, hiring manager post, industry article, or colleague promotion may be valuable even if it generates fewer likes than a viral meme. The ranking objective should combine member value, professional intent, trusted engagement, and long-term satisfaction.
Feature groups include graph strength, connection degree, shared employer or school, industry overlap, skills, job-seeking intent, content type, author reputation, freshness, quality, topic embedding similarity, dwell time, hides, reports, and downstream actions such as follows or applications. Dwell time is useful but must be normalized by content type because long articles and videos naturally produce longer dwell.
The ranker should use guardrails: downrank engagement bait, enforce content diversity, protect close-network updates, and avoid over-personalization that traps members in one industry or company bubble. Explainability matters because members may ask why they saw a professional update.
Deduplication, diversity, and pagination
LinkedIn generates many repeated stories: multiple people congratulate the same job change, several connections reshare the same article, a company posts a job that also appears in job recommendations, and a poll may receive many comments. Without deduplication, the feed feels noisy.
Assign a dedupe key by canonical entity and event type, such as job_change plus member id, article_url plus normalized URL, job_id plus company id, or poll_id. Collapse repeated stories into one feed card with social context. Keep a per-ranking-session seen set in the cursor so pagination remains stable while fresh items arrive.
Diversity rules should cap consecutive items from the same actor, company, content type, or story family. The goal is not random variety; it is a balanced professional feed that mixes close-network updates, followed entities, jobs, articles, and timely conversations.
Second-degree network and economic graph
Second-degree candidates are important because they expose opportunities beyond direct connections: a hiring manager followed by a colleague, a founder in the same industry, or a post gaining traction among people with similar skills. They also risk feeling irrelevant or privacy-invasive if overused.
The feed should require stronger evidence for second-degree content than for first-degree content. Useful signals include multiple mutual connections, shared company or school, industry affinity, topic interest, recruiter or job-seeking intent, and high-quality engagement from trusted members. The ranking reason should be explicit, such as popular among people in your network or from a company you follow.
The economic graph angle means entities such as members, companies, jobs, skills, schools, industries, and content topics all participate in relevance. A feed item can be relevant because it connects a member to a job opportunity, a sales prospect, a hiring trend, or a professional learning topic.
Notifications versus feed
Notifications should not be a copy of the feed. They should be reserved for high-signal events: connection requests, accepted connections, mentions, comments on your post, job changes from close connections, hiring updates matching intent, and important company activity.
The notification pipeline consumes the same activity bus but applies stricter thresholds, deduplication, quiet hours, channel preferences, and fatigue controls. It may send push, email, in-app badges, or no alert. Feed ranking can show lower-priority items later without interrupting the member.
This separation improves trust. A noisy feed can be tolerated briefly; noisy professional notifications cause churn and can feel like spam. The system should coordinate dedupe keys so a member does not receive repeated notifications and then see the same story multiple times in feed.
Scaling
Prototype: single region and simple ranking
Start with a relational store for posts and graph edges, a feed service that fetches recent posts from first-degree connections and followed companies, and a simple score combining freshness and relationship type. Add cursor pagination and basic privacy filtering before adding machine learning.
1M to 10M members: cache and event pipeline
Add Redis candidate caches, asynchronous event logging, background fanout workers, and a search or timeline index for recent actor items. Store engagement events in a durable log and begin computing simple relationship strength and content quality features.
50M to 100M members: graph partitioning and hybrid fanout
Move graph edges to a partitioned adjacency store, split content metadata from media storage, and introduce hybrid fanout thresholds. Add a ranking service with feature snapshots and online experiments. Build dedupe and diversity controls into the serving path.
Hundreds of millions of members: global read scale
Replicate read-heavy candidate stores and content metadata across regions, keep graph writes in home shards, and use regional feed services. Precompute candidates for active members, pull high-degree actors at read time, and use load shedding for expensive ranking features.
Staff scale: economic graph and trust platform
Unify members, companies, jobs, skills, schools, topics, and ads into feature pipelines with privacy-aware boundaries. Add model governance, explainability, fairness monitoring, creator distribution controls, spam defenses, and capacity isolation for feed, jobs, ads, and notifications.
Bottlenecks & Optimizations
High-degree creators and companies causing fanout storms
Use hybrid fanout with dynamic thresholds. Push candidate IDs for normal-degree actors, pull high-degree actors at read time, and cap fanout based on audience size, affinity, quality score, and active-follower count.
Graph adjacency lookups on every feed open
Cache member adjacency lists and relationship features, precompute second-degree candidate pools, and keep graph filters compact. Use short TTLs for privacy-sensitive edges such as blocks and mutes.
Ranking service p99 latency
Limit the number of candidates sent to the ranker, use cheap pre-rank scores, batch feature reads, keep hot features in memory, and fall back to a simpler ranker when model inference or feature stores are slow.
Dwell and engagement event volume
Batch client events, sample low-value telemetry when allowed, deduplicate by ranking session and item, and write events to a durable log instead of synchronously updating feed item rows.
Repeated stories crowding out useful updates
Use canonical dedupe keys, session-level seen sets, author and content-type diversity caps, and story aggregation cards that combine multiple reactions or reshares into one professional context.
Hot cache keys for very active members
Shard candidate caches by member id, use request coalescing, refresh candidate lists asynchronously, and limit cursor state size. For power users, generate smaller windows more frequently rather than one huge feed payload.
Failure Handling
Ranking service unavailable
Serve a fallback feed using cached pre-rank scores, freshness, connection degree, and content quality. Log the degraded ranking mode and continue to enforce privacy, moderation, deduplication, and blocked-member filters.
Feed cache outage
Regenerate candidates from graph and actor timelines with strict limits, protect graph and content stores with circuit breakers, and serve a smaller page if necessary. Warm cache gradually after recovery to avoid a stampede.
Graph store partition
Use cached adjacency and relationship features for non-sensitive ranking, but consult a small strongly refreshed block and privacy cache before display. If privacy cannot be verified, suppress questionable items rather than risk leakage.
Activity event bus lag
Feed reads and post creation continue, but ranking features and notifications may be stale. Expose lag metrics, prioritize high-signal events, and avoid replaying old notifications that would annoy members after recovery.
Content store degradation
Return partial pages using cached item metadata and skip items that cannot be hydrated within the latency budget. Do not show stale deleted or moderated content if the status cannot be validated.
Bad ranking model deployment
Use canary rollout, shadow evaluation, guardrail metrics, and fast rollback. Keep a known-good ranking policy and feature schema so the feed can recover without waiting for model retraining.
Security
Privacy enforcement
Visibility rules, blocks, mutes, private groups, company admin permissions, deleted content, and restricted profiles must be checked before display. Privacy filtering should be fail-closed for uncertain content.
Spam and trust
Professional feeds attract scams, fake jobs, engagement pods, scraped content, and impersonation. Use actor reputation, content quality, link safety, graph anomaly detection, and report feedback to downrank or remove abusive items.
Access control
Only authorized members and entity admins can post for a company, edit articles, manage jobs, or view analytics. Feed APIs should never expose private engagement details or restricted profile attributes.
Data minimization
Dwell time, job intent, profile views, and professional interests are sensitive. Keep raw events in controlled stores with retention limits, aggregate where possible, and avoid leaking ranking features in client responses.
Abuse rate limiting
Rate-limit feed scraping, reaction spam, connection spam, follow bursts, and notification-triggering actions. Detect automated scrolling and suspicious event patterns so engagement signals cannot be cheaply manipulated.
Model integrity
Protect ranking models and feature pipelines from poisoned engagement, coordinated pods, and fake accounts. Monitor feature drift, unusual lift from suspicious cohorts, and content that receives low dwell but high artificial reactions.
Tradeoffs
Pros
- +Hybrid fanout keeps feed reads fast without exploding writes for high-degree creators and companies.
- +Separating graph, content, ranking, and events lets each subsystem scale for its access pattern.
- +Professional graph features improve relevance beyond generic engagement metrics.
- +Asynchronous event processing keeps feed reads and post creation resilient during analytics lag.
- +Deduplication and diversity controls improve perceived feed quality and trust.
Cons
- −Hybrid fanout is operationally complex and requires careful threshold tuning.
- −Ranking depends on many features, which increases latency, observability, and model governance burden.
- −Eventual consistency can make fresh posts, graph updates, and notifications appear at different times.
- −Strict privacy and trust filtering can reduce cacheability and increase read-time checks.
- −Second-degree expansion can become expensive and noisy without strong relevance filters.
Alternatives
Alternative one is pure fanout-on-write. It is simple for reads and works for small networks, but high-degree creators, companies, and jobs create huge write amplification.
Alternative two is pure fanout-on-read. It avoids materialized inboxes but makes every feed open scan graph edges and actor timelines, which is too slow for hundreds of millions of members.
Alternative three is a chronological feed. It is easy to explain and cheap to rank, but it misses professional relevance, job intent, second-degree opportunities, and content quality signals.
Alternative four is an ML-only black-box ranker. It may optimize engagement, but without rules and guardrails it can over-promote noisy content, weaken trust, and fail to explain professional relevance.
When not to use this design
Do not use this full design for a small internal company news feed or a simple chronological activity stream. A single database, basic follow table, and freshness ordering are enough until graph size, ranking quality, and fanout cost become real constraints.
Follow-up Questions
How is LinkedIn Feed different from Facebook Feed?
LinkedIn is centered on the professional and economic graph. Connections are professional relationships, follows can target companies and jobs, second-degree content needs professional justification, and ranking should value career relevance, hiring intent, industry learning, and trust instead of only social engagement.
When do you fan out a post on write versus pull it on read?
Fan out on write for normal-degree authors with high-affinity audiences and active followers. Pull on read for high-degree creators, large companies, jobs, viral posts, and uncertain-quality content. Use dynamic thresholds based on audience size, activity, quality, and freshness requirements.
How do you support second-degree recommendations safely?
Require stronger relevance evidence than for first-degree content: mutual connections, shared industry, followed company, skills match, job intent, or trusted engagement. Apply privacy filters and provide clear ranking reasons so the item does not feel random or invasive.
How should dwell time influence ranking?
Dwell time is a useful satisfaction signal, especially for articles and videos, but it must be normalized by content type, length, device, and position. Combine it with hides, reports, follows, comments, applications, and long-term retention so the ranker does not reward clickbait.
What consistency is required for blocks and deletes?
Feed ordering can be eventually consistent, but blocks, deletes, and visibility restrictions should be enforced quickly and fail-closed. Keep a small strongly refreshed privacy cache and invalidate feed candidates when sensitive graph or content status changes.
How do you avoid repeated job changes or article reshares?
Use canonical dedupe keys for the underlying professional event or URL, maintain a seen set in the ranking cursor, and aggregate social context into one card rather than showing every reshare or congratulation as a separate feed item.
How do notifications relate to feed ranking?
Both consume the activity stream, but notifications use stricter thresholds, fatigue controls, quiet hours, and channel preferences. Feed can show many relevant items passively; notifications should interrupt only for high-signal professional events.
Company Variations
LinkedIn interviewers will focus on the economic graph: connections versus follows, second-degree candidates, job and company updates, professional relevance, dwell-time features, trust, and hybrid fanout for high-degree creators and companies.
Meta
Meta may compare this directly with Facebook Feed. Be ready to explain why professional relevance, connection-degree weighting, company and job entities, dedupe, creator distribution, and privacy constraints change the ranking objective and fanout design.
Microsoft
Microsoft may frame the design around enterprise identity, Outlook and Teams notifications, Viva-style employee updates, compliance, and tenant boundaries. Emphasize access control, admin-owned company pages, auditability, and safe integration with productivity signals.
Google may probe large-scale ranking systems, feature freshness, distributed graph storage, tail latency, experimentation, and abuse resistance. Expect follow-ups on model fallback, feature stores, and measuring long-term member value.
Interview Tips
Start by defining the product distinction: LinkedIn Feed optimizes professional relevance and economic opportunity, not generic social entertainment. Then split the design into read path, write path, graph, ranking, event pipeline, and notifications. Use capacity math to justify caching and hybrid fanout, and repeatedly mention that privacy and trust filters are mandatory before any item is displayed.
What interviewers expect
- ✓State read-heavy assumptions and compute feed QPS, content write QPS, event volume, and storage.
- ✓Draw a hybrid architecture with feed service, graph service, ranker, content store, cache, event bus, and notification workers.
- ✓Explain fanout-on-write versus fanout-on-read and choose hybrid thresholds.
- ✓Discuss professional ranking features including connection degree, follows, jobs, companies, dwell time, and quality.
- ✓Call out privacy, deduplication, diversity, and ranking fallback explicitly.
- ✓Differentiate the design from Facebook Feed by emphasizing professional and economic graph relevance.
Common mistakes
- !Treating LinkedIn Feed as a generic chronological social feed.
- !Ignoring the difference between bidirectional connections and one-way follows.
- !Using pure fanout-on-write for companies, celebrities, and jobs without discussing write amplification.
- !Optimizing only for clicks while ignoring dwell time, hides, trust, and professional relevance.
- !Forgetting privacy filters for blocks, mutes, private groups, deleted posts, and restricted company updates.
- !Not explaining deduplication for repeated job changes, article reshares, and network activity.
Red flags
- ×No concrete capacity estimate for hundreds of millions of feed readers.
- ×No graph model or second-degree candidate strategy.
- ×No fallback plan when the ranking service or feature store is slow.
- ×No moderation, spam, or engagement-manipulation protection.
- ×No separation between feed, notifications, and analytics event processing.
Revision Notes
- LinkedIn Feed is a read-heavy professional feed with hundreds of millions of members, not a simple chronological activity stream.
- The graph has bidirectional connections, one-way follows, company and group follows, blocks, mutes, and second-degree relationships.
- With 300M daily active members opening feed 8 times per day, expect about 2.4B feed opens daily, about 27,800 average read QPS, and about 278,000 peak read QPS.
- Use hybrid fanout: push candidate IDs for normal-degree actors and pull high-degree creators, companies, jobs, and viral posts at read time.
- Ranking should combine graph strength, connection degree, follow intent, industry and skill affinity, job intent, freshness, engagement quality, dwell time, hides, reports, and content quality.
- Dwell time is useful but must be normalized by content type and combined with negative feedback so clickbait does not win.
- Deduplicate repeated professional stories with canonical dedupe keys and preserve seen state in the cursor.
- Feed and notifications share an activity stream, but notifications need stricter thresholds, dedupe, fatigue controls, and channel preferences.
- Privacy filtering for blocks, deletes, restricted profiles, and private groups should fail closed.
- The key distinction from Facebook Feed is professional and economic graph relevance: jobs, companies, skills, industries, hiring, and second-degree opportunities matter.
Flashcards
Quiz
0/7 answered
1.Which relationship type should be treated as bidirectional in the graph after acceptance?
2.Why is pure fanout-on-write risky for LinkedIn Feed?
3.Given 300M daily active members and 8 feed opens per day, how many feed requests happen per day?
4.Which signal best captures whether a member spent meaningful time on an article or video?
5.What should the feed do when privacy status cannot be verified for an item?
6.Which related system is most directly responsible for network activity alerts?
7.What is the best reason to use dedupe keys in LinkedIn Feed?
Cheat Sheet
Goal: serve a low-latency personalized professional feed of posts, articles, videos, polls, jobs, company updates, and network activity.
Scale: 300M daily active members, 8 feed opens each, about 2.4B feed requests per day, about 27,800 average read QPS, and about 278,000 peak read QPS with a 10x multiplier.
Graph: connections are bidirectional and strong; follows are one-way; companies, groups, schools, jobs, topics, and hashtags are graph entities; second-degree content needs stronger relevance proof.
Architecture: API gateway to feed service to feed cache, graph service, content store, and ranking service. Activity bus feeds fanout, notifications, ranking features, and analytics.
Fanout: use hybrid fanout. Push normal-degree author candidates to active members. Pull high-degree creators, companies, jobs, and viral posts at read time.
Ranking: combine relationship strength, connection degree, follow intent, industry and skill affinity, job intent, freshness, engagement quality, dwell time, hides, reports, and trust signals.
Deduplication: use canonical dedupe keys for job changes, article URLs, job IDs, polls, reshares, and company events. Keep seen state in the cursor.
Consistency: feed order can be eventually consistent, but privacy, blocks, deletes, restricted visibility, and moderation status must be enforced before display.
Notifications: consume the same activity stream but apply stricter priority, dedupe, fatigue, channel, and quiet-hour policies.
Interview angle: explicitly distinguish from Facebook Feed by emphasizing the professional network, connection-degree weighting, economic graph, and career relevance.
References
- BookSystem Design Interview — Alex Xu
- BookDesigning Data-Intensive Applications — Martin Kleppmann
- PaperThe Tail at Scale — Jeffrey Dean and Luiz Andre Barroso
- PaperKafka: a Distributed Messaging System for Log Processing — Jay Kreps, Neha Narkhede, and Jun Rao
- BlogLinkedIn Engineering Blog — LinkedIn Engineering