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 minAI/ML Engineer

Vector Prefix Intent Index

AI/ML Engineer signal: trie + prefix counts in a vector search retrieval context. This is a ProdMatch-owned ai ml engineer drill, framed as a May 2026 Flipkart RAG Platform simulation, not a copied platform question.

Company context

Flipkart · RAG Platform

Freshness

May 2026

Product surface

vector search retrieval

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

Question

Build a prefix index for vector search retrieval. 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

  • vector search
  • RAG retrieval
  • recommendation graphs
  • 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

GraphRAG Prefix Intent IndexmediumRecommend Prefix Intent IndexmediumBatching Prefix Intent Indexmedium