Common Restaurant Pickup Order

Asked at DoorDash · Coding Questions · Difficulty: Medium · Last asked Dec 11, 2025

Two delivery routes each visit a list of restaurants in a fixed order. A single courier wants to make one trip that stops only at restaurants on both routes, and visits them in an order that agrees with both routes. Return the longest such list of stops, as the restaurant names themselves, not only their count.

Loading the problem…