Optiver

Interview Question

Software Developer Interview
Optiver

Given a sentence s and a list of word pairs, where each pair consists of strings a and b indicating that word a can be converted to word b (but not necessarily vice versa), determine the minimum length sentence you can translate the original sentence to. If there is more than one shortest sentence, return the lexicographically smallest one.

Unlock the Full Solution

Enter your email to get instant access to the complete solution, explanation, and similar practice problems.

Insights on 100+ quant firms, understand where to apply, and maximize your chances.

Get the official 2025 QB Quant Firm Tier List

Check your email inbox — you should get the interview in 1-2 minutes!