Amazon SDE2
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.
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.
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