AI Interview Prep is optimized for larger screens
Please open this on a laptop or desktop (1024px and wider) to use the full editor, whiteboard, and AI coaching surface.
Understand the problem
Restate the problem precisely. Interviewers reward candidates who pause, define the contract, and name the guarantees before coding.
Given strings `s1`, `s2`, and `s3`, find whether `s3` is formed by an *interleaving* of `s1` and `s2`. An interleaving of two strings `s` and `t` is a configuration where `s` and `t` are divided into `n` and `m` substrings respectively, such that `s = s1 + s2 + ... + sn`, `t = t1 + t2 + ... + tm`, `|n − m| ≤ 1`, and the interleaving is `s1 + t1 + s2 + t2 + ...` or `t1 + s1 + t2 + s2 + ...`. Note: `a + b` is the concatenation of strings `a` and `b`.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.