Bloomberg interview question

Design a railway entry/exit system