Amazon Senior Principal coding interview questions
These are the 6 coding questions YourAlly has tagged for Amazon at Senior Principal. Senior Principal is the common India title for this level. Amazon calls it L8, Senior Principal SDE. YourAlly treats it as Senior staff, the same level as Google L7 and Meta E7.
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 coding is often a smaller part of the loop, but the bar for clarity and speed stays high.
Practice a mock Amazon Senior Principal coding loopPractice Amazon coding questions
Shortest Aisle Span Covering an OrderFree to read
Shelf slots along one aisle hold SKUs in order. An order lists SKUs, possibly repeated. Return [start, end] of the shortest contiguous run of slots that contains every SKU in the order with its multiplicity, leftmost on ties, or an empty list if none exists.
Input: aisle = ["c","a","d","b","a","b"], order = ["a","b"] Output: [3,4]
What a strong answer covers
- Sliding window with need counts and a missing counter
- Handles repeated SKUs in the order
- Strict comparison for leftmost tie-break
- O(n + m) time
- Empty order and impossible cases return an empty list
5 more coding questions
- Critical Links Between Availability Zones Locked
- Fewest Shuttle Transfers Locked
- Maximize Delivery Slot Revenue Locked
- Rolling Median Request Latency Locked
- Merge Two Sorted Lists Locked
Related pages
More Amazon Senior Principal rounds
- System design 8 questions
- Behavioral 29 questions
- Project retrospective 10 questions
Amazon coding at other levels
Other companies at this level
- Adobe Senior Principal 4 questions
- Apple Senior Principal 7 questions
- Cisco Senior Principal 3 questions
- Google Senior Principal 14 questions
- IBM Senior Principal 3 questions
- Intel Senior Principal 3 questions