Frage im Vorstellungsgespräch bei Framestore

Basic coding question regarding how I would handle the logic