Apple SDE-3 coding interview questions
These are the 7 coding questions YourAlly has tagged for Apple at SDE-3. SDE-3 is the common India title for this level. YourAlly treats it as Senior, the same level as Google L5, Meta E5 and Amazon L6.
A coding round at a large tech company usually runs 45 to 60 minutes with one or two problems. You write code that runs, test it on your own examples and state its time and space cost. At this level the bar is a correct, tested solution you reach mostly on your own, with the trade-offs said out loud.
Practice a mock Apple SDE-3 coding loopPractice Apple coding questions
Thumbnail LFU CacheFree to read
A photo app caches decoded thumbnails with least-frequently-used eviction, breaking ties by least recently used. Simulate "put" [key, value] and "get" [key] operations on a cache of the given capacity and return the result of every get, using -1 for a miss.
Input: capacity = 2, operations = ["put","put","get","put","get","get","put","get","get","get"], arguments = [[1,1],[2,2],[1],[3,3],[2],[3],[4,4],[1],[3],[4]] Output: [1,-1,3,-1,3,4]
What a strong answer covers
- Count-to-ordered-bucket map for O(1) operations
- Minimum count maintenance on touch and insert
- LRU tie-break within a bucket
- Update counts as a use
- Capacity 0 handled
6 more coding questions
- Recover Keyboard Locale Ordering Locked
- Visible Outline of Stacked Widgets Locked
- Longest Unique Substring Locked
- Minimal Edit Script Locked
- Run-Length Encode Locked
- Validate IPv4 CIDR Containment Locked
Related pages
More Apple SDE-3 rounds
- System design 4 questions
- Behavioral 9 questions
- Project retrospective 3 questions
Apple coding at other levels
- Principal 7 questions
- Senior Principal 7 questions
- Senior EM 4 questions
Other companies at this level
- Adobe SDE-3 7 questions
- Amazon SDE-3 10 questions
- Cisco SDE-3 6 questions
- Google SDE-3 14 questions
- IBM SDE-3 6 questions
- Intel SDE-3 6 questions