Snap Interview Question

Design a recommendation system for messaging to predict the next word while typing