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 a string `s` containing only three types of characters: `'('`, `')'` and `'*'`, return `true` if `s` is valid. The following rules define a valid string: any left parenthesis `'('` must have a matching right parenthesis `')'`, any right parenthesis `')'` must have a matching left parenthesis `'('`, left parenthesis `'('` must go before the corresponding right parenthesis `')'`, and `'*'` could be treated as a single right parenthesis `')'` or a single left parenthesis `'('` or an empty string `""`.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.