These are Algorithms questions of the kind Apple actually asks — the patterns reported from Apple's AI-engineering rounds, where design trade-offs, scale and failure modes matter as much as definitions. Treat this page as a mock interview: say every answer out loud before revealing it. If one surprises you, the lesson behind it is linked at the bottom.
Apple Algorithms concept questions
A happy number: repeatedly replace n by the sum of the squares of its digits; happy if you reach 1. Unhappy numbers loop forever. How do you detect the loop without a set?
Asked in
Apple Algorithms applied & hands-on questions
For [1, 2, 3, 4] return [24, 12, 8, 6] — each position the product of all OTHER elements. No division, O(n), then reduce to O(1) extra space.
Asked in
Find the element appearing more than n/2 times in [2, 2, 1, 1, 1, 2, 2] using O(1) space. Why does the voting trick work?
Asked in
How to use this page: Apple rarely asks something you've never seen — they ask a standard Algorithms concept and then push one level deeper ("why?", "what would you do if..."). Master the concept in the Algorithms course lessons, and the follow-up stops being scary.
Keep practising: Binary Search, Dynamic Programming, BFS & DFS and Patterns & Strategy cover what most Apple Algorithms rounds test.

