← Questions

Word break II: every way to split a sentence

0
AmazonMicrosoftCodingLast asked Dec 2026

A coding interview question asked in Microsoft's technical phone screen and at Amazon, last asked Dec 2026. It tests backtracking, memoization and strings.

Given a string s and a list of dictionary words, insert spaces into s so that every piece is a dictionary word. Return every sentence you can make this way.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

backtracking · memoization · strings

Your code and the AI tutor open when you unlock this question.