Bloomberg Interview Question

Design a railway entry/exit system