Meta Interview Question

Algorithm questions, both were really easy