Amazon SDE2

amazon logo
amazon
SDE II
May 31, 20253 reads

Summary

I underwent an Amazon SDE2 interview process, which included problem-solving, data structures & algorithms, and system design rounds, presenting several challenging questions.

Full Experience

Round 1: problem solving

Round 2:DSA

Q1 In the land of Hogwards, there are A citites and M magical one-way roads connecting them.

  • Each road allows travel from one city to another in a specific direction only.

The Royal Cartographer has recorded these roads in a scroll. This scroll contains a list B, where each entry is a pair of cities [u, v] representing a one-way road from city u to city v.

Now, the king presents you with a unique challenge:

"Is there a city in Hogwards such that, if a messenger starts from this city, they can reach every other city in the kingdom by following the direction of the roads?"

Your task is to determine whether such a city exists. If it does, return 1. If no such city can reach all others through the directed roads, return 0.

Can you help the king find this special city, if it exists?

Q2 In the twin kingdoms of Arraya and Beeland, each land is home to N legendary warriors.

  • These warriors are ranked by strength, represented by integers in two sacred scrolls- scroll A for Arraya and scroll B for Beeland. The High Council is organizing a Grand Tournament where teams of two warriors-one from Arraya and one from Beeland-will be paired to fight as a unit. The combined strength of a team is the sum of the individual strenghts of it's two warriors.

However, the council is only interested in the most powerful C teams to showcase in the final rounds. Your task is to help the council by choosing the top C team combinations (based on combined strength) from all possible warrior pairings between the two kingdoms.

Return a list containing the C highest possible team strenghts, sorted in descending order.

Will you rise to the challenge and help the council from the most fearsome alliances?

Q3 Given a linked list A of length N and an integer B.

You need to find the value of the Bth node from the middle towards the beginning of the Linked List A.

If no such element exists, then return -1.

Round 3: System design

netwrok like aws- system that captures teh state of the network. State of the networking devices. State- static(device name, mac address, manufactureer, vendor), dynamic(up/down, IP address, neighbouring devies(what devices it is connecting to) device has all these details and can provide all these details

Fn requirement:- 1- captures the state 2. it has to surface the state

300K devices, 300 sec. , state size- 1kb, 100TPS

Interview Questions (4)

Q1
Find City that can Reach All Other Cities
Data Structures & AlgorithmsMedium

In the land of Hogwards, there are A citites and M magical one-way roads connecting them.

  • Each road allows travel from one city to another in a specific direction only.

The Royal Cartographer has recorded these roads in a scroll. This scroll contains a list B, where each entry is a pair of cities [u, v] representing a one-way road from city u to city v.

Now, the king presents you with a unique challenge:

"Is there a city in Hogwards such that, if a messenger starts from this city, they can reach every other city in the kingdom by following the direction of the roads?"

Your task is to determine whether such a city exists. If it does, return 1. If no such city can reach all others through the directed roads, return 0.

Can you help the king find this special city, if it exists?

Q2
Top C Team Combinations by Strength
Data Structures & AlgorithmsMedium

In the twin kingdoms of Arraya and Beeland, each land is home to N legendary warriors.

  • These warriors are ranked by strength, represented by integers in two sacred scrolls- scroll A for Arraya and scroll B for Beeland. The High Council is organizing a Grand Tournament where teams of two warriors-one from Arraya and one from Beeland-will be paired to fight as a unit. The combined strength of a team is the sum of the individual strenghts of it's two warriors.

However, the council is only interested in the most powerful C teams to showcase in the final rounds. Your task is to help the council by choosing the top C team combinations (based on combined strength) from all possible warrior pairings between the two kingdoms.

Return a list containing the C highest possible team strenghts, sorted in descending order.

Will you rise to the challenge and help the council from the most fearsome alliances?

Q3
Bth Node from Middle Towards Beginning of Linked List
Data Structures & AlgorithmsEasy

Given a linked list A of length N and an integer B.

You need to find the value of the Bth node from the middle towards the beginning of the Linked List A.

If no such element exists, then return -1.

Q4
Design Network State Capture and Surface System
System DesignHard

netwrok like aws- system that captures teh state of the network. State of the networking devices. State- static(device name, mac address, manufactureer, vendor), dynamic(up/down, IP address, neighbouring devies(what devices it is connecting to) device has all these details and can provide all these details

Fn requirement:- 1- captures the state 2. it has to surface the state

300K devices, 300 sec. , state size- 1kb, 100TPS

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!