Uber Interview Question

It was a OA Codesignal.