Apple Staff coding interview questions
These are the 7 coding questions YourAlly has tagged for Apple at Staff. On the YourAlly ladder this is Staff (E6), the same level as Google L6, Meta E6 and Amazon L7.
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 interviewers also expect clean code quickly and edge cases you raise before they do.
Practice a mock Apple Staff coding loopPractice Apple coding questions
Visible Outline of Stacked WidgetsFree to read
Home screen widgets are drawn as rectangles standing on a common baseline. Each widget is [left, right, height]. Return the key points of the combined top outline as [x, height] pairs sorted by x, where each point marks a height change and the last point drops to 0.
Input: widgets = [[2,9,10],[3,7,15],[5,12,12],[15,20,10],[19,24,8]] Output: [[2,10],[3,15],[7,12],[12,0],[15,10],[20,8],[24,0]]
What a strong answer covers
- Sweep over sorted edge coordinates
- Max-heap with lazy removal by right edge
- Ground sentinel of height 0
- Emit only on height change
- O(n log n) time
6 more coding questions
- Recover Keyboard Locale Ordering Locked
- Thumbnail LFU Cache Locked
- Longest Unique Substring Locked
- Minimal Edit Script Locked
- Run-Length Encode Locked
- Validate IPv4 CIDR Containment Locked
Related pages
More Apple Staff rounds
- Behavioral 12 questions
- Project retrospective 3 questions
Apple coding at other levels
- Senior 7 questions
- Senior staff 7 questions
- Senior EM 4 questions
Other companies at this level
- Adobe Staff 4 questions
- Airbnb Staff 4 questions
- Amazon L7 6 questions
- Anthropic Staff 5 questions
- Cisco Staff 3 questions
- Google L6 14 questions