Morgan Stanley interview question

How would you design an autocorrect system ?