Orbitz Worldwide Interview Question

I didn't expect the brainteaser problem.