Infer a user's intent from their typing in real time
I was asked this
No reports yet. Sign in to say where you were asked it.
An AI/ML design interview question asked in Microsoft's system design round, last asked Jan 2026. It tests intent prediction, real-time inference and nlp.
As a user types into an assistant or a search box, predict what they are trying to do (search a file, draft an email, ask a question, run a command) so the product can respond early: suggest an action, prefetch results, or route to the right model. Predictions update with every keystroke and must be fast, private and safe to act on.
Requirements
- Functional: classify intent from partial input plus context (the app, the open document, recent actions); update on each keystroke; decide when a prediction is confident enough to act on; personalize to the user.
- Non-functional: a latency budget of tens of milliseconds per update (possibly on device); privacy for what people type; wrong predictions cost little.
Clarifying questions
- Which intents exist, and what does the product do with each prediction?
- Where does the model run: on the device, or on a server?
- What data can we log and label, given that typed text is sensitive?
- What does a wrong action cost compared with a missed one?
- Are there languages or input methods beyond a keyboard?
What a strong answer covers
- Labels: final submitted queries and the actions users took give weak labels for every prefix of what they typed; a small set of human-labelled examples for ambiguous cases.
- Features: the text prefix (tokens and characters), typing dynamics (pauses, deletions), UI context, and user history.
- Model: a small on-device classifier or distilled transformer run incrementally; a larger server model only when needed; caching for repeated prefixes.
- When to act: thresholds per intent tuned for precision, debouncing so suggestions do not flicker, and abstaining when unsure.
- Evaluation: accuracy as a function of how much was typed (how early the correct intent is reached), calibration, and online measures such as suggestion acceptance and time to complete.
- Privacy and safety: on-device processing or minimal logging, federated or aggregated training, never acting irreversibly on a guess.
Follow-ups
- Users start ignoring suggestions after a week. How do you find out why?
- Personalize for a new user with no history.
- A model update increases flicker between intents mid-word. How would you detect and fix it?
- How do you train without ever seeing raw typed text on the server?
Where it's asked
- Microsoft · System design · Last asked Jan 202660 min · Design discussion
What it tests
intent prediction · real-time inference · nlp
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
