Apple
Deeply team-specific loops with no standard script — the screen is half résumé interrogation, and the coding half favours “implement this class, then extend it” over puzzles, with a requirement added the moment the first version works. Optimal on the first pass, narration throughout, and the memory bound volunteered on anything involving “millions”.
Typical loop
- 1Recruiter screen — ask which shape the technical screen takes: algorithmic, practical/domain, or design
- 2Hiring-manager call: résumé deep-dive (baseline, instrument, confounder for every number), often with a coding question of its own
- 3Technical phone screen: 45–60 min on CoderPad over WebEx, roughly half résumé and half one problem; some are voice-only design
- 4A second technical screen is normal
- 5Onsite: four to six team-specific rounds — coding, design/OOD, résumé deep-dive, behavioural
- 6Cross-functional round with a partner team
Questions
Callback's practice questions and the LeetCode questions Apple has been asking, filtered together.
Practice questions
Sparse Matrix Storage, Addition, and Multiplication
Algorithms & Data Structures · Storage proportional to nonzeros — and the cancellation trap.
Algorithms & Data Structures · Pluggable backoff, a retryable filter, hooks, and an abort signal around one loop.
Algorithms & Data Structures · Parse, validate, count — and pick the right denominator for the failure rate.
Memory-Bounded Ranked Ballot Counter
Algorithms & Data Structures · Millions of ballots, Borda scoring, and memory that stays O(candidates) — the constraint is the question.
Algorithms & Data Structures · Bucket sort when the multiset fits, a size-N heap when it's a stream — say both.
Algorithms & Data Structures · "Bidirectional and transitive" means connected components — union-find, keyed by the smallest word.
Algorithms & Data Structures · Flood fill from every unvisited land cell — and know when DFS, BFS or union-find fits.
Algorithms & Data Structures · Three linear phases instead of a re-sort: before, overlapping, after.
Algorithms & Data Structures · Separate chaining with a resize at a load-factor threshold — fixed buckets aren't enough.
Algorithms & Data Structures · A heap cannot update a key — push the new entry and discard stale ones at pop time.
Algorithms & Data Structures · One DFS from the base unit multiplies factors down the tree, modulo a prime.
Nth Node at Level L in a 0/1 Tree
Algorithms & Data Structures · Never build the tree — halve recursively, or read the answer off the parity of popcount(n − 1).
Algorithms & Data Structures · A queue of admitted timestamps per key: evict what aged out, admit while under the limit.
Algorithms & Data Structures · Flatten behind hasNext/next with O(depth) memory — and survive [[], [[]], [[], [3]]].
Algorithms & Data Structures · One pass and O(k) memory: item i replaces a random slot with probability k/(i+1).
Algorithms & Data Structures · Two heaps — a max-heap for the lower half, a min-heap for the upper — rebalanced on every add.
Algorithms & Data Structures · Three guarded divisions — and 0 wherever a denominator is 0.
Algorithms & Data Structures · Map, combine, partition, sort, reduce — the three parts a groupby does not have are the whole grade.
Algorithms & Data Structures · Half-open intervals per room, only neighbours can clash — and check-then-book must be one atomic step.
Algorithms & Data Structures · Idempotent writes, a separate read model, and an audit log — all three in one small service.
Algorithms & Data Structures · One pass with a stack of signed terms; the trap is integer division truncating toward zero.
Algorithms & Data Structures · Build in-order and pull values off a forward-only iterator — no middle-finding, no array copy.
Algorithms & Data Structures · Build the trie first and say why: it prunes the DFS the moment a prefix does not exist.
Algorithms & Data Structures · A group dies exactly when it has no adjacent empty point — flood fill each neighbouring enemy group.
Algorithms & Data Structures · TCP is a byte stream: buffer across calls, frame by length prefix, and tell a clean EOF from a truncated message.
Implement a Robust REST Create Method
Algorithms & Data Structures · Authenticate, validate, sanitise — then make POST safe to retry with an Idempotency-Key scoped to the caller.
Algorithms & Data Structures · Sort, then sweep — the pattern behind a dozen calendar problems.
Algorithms & Data Structures · Hash map plus doubly linked list, all operations O(1).
Algorithms & Data Structures · One pass, three sets — and derive the box index out loud instead of asserting it.
Algorithms & Data Structures · Two-colour with BFS from every unvisited node; an odd cycle is the only way to fail.
Algorithms & Data Structures · A 26-count key instead of sorting each word — the only decision in the problem.
Algorithms & Data Structures · BFS, not DFS — shortest path — then mention bidirectional BFS, which roughly square-roots the frontier.
Algorithms & Data Structures · The first character whose second occurrence comes earliest — one pass with a set, emoji included.
Unique Values Across Two Arrays I
Algorithms & Data Structures · Every value once, in first-seen order — a Set keeps insertion order.
Algorithms & Data Structures · Prefix products left to right, suffix products right to left — no division, so zeros need no special case.
Algorithms & Data Structures · PUT, GET and a COUNT of everything under a domain: match on the label boundary, then make COUNT fast with a trie.
Algorithms & Data Structures · A second stack holds the minimum at each depth, so getMin is just its top.
Parse an Integer Without parseInt
Algorithms & Data Structures · Sign, then digits through a lookup table, accumulating n * 10 + d — and NaN for anything else.
Algorithms & Data Structures · Find the end of each run (or each number), emit, jump.
Algorithms & Data Structures · Buckets plus underflow and overflow: O(1) adds, any quantile, error within half a bucket.
Algorithms & Data Structures · Sort by (entity, time), then extend or open one session per entity in a single sweep.
Algorithms & Data Structures · Convert through the base unit — and divide with a modular inverse, since you can't divide mod p.
Algorithms & Data Structures · Store (tokens, last seen) per key and refill lazily on each call — O(1) per key.
Algorithms & Data Structures · Chain iterables behind hasNext/next with a lookahead that skips the empty ones.
Weighted Sampling Without Replacement
Algorithms & Data Structures · A-Res: key each item by random()^(1/weight) and keep the k largest keys.
Stratified Sampling with Largest-Remainder Allocation
Algorithms & Data Structures · Floor each proportional share, give leftovers to the largest remainders, sample within each stratum.
Algorithms & Data Structures · Discount each graded relevance by log2(position + 2), then divide by the ideal ordering's DCG.
Algorithms & Data Structures · Observed agreement corrected for the agreement two annotators would reach by chance.
Algorithms & Data Structures · 1 − C(n − c, k) / C(n, k), computed as a running product so nothing overflows.
Algorithms & Data Structures · Buffer bytes across recv calls, split on newlines, and decode only whole lines.
Algorithms & Data Structures · Where the earliest second occurrence sits — the same set scan, returning an index.
Unique Values Across Two Arrays II
Algorithms & Data Structures · Count every value across both arrays in a Map, then keep the ones counted exactly once.
Unique Values Across Two Arrays III
Algorithms & Data Structures · Objects compare by reference, so deduplicate on a property — the first object with each key wins.
Algorithms & Data Structures · Binary long multiplication: add the doubled multiple for every set bit — and double with +=, not a 32-bit shift.
Algorithms & Data Structures · Each position multiplies its two successors, wrapping around the end with modular indices.
Count Each Character in First-Seen Order
Algorithms & Data Structures · One counting pass into a Map, emitted in insertion order: AAABBAA becomes 5A2B.
Algorithms & Data Structures · A base case at n <= 0 and one recursive call — then say where the call stack runs out.
Algorithms & Data Structures · Binary-search the root in [0, max(1, x)] for a fixed number of rounds — an epsilon loop never ends for large x.
Algorithms & Data Structures · An infinite generator over two BigInts — ordinary numbers lose precision past the 78th term.
Asked on LeetCode
298 questions · all time
- LRU CachemediumHash TableLinked ListDesignDoubly-Linked Listfrequency 100.0
- Two SumeasyArrayHash Tablefrequency 86.9
- Merge IntervalsmediumArraySortingQuicksortfrequency 84.5
- Number of IslandsmediumArrayDepth-First SearchBreadth-First SearchUnion-Find+1frequency 84.5
- Best Time to Buy and Sell StockeasyArrayDynamic Programmingfrequency 79.3
- Design Hit CountermediumArrayBinary SearchDesignQueue+1frequency 79.3
- Rotate ArraymediumArrayMathTwo Pointersfrequency 78.2
- Group AnagramsmediumArrayHash TableStringSortingfrequency 77.6
- Top K Frequent ElementsmediumArrayHash TableDivide and ConquerSorting+4frequency 77.0
- Longest Common PrefixeasyArrayStringTriefrequency 76.4
- Reverse Linked ListeasyLinked ListRecursionfrequency 75.8
- Valid SudokumediumArrayHash TableMatrixfrequency 75.8
- Course Schedule IImediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sortfrequency 73.0
- Course SchedulemediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort+1frequency 72.2
- Valid ParentheseseasyStringStackBracket Sequencesfrequency 71.5
- Valid PalindromeeasyTwo PointersStringfrequency 70.6
- Product of Array Except SelfmediumArrayPrefix Sumfrequency 69.8
- Kth Largest Element in an ArraymediumArrayDivide and ConquerSortingHeap (Priority Queue)+1frequency 68.0
- Maximum SubarraymediumArrayDivide and ConquerDynamic Programmingfrequency 68.0
- Reverse Words in a StringmediumTwo PointersStringfrequency 68.0
- Spiral MatrixmediumArrayMatrixSimulationfrequency 68.0
- Time Based Key-Value StoremediumHash TableStringBinary SearchDesignfrequency 68.0
- Longest Substring Without Repeating CharactersmediumHash TableStringSliding Windowfrequency 67.0
- Merge k Sorted ListshardLinked ListDivide and ConquerHeap (Priority Queue)Merge Sort+1frequency 67.0
- Best Time to Buy and Sell Stock IImediumArrayDynamic ProgrammingGreedyfrequency 66.0
- Reverse IntegermediumMathfrequency 66.0
- Rotate ImagemediumArrayMathMatrixfrequency 66.0
- Subarray Product Less Than KmediumArrayBinary SearchSliding WindowPrefix Sumfrequency 64.9
- Find First and Last Position of Element in Sorted ArraymediumArrayBinary Searchfrequency 63.7
- Median of Two Sorted ArrayshardArrayBinary SearchDivide and Conquerfrequency 63.7
- Meeting Rooms IImediumArrayTwo PointersGreedySorting+2frequency 63.7
- Subarray Sum Equals KmediumArrayHash TablePrefix Sumfrequency 63.7
- Trapping Rain WaterhardArrayTwo PointersDynamic ProgrammingStack+1frequency 63.7
- Design Circular QueuemediumArrayLinked ListDesignQueuefrequency 62.5
- Insert Delete GetRandom O(1)mediumArrayHash TableMathDesign+1frequency 62.5
- Lowest Common Ancestor of a Binary TreemediumTreeDepth-First SearchBinary TreeBinary Lifting+1frequency 62.5
- Move ZeroeseasyArrayTwo Pointersfrequency 62.5
- Reverse BitseasyDivide and ConquerBit Manipulationfrequency 62.5
- Merge Two Sorted ListseasyLinked ListRecursionfrequency 61.2
- Snapshot ArraymediumArrayHash TableBinary SearchDesign+1frequency 61.2
- Basic Calculator IImediumMathStringStackfrequency 59.9
- Find Median from Data StreamhardTwo PointersDesignSortingHeap (Priority Queue)+1frequency 59.9
- Min StackmediumStackDesignfrequency 59.9
- Word LadderhardHash TableStringBreadth-First SearchBidirectional Searchfrequency 59.9
- Merge Sorted ArrayeasyArrayTwo PointersSortingfrequency 58.4
- Word BreakmediumArrayHash TableStringDynamic Programming+3frequency 58.4
- 3SummediumArrayTwo PointersSortingfrequency 56.8
- Climbing StairseasyMathDynamic ProgrammingMemoizationfrequency 56.8
- Design Tic-Tac-ToemediumArrayHash TableDesignMatrix+1frequency 56.8
- Search a 2D Matrix IImediumArrayBinary SearchDivide and ConquerMatrixfrequency 56.8