Microsoft interview question

Questions from LeetCode. Design parking system.