Pergunta de entrevista da empresa Karat

Some tricky javascript question, and some live coding question