Amazon SDE 1 Interview Questions
Summary
I recently interviewed for the SDE 1 position at amazon. The interview consisted of one behavioral question based on amazon's leadership principles and two coding problems, covering divisibility rules for large numbers and a graph traversal problem related to network activation.
Full Experience
I had an interview for the SDE 1 role at amazon. There were two interviewers, and we started with introductions. Following that, they asked me a behavioral question based on amazon's leadership principles. The coding round then presented two distinct problems. The first involved checking divisibility by 12 for a large number given as a string, while the second was a graph-based problem, which was a variation of 'Detonate the Maximum Bombs' from LeetCode. Unfortunately, the time ran out before we could discuss any follow-up questions.
Interview Questions (3)
Learning Experience in College/Projects
What was the time you learn something like in your college days, projects?
Divisibility by 12 for Large Number
Q1. Given a number n in the form of string (0 < length(n) < 1e5). Your task is to find whether the number is divisible by 12 or not.
A number x is divisible by y if x mod y is equal to 0.
Sample:
Input - 4
Output - False
Input - 48
Output - True
Detonate the Maximum Bombs (Hubs Coverage)
Q2. Amazon operates a network of delivery hubs across different cities Each hub has a service coverage radius within which it can activate and coordinate other hubs. When a hub is activated, it can automatically trigger activation of all hubs that fall
within its services coverage area.
Each hub is represented as a 2D integer array hubs where hubs[i] = [xi, yi, ri].
-> (xi, yi) denotes the geographical coordinates of the hub.
-> ri denotes the coverage radius of that hub.
You may choose to activate only one hub initially. Once activated, that hub can trigger all other hubs within its coverage. Those hubs can further trigger the hubs within their coverage, and so on.
Your task is to determine:
What is the maximum number of hubs that can be activated if you are allowed to start with only one hub?
input: [[1,2,3],[2,3,1],[3,4,2],[4,5,3],[5,6,4]]
output: 3
Constraints:
1 <= n <= 100
1 <= xi,yi,ri <= 1e5