ProdMatch
CompaniesCitiesRolesSign in

Companies

  • Google
  • Microsoft
  • Meta
  • Amazon
  • Apple
  • Atlassian
  • Nvidia
  • Oracle
  • See all 51 →

Cities

  • Bengaluru jobs
  • Hyderabad jobs
  • Pune jobs
  • Gurugram jobs
  • Noida jobs
  • Delhi NCR jobs
  • Mumbai jobs
  • Chennai jobs
  • Remote-India jobs

Roles

  • QA / SDET Engineers
  • Backend Engineers
  • Frontend Engineers
  • Full-stack Engineers
  • Data Analysts
  • Data Engineers
  • ML / AI Engineers
  • DevOps / SRE Engineers
  • All roles →

ProdMatch

  • About
  • Career guides
  • Compare
  • Salaries
  • Skills
  • DSA practice
  • Privacy
  • Terms
  • Sign in

© 2026 ProdMatch.ai · Built for India · DPDP Act 2023 compliant · Job data sourced from official company career pages.

Back to DSA
Heap / Priority Queuehard70 minSoftware Engineer

Editor Real-Time Top-K Prioritizer

Software Engineer signal: heap + top-k in a collaborative editor context. This is a ProdMatch-owned software engineer drill, framed as a April 2026 Dream11 Creation Tools simulation, not a copied platform question.

Company context

Dream11 · Creation Tools

Freshness

April 2026

Product surface

collaborative editor

ProdMatch interview simulation based on product-team patterns; not a claim of a real company question.

Question

Your Creation Tools team needs a live top-k view for operations. Each update changes an item's score. Return the current top k item IDs after each update, ordered by score desc then ID asc.

Input

  • Initial scores, k, and update stream [id, delta].

Output

  • Top-k IDs after every update.

Constraints

  • 1 <= items <= 200000
  • 1 <= updates <= 200000
  • Scores can be negative.

Concepts

  • invariants
  • API correctness
  • graph modelling
  • heap
  • top-k
  • streaming rank

scores: [5,1,3], k=2, update [1,+5] -> [1,0]

Approach

Try framing your own approach first. The 30 seconds you think before peeking is where learning happens.

Clean Solution

Reveal the approach first.

How well did you understand?

Your rating tunes when this problem shows up again.

Common Mistakes

  • Use a stable tie-breaker for equal scores.
  • Do not sort the full stream when k is small.

Next Similar Problems

Workflow Real-Time Top-K PrioritizerhardSearch Real-Time Top-K PrioritizerhardCheckout Real-Time Top-K Prioritizerhard