Amazon | OA 2024 (SDE-I) | Vulnerability servers & Max median (packets)

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-05-01Added By Anonymous
Source: Link

Company: Amazon
Role: sde i
Interview Stage: OA (Online Assessment)
Location: unknown
Year: 2024

Original Post Content:

Q1: Amazon Web Services has n servers where the ith server's vulnerability score is vulnerability[i]. A client wants to deploy their application on a group of m contiguous servers. The vulnerability of a group is defined as the kth minimum vulnerability among the chosen servers. Find the vulnerability of each possible group of m contiguous servers the client can choose.

Verdict: Tried to solve this using min heap, but was only able to pass 7/15 test cases as I got TLE.

Q2: Given m channels (int) with a packets (list). We need to distribute the packets to m channels, ensure the sum of all channels' median is max. Each channel should get at least one packet.

Verdict: Solved this by sorting the packets list and passed 15/15 test cases.

Can I expect an interview call??

Comments