Train a Next-Word Predictor from Tokenized Sentences
Asked at Bloomberg · Coding & Leetcode-style Questions · Difficulty: Medium
You are given a set of tokenized training sentences (each sentence is a list of words). Train a "next-word predictor". After training, for any query word `q`, return the most likely word that immediately follows `q` in the training data.
Loading the problem…
More Bloomberg interview questions
- Streaming Social-Media Mentions and Aggregation
- Real-time Market Data Distribution System
- Trade Processor with Subscribe / Unsubscribe
- Flatten a Multilevel Doubly Linked List
- Matchsticks to Square Transform
- Ashley Loves Numbers (Financial Engineer)