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

Tenancy Streaming Window Anomaly

Platform Engineer signal: sliding window + frequency map in a multi-tenant quota context. This is a ProdMatch-owned platform engineer drill, framed as a May 2026 Razorpay Cloud Platform simulation, not a copied platform question.

Company context

Razorpay · Cloud Platform

Freshness

May 2026

Product surface

multi-tenant quota

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

Question

For multi-tenant quota, process a timestamp-ordered stream of tenants. Find the longest contiguous window where at most k distinct risk labels appear and the total severity stays under budget.

Input

  • Array of events {label, severity} and integers k, budget.

Output

  • Maximum window length satisfying both constraints.

Constraints

  • 1 <= events.length <= 300000
  • 1 <= k <= 50
  • Severity values are positive integers.

Concepts

  • build DAGs
  • tenant quotas
  • artifact caching
  • sliding window
  • frequency map
  • stream processing

labels: A,B,A,C with k=2 and budget=7 -> longest valid window length is 3

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

  • Update the answer only after the window is valid.
  • Avoid recomputing the whole window on every move.

Next Similar Problems

Build Streaming Window AnomalyhardArtifacts Streaming Window AnomalyhardPackages Streaming Window Anomalyhard