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 Queuemedium45 minMobile Engineer

Retry Real-Time Top-K Prioritizer

Mobile Engineer signal: heap + top-k in a network retry queue context. This is a ProdMatch-owned mobile engineer drill, framed as a April 2026 Microsoft Connectivity simulation, not a copied platform question.

Company context

Microsoft · Connectivity

Freshness

April 2026

Product surface

network retry queue

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

Question

Your Connectivity team needs a live top-k view for requests. 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

  • offline sync
  • local cache
  • gesture streams
  • 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

Sync Real-Time Top-K PrioritizerhardFeed Real-Time Top-K PrioritizerhardCache Real-Time Top-K Prioritizerhard