Query understanding layer

DesignMedium45 minAmazon and Google style

Your task

Design the query-understanding layer that sits in front of an e-commerce search engine. Before retrieval, it must spell-correct ('blutooth speeker'), expand synonyms ('couch'->'sofa'), detect intent/category ('iphone 15 case' -> Accessories, not Phones), and strip/parse attributes (color, size, brand) from the raw query. Constraints: add under 30ms, handle 30M queries/day, and degrade gracefully when a query is gibberish.

It covers

  • Spell correction
  • Query understanding
  • Synonyms