Your question is Garage Door Finite State Machine. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
Design an algorithm for a garage with doors at both ends and two sensors in between (only knowing whether each sensor is triggered) so the car never hits a door while maximizing the time doors are closed; draw the finite state machine.
Asked in the onsite HM round stage. Reported follow-ups: What if you don't know the car's initial position? What if one sensor is broken?