Apple Coding Interview Questions
32 Apple coding interview problems with full optimal solutions — 11 easy, 19 medium, 2 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Apple interviewer values, and a FAQ section.
Showing 11 problems of 32
- #21easyfoundational
21. Two Sum
Find two indices whose values sum to a target — Apple uses this warmup to see if you reach for the right data structure immediately, reflecting the precision-first engineering culture behind Core Data's element-lookup caches.
- #22easyfoundational
22. Valid Parentheses
Determine if bracket sequences are properly closed and ordered — Apple's Xcode editor and Swift compiler use this classic stack pattern daily to validate nested UI element trees, undo-stack integrity, and balanced XML attribute scopes in Interface Builder.
- #23easyfoundational
23. Climbing Stairs
Count distinct ways to reach step n taking 1 or 2 steps at a time — Apple uses this DP gateway problem to test whether you recognize Fibonacci recurrences, a pattern behind animation frame interpolation in Core Animation.
- #24easyfoundational
24. Binary Search
Search a sorted array in O(log n) — Apple tests binary search as a stand-alone problem because getting the boundary conditions exactly right mirrors the precision required when indexing sorted Core Data fetch results or bisecting version ranges in Software Update.
- #14easyfoundational
14. Longest Common Prefix
Longest Common Prefix is Apple's clean string-array warm-up. The vertical-scan answer (compare position 0 across all strings, then position 1, ...) beats the horizontal scan in average case and is what Apple grades on. Mention the trie variant if asked for a more reusable structure.
4 free resourcesSolve → - #21easyfoundational
21. Merge Two Sorted Lists
Merge Two Sorted Lists is Apple's canonical linked-list warm-up. The dummy-node trick — start with a dummy then thread the smaller of the two heads onto its tail — keeps the code clean and edge-case-free. Apple grades on whether you reach for the dummy unprompted.
4 free resourcesSolve → - #104easyfoundational
104. Maximum Depth of Binary Tree
Maximum Depth of Binary Tree is Apple's pure recursion warm-up. depth(node) = 1 + max(depth(left), depth(right)) with base case 0 on null. The interviewer wants you to also know the iterative BFS variant for environments where recursion depth is a concern.
4 free resourcesSolve → - #121easyfoundational
121. Best Time to Buy and Sell Stock
Best Time to Buy and Sell Stock is Apple's canonical single-pass max-tracking question. The trick is recognizing this as 'maximum running-difference' — you only need the minimum-so-far and the best diff. The O(n^2) brute force is mentioned and rejected; the linear scan is the answer.
4 free resourcesSolve → - #225easyfrequently asked
225. Implement Stack using Queues
Implement Stack using Queues is Apple's mirror to Queue-using-Stacks. The clever variant is one queue with rotate-on-push: after pushing x, dequeue and re-enqueue every existing element so x ends up at the front. Push becomes O(n); pop/top become O(1).
4 free resourcesSolve → - #232easyfrequently asked
232. Implement Queue using Stacks
Implement Queue using Stacks is Apple's classic 'reverse the access pattern' design easy. Two stacks — one for input, one for output. The trick is the amortized O(1) pop: only move from input to output when output is empty, so each element moves at most once.
4 free resourcesSolve → - #242easyfoundational
242. Valid Anagram
Valid Anagram is the Apple warm-up that grades whether you pick the right approach for the constraint. Sort-both is the lazy answer; frequency-count is the optimal. The Unicode follow-up is what Apple uses to separate easy passes from strong easy passes.
4 free resourcesSolve →
Related interview-prep guides
HireVue Tech Interview Guide: The 2026 Playbook for Async Video Rounds
HireVue is the category-leading async video interview platform. Candidates record answers solo, on the clock, and a combined AI-plus-human review layer scores the recording days later. For 2026 tech jobseekers, the format is different enough from live interviews to need its own playbook. This guide is that playbook.
LeetCode Assessments: The 2026 Tech Interview Guide
LeetCode Assessments is the enterprise tier of the LeetCode platform: a separate product from the public site candidates know from grinding problems. Companies pay LeetCode to build custom timed assessments that draw from the 3,000-problem public catalog plus optional private variations, and the catalog asymmetry is the whole story for prep.
Zoom Tech Interview Guide 2026: How the Platform Works for Engineering Hiring
Zoom is the most-deployed video meeting software in US tech hiring. It is the default from one-person startups to Fortune 100 engineering orgs. It is general-purpose meeting software, not an anti-cheating platform. This guide covers what Zoom sees during a tech interview, the screen-share modes hiring teams use, the OS-level boundary the platform cannot cross, and how a modern desktop interview assistant pairs with the standard Zoom tech-interview flow.