Apple Interview Question

how to solve certain problems