Roblox Interview Question

What is the most optimal solution