Lyft Interview Question

Was not expecting graph theory question