Meta Interview Question

2 coding questions, medium difficulty