Pergunta de entrevista da empresa Keystone Solutions

not the most common one, it was a behavioral . given some code and asked to solve a problem, mostly to see how i solved it