Bloomberg Interview Question

The first one is basic algorithm problem. The second one is a system design question about New York subway counting system.