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 minPlatform Engineer

Sandboxes Real-Time Top-K Prioritizer

Platform Engineer signal: heap + top-k in a sandbox allocator context. This is a ProdMatch-owned platform engineer drill, framed as a May 2026 Paytm Runtime Platform simulation, not a copied platform question.

Company context

Paytm · Runtime Platform

Freshness

May 2026

Product surface

sandbox allocator

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

Question

Your Runtime Platform team needs a live top-k view for sessions. 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

  • build DAGs
  • tenant quotas
  • artifact caching
  • 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

Build Real-Time Top-K PrioritizerhardArtifacts Real-Time Top-K PrioritizerhardTenancy Real-Time Top-K Prioritizerhard