Booking.com Interview Question

Cycle detection in directed graph