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
Trieshard70 minFrontend Engineer

Forms Prefix Intent Index

Frontend Engineer signal: trie + prefix counts in a dynamic form builder context. This is a ProdMatch-owned frontend engineer drill, framed as a March 2026 Swiggy Growth UX simulation, not a copied platform question.

Company context

Swiggy · Growth UX

Freshness

March 2026

Product surface

dynamic form builder

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

Question

Build a prefix index for dynamic form builder. 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

  • render scheduling
  • state graphs
  • virtualization
  • 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

Timeline Prefix Intent IndexhardAutocomplete Prefix Intent IndexmediumCanvas Prefix Intent Indexmedium