Frage im Vorstellungsgespräch bei NonStop io Technologies

Basic RoR questions, coding problem from Leetcode.