YourAlly

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

  1. Recover Keyboard Locale Ordering Locked
  2. Visible Outline of Stacked Widgets Locked
  3. Longest Unique Substring Locked
  4. Minimal Edit Script Locked
  5. Run-Length Encode Locked
  6. Validate IPv4 CIDR Containment Locked

Sign up free to practice all 7

Related pages

More Apple SDE-3 rounds

Apple coding at other levels

Other companies at this level

Company guide

Apple interview guide in Academy