Frage im Vorstellungsgespräch bei Art of Problem Solving

One puzzle solving question and another JavaScript based question