Infer user intent from typing in real time | Microsoft Interview Question