News Aggregator
Design a personalized list of articles collected from publishers.
Clarify this prompt before choosing components
Ask the highest-impact questions first, agree on priorities, and record the interviewer’s answers. If a detail is unspecified, state an assumption and explain which decision depends on it. The numbers in this worked lesson are exercise assumptions, not company facts.
| Ask the interviewer | Why the answer changes the design |
|---|---|
| Ingestion, topic feeds or personalized ranking first? | Content identity and feed ranking should be explicit. |
| Duplicate syndication, corrections and source deletion? | Canonical records retain provenance and versioned updates. |
| Freshness, supported languages and recommendation cost? | Choose bounded enrichment and delayed-serving behavior. |
Use the Interview Playbook for the shared 45-minute sequence and fresher, intermediate, senior and staff evidence. Start with one complete operation. Extend the answer with the failure/recovery traces below, then defend a workload-specific alternative and a measurable rollout. Scope and evidence matter more than a large component list.
News Aggregator: Understand the building blocks
Choose a mechanism because it satisfies a requirement. These explanations describe the exercise design, not undisclosed implementation choices at the named company.
News Aggregator: Quick vocabulary
| Term | Meaning and role in this exercise |
|---|---|
| API: Application Programming Interface | The contract for requests, responses and errors between components. An API route does not itself enforce every business invariant. |
| HTTP: Hypertext Transfer Protocol | The request/response protocol used by web APIs and media fetching. Application retries still need safe operation identities. |
| DNS: Domain Name System | Resolves names to network addresses. An untrusted fetch policy must also validate resolved targets and redirects. |
| URL: Uniform Resource Locator | Names a resource and access location. Normalize carefully and do not trust an imported address as a safe server fetch destination. |
| PK: Primary Key | The declared row identity in a database schema; it does not automatically enforce every cross-row business rule. |
News Aggregator: Durable work queue and backpressure
What it means: A queue separates accepted work from execution. Backpressure limits admission or consumption when downstream capacity is finite.
Why this problem needs it: Source fetching must respect finite per-host capacity.
How to use it: Persist a stable job identity, consume with bounded concurrency, acknowledge after the required durable transition, and cap retries/backlog according to policy.
Example in this design: A source burst waits under a bounded scheduling policy rather than spawning unlimited fetches.
When it fits: Useful for asynchronous work that must survive worker failure or absorb a finite burst.
Alternative and limits: A synchronous call is simpler for short bounded work. A queue does not create capacity, strict global ordering or exactly-once external effects.
News Aggregator: Deduplication identity and business qualification
What it means: Deduplication distinguishes repeated delivery of one event from genuinely separate events. Qualification decides whether a real event is eligible to count.
Why this problem needs it: Same delivery, same source article and same story cluster are distinct identities.
How to use it: Use a stable event identity and atomic replay-safe sink, then evaluate the business rule with its own revision/window policy.
Example in this design: A1 and B1 may share cluster G7; removing B1 still retains A1’s independent evidence.
When it fits: Needed when delivery may repeat and reports/billing must not count the same event twice.
Alternative and limits: An append-only raw log preserves evidence but needs a later qualified projection. Transport deduplication alone cannot detect fraud or define billable behavior.
News Aggregator: Inverted index and BM25 relevance
What it means: An inverted index maps searchable terms to matching documents. BM25 is a relevance-scoring family using term/document statistics; it ranks candidates rather than deciding access.
Why this problem needs it: Readers need topic/text retrieval over many normalized articles.
How to use it: Tokenize under a declared analyzer, maintain postings from versioned documents, retrieve candidates and enforce current visibility before disclosure.
Example in this design: Index current eligible article revisions rather than storing one mutable row per story cluster.
When it fits: Useful when text queries should avoid scanning every post or document.
Alternative and limits: Database text search can fit a smaller baseline. An external search index adds lag, repair and operations; high score does not imply current authorization.
News Aggregator: Server-Side Request Forgery (SSRF)
What it means: SSRF occurs when an attacker causes a server to fetch a destination it should not reach, such as internal or metadata services.
Why this problem needs it: Untrusted source links and redirects may target internal services.
How to use it: Validate normalized destinations and resolved addresses, enforce outbound network restrictions, and recheck redirects/resolution under the chosen policy. Bound bytes, time and decompression.
Example in this design: Recheck destination policy after a redirect before fetching its body.
When it fits: Required for crawlers, imported URLs or any untrusted server-side fetch target.
Alternative and limits: Fetching only a trusted allowlist is simpler. Blocking one URL string does not protect against redirects, alternative address forms or resolution changes.
Interview scope and guarantees
Ingest feeds, normalize stories, group duplicates, rank recent items and return a paginated feed. Start with public syndicated sources. Define freshness, attribution and what happens when publishers correct or retract a story.
Capacity worksheet
Assume 100,000 sources polled every 15 minutes: about 111 polls/s before retries. One million articles/day at 10 KB is 10 GB/day raw. Ten million users reading 5 times/day generate 579 reads/s average; cache popular category feeds rather than reranking the full corpus for every request.
Concrete API contract
POST /sources {feedUrl,category}
GET /feed?category=...&cursor=...
GET /stories/{id}
POST /stories/{id}/feedback {action}Data model and access paths
sources(id PK,url,etag,next_poll_at,last_success)
articles(id PK,source_id,canonical_url,published_at,content_hash,version)
clusters(cluster_id,article_id,similarity_version)
feed_generation(category,generation,ordered_story_ids)Evolve a solution and explain each change
Read the diagram
Collect source articles / Fetch feeds under source limits and preserve provenance. / The same story can arrive with different URLs and titles.; Normalize and index / Assign article identity, cluster related stories, and build read projections. / Similarity is not proof that two reports are interchangeable.; Serve personalized pages / Rank bounded candidates with freshness and source diversity, using stable cursors. / Re-ranking a changing list can duplicate pages or hide updates.
Step 1: Collect source articles
Fetch feeds under source limits and preserve provenance. The same story can arrive with different URLs and titles.
Step 2: Normalize and index
Assign article identity, cluster related stories, and build read projections. Similarity is not proof that two reports are interchangeable.
Step 3: Serve personalized pages
Rank bounded candidates with freshness and source diversity, using stable cursors. Re-ranking a changing list can duplicate pages or hide updates.
Responsibility overview
Read the diagram
Reader to News API: request ranked page; News API to Article DB: source article records; Ingest worker to Publisher: fetch source feed; Ingest worker to Article DB: persist provenance; Ingest worker to Search projection: index article version; News API to Search projection: rank bounded candidates
Worked end-to-end scenario
Two feeds publish the same syndicated article under different URLs. URL normalization catches only some duplicates; content and publisher metadata can help identify a common article. A different reporter’s story about the same event belongs in the same cluster but should keep its own identity and attribution. Fetchers persist source versions before indexing. A corrected headline updates the article version, and the projection rejects an older replay. A reader page uses a ranking snapshot or cursor contract so an inserted breaking story does not shift offsets unpredictably. If the projection is unavailable, a simpler recent-articles view can be a defined degradation.
Why these access paths matter
Store source URL, publisher, fetched version, timestamps, and licensing/provenance attributes. Index articles by publication time and category; cluster membership is a revisable projection. User preferences belong in a separate access-controlled record. Keep fetching cadence per source and distinguish ingestion lag from ranking freshness.
Build the baseline first
Read the diagram
Polite poller → raw feed → normalized articles; Deduplication → story clusters → ranker; Published feed generation → cache → reader
- Polite poller → raw feed → normalized articles.
- Deduplication → story clusters → ranker.
- Published feed generation → cache → reader.
Evolve the design under load
Read the diagram
Source queues → retry isolation → bounded fetchers; Incremental ranking → category snapshots; Feedback stream → bounded personalization features
- Source queues → retry isolation → bounded fetchers.
- Incremental ranking → category snapshots.
- Feedback stream → bounded personalization features.
Defend the hardest decision
Canonical URLs and exact hashes catch obvious duplicates; semantic clustering can group related reporting but may incorrectly merge different events. Retain original article identities and attribution even when presenting a story cluster. Publication time supplied by a feed may be wrong or updated, so use ingestion time for pipeline monitoring and a documented ranking policy for freshness.
Failure and recovery analysis
One publisher begins returning malformed or enormous XML. Apply parser limits, timeouts and quarantine to that source without blocking ingestion globally. If an article is retracted, propagate a versioned tombstone through clusters and cached feeds. A ranked snapshot gives stable pagination while newer generations remain available on refresh.
Security and privacy boundary
Fetch only permitted sources, respect access and content reuse rights, sanitize display content, and protect internal networks from untrusted feed URLs.
Interview follow-ups with reasoning
Question: How do you avoid polling unchanged feeds?
Show answer and explanation
Answer: Use validators such as ETag where supported.
Question: How do you evaluate clustering?
Show answer and explanation
Answer: Review false merges and splits on a labeled sample.
Question: What if ranking is unavailable?
Show answer and explanation
Answer: Serve the last valid snapshot with visible freshness.
Operate and verify the design
Source freshness, malformed-feed rate, false story merges and ranking snapshot age.
Quarantine a bad publisher while proving healthy sources and the last valid feed remain available.
A second scenario to test transfer
A publisher takes 30 seconds to respond while others finish in 200 ms. A single serial fetch loop would let that publisher delay all others. A scheduler with per-host concurrency and a shared bounded worker pool allows unrelated publishers to progress. Retrying the slow host uses backoff, not a tight loop. The user reads an existing feed projection while ingestion continues.
Explain how to recover from a bad ranking deployment without fetching every source again.
Show answer and explanation
Answer: Retain authoritative normalized article facts and revision events. Build a new versioned projection, replay or backfill, catch up changes, validate, and switch the read alias. Keep removal rules effective during migration.
Compare alternatives
| Decision | Benefit | Trade-off |
|---|---|---|
| Precomputed feeds | Fast common reads | Freshness lag and rebuild work |
| Read-time ranking | Personalization flexibility | Higher request cost |
| Per-source scheduling | Failure isolation | More scheduler state |
A design-changing exercise
Two stories describe the same event. Should one be deleted as a duplicate?
Show answer and explanation
Answer: Not necessarily. Distinguish identical syndicated content from independent reporting; preserve provenance and use clustering when appropriate.
Design workshop: normalize, cluster, and rank
Core scope is source ingestion, related-story grouping and a personalized feed. Full-text republication without rights is excluded. Choose source refresh within five minutes for priority sources, feed p95 under 200 ms and corrections/removals visible under an explicit projection bound. Missing a slow source temporarily is different from claiming its article does not exist.
Store sources(id,url,parser_version,etag,last_modified,next_fetch_at,health), articles(id,source_id,canonical_url,revision,published_at,title,body_fingerprint,state), clusters(id,model_version) and user_preferences(user,topics,blocked_sources). Identity first deduplicates canonical URL/source revision; related stories can share a cluster while retaining separate publisher attribution.
For a concrete capacity check, assume 50,000 registered sources and a five-minute refresh target for the priority tier. That is 50,000 / 300 = about 167 scheduled requests per second on average. If a poll worker averages 400 ms end-to-end, the average concurrency needed is roughly 67; use a larger bounded pool for p95 latency and retry bursts, then enforce per-host caps so this average does not become a publisher overload. Shard source state by hash(source_id) % 16: each scheduler partition owns about 3,125 rows and schedules about 11 polls/s on average. These are invented interview assumptions; production sizing must use measured response times, the actual priority mix, and publisher-specific budgets.
The source row is the cadence authority: claiming it atomically marks one poll in flight, so two schedulers cannot poll the same source concurrently. Only a completed response advances next_fetch_at; a failed response schedules bounded backoff. The response path persists conditional-request metadata and parser version with the poll result. Source freshness is observed as now - last_success_at and ingestion lag as ingested_at - published_at; a missing or slow source is stale/unknown, never an empty-feed assertion.
Read the diagram
Claim due source lease and reserve per-host/global capacity; Load ETag, parser version and next-fetch deadline; Fetch with conditional headers; enforce DNS and response-size policy; Normalize permitted metadata and append source revision; Commit ETag, last success, health and next-fetch deadline
A transparent baseline similarity algorithm strips markup, lowercases titles/body excerpts, removes common stop words, and compares normalized term sets by Jaccard intersection/union. A={storm,city,flood}, B={storm,city,flood,roads} gives 3/4=0.75; C={city,election,vote} gives 1/5=0.2 against A. An inverted term index retrieves candidate clusters, then score against a fixed cluster anchor to prevent a long chain of small changes drifting into one giant cluster. Require matching topic, publication times within 24 hours, and a threshold of 0.7. Similarity is not proof that two reports are interchangeable; preserve each article identity, source attribution, correction history, and exact content fingerprint.
Read the diagram
Pair / Similarity / Decision; A and B / 3 shared of 4 union = 0.75 / Same related-story cluster under chosen threshold; A and C / 1 shared of 5 union = 0.20 / Different cluster; Identical syndicated body / Matching normalized fingerprint / Duplicate presentation candidate; retain provenance; Correction with same URL / New source revision / Update article facts and versioned cluster/rank projection
Candidate generation selects recent clusters matching preferences plus a bounded exploration pool. A simple score can be 0.5×topic_match +0.3×freshness +0.2×source_quality, with all inputs normalized and a source-diversity cap. At ages zero and four hours under freshness=exp(-age/4h), freshness is 1 and about 0.368. The weights are original interview assumptions; evaluate click satisfaction and source diversity, not only engagement.
Read the diagram
Commit normalized article revision and source provenance; Snapshot facts at watermark W; Recluster/rank under version 4; New edits/removals append after W; Catch up suffix; apply tombstones before switch; Read alias switches to verified projection version 4
The public contracts are GET /news?category=…&cursor=…, GET /articles/{id}/redirect, and an internal source-ingestion event. The redirect resolves only a stored active article ID to its canonical publisher URL; it never accepts a destination URL from the caller, and a current tombstone returns 410. GET /news returns sessionId, rankVersion, preferenceVersion, items and signed nextCursor. Freeze a bounded ordered candidate list for five minutes; pagination rechecks removal/blocked-source state. Expiry resets the session. A ranking model change creates a new session rather than reorder page two invisibly. The cache key includes category, rank version, and preference version. The read path uses a bounded pool of at most 1,000 ranked cluster candidates, precomputed clusters/candidates, and bounded personalization; it does not fetch publishers synchronously. Summaries and thumbnails are retained only when permitted, with thumbnail MIME/size checks and a bounded cache; the canonical article remains a publisher link.
Per-host scheduler uses ETag/Last-Modified when supported and bounded concurrency. A 30-second publisher cannot occupy every worker: cap per-source requests, back off failures and keep independent sources progressing. Store parser version and raw authorized feed evidence for reprocessing. Corrected publication times do not silently overwrite original ingestion evidence.
Exercise: A faulty ranking version groups unrelated election and storm stories. Must the system recrawl all sources to recover?
Show answer and explanation
Answer: No if normalized article facts, revisions and retained processing evidence are authoritative. Build a new clustering/ranking projection, catch up changes and switch the alias after validation. Keep removal rules active during migration.
GET /feed creates a five-minute session containing the rank version and a bounded ordered list of cluster lead article IDs. A signed cursor contains only the session ID and the next list index; the server keeps user, expiry, and page size. Page two reads the same snapshot even after a newer rank version is published. Before returning each article, recheck its current tombstone and the user's current blocked-source preferences. Skip newly hidden IDs while advancing the cursor; do not insert new articles into the middle of the old session. An expired or invalidated session returns a reset response and starts a new snapshot.
Read the diagram
Start feed with preferences; create session at rank version 3; Freeze ordered cluster leads and session expiry; Return page 1 and signed cursor for the next index; Ranking version 4 publishes while the reader is away; Request next page using the rank-version-3 cursor; Filter current tombstones/blocks; return remaining version-3 order; Expired cursor returns reset and a new session
Source fetching uses a per-source state row with canonical URL, parser version, ETag/Last-Modified, next-fetch deadline, last success, failure count, and quarantine state. A 304 advances cadence without parsing a body. A malformed or oversized response quarantines only that source; timeout, 429, and 5xx failures use capped exponential backoff. Keep per-host and global in-flight limits. A slow host must not consume every worker. Network egress policy must recheck resolved addresses at connection time to cover DNS changes; rejecting private IP literals alone is not an SSRF defense.
For a breaking-news burst, coalesce cache fills by (category, rank_version, preference_version) and keep one bounded refresh per key in flight. Readers receive the last complete feed snapshot while the refresh runs; they do not fan out to publishers. A stale-while-revalidate response carries its snapshot time and staleness so the API does not present old material as fresh. Bound both candidate retrieval and per-key waiters; when capacity is exhausted, serve the last snapshot or an explicit degraded response. The five-minute cursor session stores the rank and preference versions, while current tombstones and blocked-source policy are checked at each page read.
Read the diagram
Read snapshot key by category and rank/preference versions; Coalesce cache miss into one bounded refresh; Rank bounded candidate pool; publish a complete new snapshot; Refresh candidates asynchronously on source cadence, never on reader miss; Return prior snapshot with age while refresh is pending
Final topology and key invariants
The durable source/article facts are authoritative. Story clusters and ranked feed snapshots are rebuildable projections, and the read alias changes only after the new projection has caught up to a fact watermark and passed checks. Polling never happens on a user request. Redirects use the stored canonical publisher URL for an active article; they do not accept a caller-supplied destination. The redirect path validates current removal state and emits an audit event without copying publisher full text.
Read the diagram
Path / Authority or bounded work / Invariant; Source poll / Per-source lease and publisher budget / One active lease per source; conditional fetch; Article ingest / Versioned article facts and tombstones / Source revision is monotonic; removal wins over stale replay; Projection build / Watermarked cluster/rank projection / Catch up fact suffix before alias switch; Feed read / Cached snapshot plus signed session cursor / Stable order; recheck current visibility on each page
Failure trace: duplicate correction during pagination
If two sources first publish the same story with slightly different titles, both article identities and publisher links remain in the durable facts. A later correction may change the cluster lead or rank, but it cannot mutate an existing cursor's ordered IDs. If an article is withdrawn while a reader pages, the page skips that ID and continues advancing the cursor. A source outage only increases that source's freshness lag; it does not block other poll partitions or invalidate already published feed snapshots, so the existing cursor remains usable. A failed rebuild leaves the old alias active. A stale rebuild candidate is rejected if any article revision or tombstone advanced after its captured watermark.
Read the diagram
Publish corrected title as a newer source revision; Append revision; preserve both publishers and article identities; Continue page 2 with frozen rank version and cursor order; Capture fact watermark and rebuild cluster/rank projection; Withdraw old URL; append tombstone with higher revision; Catch up tombstone; reject stale candidate if watermark advanced; Switch alias after validation; old cursor skips withdrawn item
Operations and interview practice
Track priority-source freshness lag (target p95 under five minutes), successful parse rate by parser version, publisher 304 ratio, poll queue age, per-host concurrency, quarantine count, projection watermark lag, rebuild duration, cache age, feed p95 latency, cursor-reset rate, and duplicate-cluster correction rate. Alert on source freshness and projection lag separately so a publisher outage is not mistaken for a failed rebuild. Overload controls are the per-host/global poll limits, bounded candidate pool, coalesced cache fills, capped retries, and stale-snapshot fallback. Recovery pauses a faulty projection alias, preserves the last verified version, fixes parser/model configuration, rebuilds from retained permitted metadata, catches up revisions/tombstones, validates cluster counts and visibility, then switches atomically. Restrict source registration, parser changes, removals, and projection promotion to audited service roles. The dominant variable cost is publisher polling and media handling; keep thumbnails on an approved, bounded path and link readers to publishers rather than copying full text.
Practice prompt: Design the service for 10,000 publishers, a five-minute ordinary freshness target, 5,000 peak feed reads/s, and publisher response times from 200 ms to 30 seconds. Collect only permitted metadata and links. Explain article identity, one source lease, deduplication versus clustering, stable pagination, and a safe projection rebuild.
Failure follow-up: A ranking rollout combines unrelated election and storm stories while an old cursor is being paged. What do you do?
Rubric: Strong answers keep article facts and publisher provenance authoritative; use a fixed-anchor similarity score with topic/time gates; keep current cursors stable; expose and measure correction/removal lag; and rebuild from a captured fact watermark, catch up the suffix, reject a stale candidate, and switch only after validation. They do not recrawl every publisher or silently reorder page two.
HTTP conditional requests provides the source-fetch protocol reference; the similarity and ranking policy here is deliberately explicit and illustrative. examples/system-design/news_aggregator.py and its tests exercise canonicalization, topic/time-bounded Jaccard clustering, conservative anchors, versioned removal/rebuild, rank snapshots, signed cursors, source diversity, conditional polling, per-host limits, quarantine, and backoff. It is a teaching model, not a production fetcher, rights evaluator, or editorial-quality system.
Requirement trace and verification
| Requirement | Implementing design block | Verification link |
|---|---|---|
| R1 — Complete the primary user journey within the stated scope. | P01–P04; P09–P10. | V1 — Exercise the successful journey and the excluded/boundary case stated in the scope. |
| R2 — Preserve the problem's authoritative data invariant under concurrency. | P05–P06; P11–P12; DD1. | V2 — Run the race/replay case below and assert the invariant at the durable authority. |
| R3 — Meet the declared scale and API behavior without unbounded work. | P05–P08; P13–P14; relevant overload deep dives. | V3 — Exercise the API errors/retry identity and recompute the workload assumption that drives partition or capacity. |
| R4 — Recover from the named failure without losing or duplicating the user-visible outcome. | P15–P16; deep dives; Operations contract. | V4 — Ingest duplicates with changed titles, reorder articles while paging, and make a source unavailable; feed cursors remain usable. |
Operational contract
| Area | Decision and signals |
|---|---|
| SLIs | Source freshness lag; parse success by version; duplicate-cluster rate; poll queue age; breaking-news cache misses. |
| Overload limits | Cap per-host polling/concurrency, feed size, cluster candidates, and ranking work per page. |
| Recovery | Replay versioned source updates; quarantine malformed feeds; rebuild clusters from canonical article facts. |
| Access controls | Restrict source-fetch egress and validate URLs; apply user privacy/preferences before personalization. |
| Dominant cost | Polling and content storage/retention. |
Senior-level interviewer follow-ups
Question: Two publishers syndicate the same story with different URLs. How do you avoid both hiding a distinct update and showing duplicates?
Show answer and explanation
Answer: Cluster by canonical links and content similarity, retain source provenance, and merge only above an explicit confidence threshold. Material updates can create a new version within the cluster.
Question: A publisher feed is stale but a user refreshes repeatedly. How do you bound fetch pressure?
Show answer and explanation
Answer: Use conditional requests, per-publisher scheduling, backoff and a shared freshness cache. User reads should not trigger an unbounded synchronous publisher fetch.
A 60-second design answer
I would poll publishers with conditional requests and bounded per-source schedules, normalize articles, and cluster likely duplicates while preserving provenance. The read path uses a ranked snapshot with freshness and source diversity rules; refreshes do not synchronously fan out to publishers. I would measure source staleness, duplicate-cluster corrections, fetch errors, ranking latency, and publisher request budgets.
Related concepts to revisit
Technical references
Kafka processing and external-sink boundaries.
PostgreSQL transaction isolation and concurrent updates.
Preserve source articles while grouping a story
Publisher P1 article a1 and P2 article a2 discuss the same event. A story grouping s7 may relate both, while each article keeps its original source URL, attribution, publication time and revision. URL normalization and content similarity are different signals; similarity is not permission to copy licensed content or erase attribution.
a1: source P1; story s7
a2: source P2; story s7
feed generation G8: [s7,s6,s5,...]
page cursor: G8 + last stable sort tupleRead the diagram
a1: source P1; story s7; a2: source P2; story s7; feed generation G8: [s7,s6,s5,...]; page cursor: G8 + last stable sort tuple
A fixed feed generation can support consistent paging while new articles enter G9. Best-effort live ranking permits changes and needs honest duplicate/shift semantics. Poll publishers within rate/terms constraints, persist watermarks and bound freshness lag. Cache eligible pages/images while keeping deletion/retraction handling and current visibility separate. Breaking-news traffic admission protects source fetchers as well as read services.
Show answer and explanation
Answer: Deduping a story can improve browsing, but must retain the contributing articles and provenance. A changing ranking cursor without a generation cannot promise a fixed snapshot.
Decision review: News Aggregator
News Aggregator: What it is
A news design collects publisher articles, groups related stories and serves bounded personalized pages without erasing source identity.
News Aggregator: Why it is needed
Different URLs can describe one story but contain distinct attribution, revisions or deletion rights.
News Aggregator: When to use it
Use a derived grouping/ranking projection when cross-source discovery is needed, retaining immutable or versioned source records.
News Aggregator: How to use it
Normalize within a declared policy, keep article and story-group identities separate, version grouping/ranking generations and use a cursor consistent with the chosen browsing contract.
News Aggregator: Compare an alternative
A stable chronological list is simpler than changing personalized ranking. A pinned ranking generation can improve pagination consistency but may serve older candidates and requires retention.
News Aggregator: Worked decision exercise
The following inputs and policies are original exercise assumptions; they are not measurements or undisclosed company behavior.
Publisher records A1 and B1 are grouped as story G7. B1 is removed at revision 2. The story can remain represented by eligible A1, but neither its snippet nor attribution should claim B1 remains available under a strict removal policy.
Read the diagram
Articles A1 and B1 are source facts; Grouping projection places both in story G7; B1 revision 2 is removed; Eligible A1 may represent G7; B1 content stays suppressed
Does grouping duplicate-looking stories justify deleting the original article records?
Show answer and explanation
Answer: No. Grouping is a projection and may be wrong or later revised. Keep source attribution and deletion facts, re-evaluate eligible representatives and rebuild the grouping under a new version if needed. Pin or explicitly weaken the page consistency promise.
News Aggregator: Check the design
Test regrouping during pagination, publisher corrections and source removal. Monitor fetch fairness, duplicate rate, source diversity and ranking-generation age.
Explain how to recover from a bad ranking deployment without fetching every source again.
Your design draft
Clarify assumptions, explain your approach, and test the difficult cases. Save your draft, then compare it with the study notes.
Self-review checklist
Self-guided practice. Automated AI feedback and code execution are not connected.