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
Triesmedium45 minSecurity Engineer

Anomaly Prefix Intent Index

Security Engineer signal: trie + prefix counts in a login anomaly detector context. This is a ProdMatch-owned security engineer drill, framed as a May 2026 Uber Account Trust simulation, not a copied platform question.

Company context

Uber · Account Trust

Freshness

May 2026

Product surface

login anomaly detector

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

Question

Build a prefix index for login anomaly detector. Support insert(term, weight), delete(term), and topPrefix(prefix) returning the best active term by weight then lexicographic order.

Input

  • A sequence of index operations.

Output

  • Return values for topPrefix operations.

Constraints

  • 1 <= operations <= 200000
  • Total characters <= 1000000
  • Weights can change through reinsertion.

Concepts

  • attack graphs
  • policy tries
  • anomaly detection
  • trie
  • prefix counts
  • autocomplete

insert pay 5, insert payout 7, topPrefix pa -> payout

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

  • Deletion is hard if nodes cache best child; use lazy invalidation or per-node heap when deletes are frequent.
  • Tie-break lexicographically for deterministic output.

Next Similar Problems

Attack Prefix Intent IndexhardPolicy Prefix Intent IndexmediumSecrets Prefix Intent Indexmedium