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.
There is an undirected graph with `n` nodes, where each node is numbered between `0` and `n - 1`. You are given a 2D array `graph`, where `graph[u]` is an array of nodes that node `u` is adjacent to. The graph has the following properties: there are no self-edges, no parallel edges, and the graph is undirected. Return `true` if the graph is bipartite. A graph is bipartite if the nodes can be partitioned into two independent sets `A` and `B` such that every edge connects a node in `A` and a node in `B`.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.