Amazon WoW (28 July 2023) Coding Round Contest Experience
About Amazon WoW 2023: It is a great opportunity for women students across engineering campuses in India to get hired by Amazon as a software engineer. Below are the details regarding this hiring challenge.
Job Role |
SDE Intern |
---|---|
Qualification |
B.Tech/BE/ M.Tech/ME or two-year MCA, |
Batch |
2024/2025/2026 |
Salary |
44 LPA |
Branch |
All Branches are eligible |
Back-lock criteria |
backlog allowed |
Percentage Criteria: |
No % criteria |
Overview of the Problems: A total of 2 coding questions were there and the time given to solve them was 70 minutes.
Problems |
Difficulty |
Pre-requisite |
Approx. time to solve |
number of submissions by me |
---|---|---|---|---|
Question 1 |
Medium |
Basic mathematics |
10-15 minutes |
1 |
Question 2 |
Medium |
String and Observations |
15-20 minutes |
1 |
Let’s Discuss:
Problem 1: Given a permutation of size N, for each value 1<=x<=N find the number of consecutive subarrays having median=x
Example:
Input: [4,3,2,1]
Output: 1 2 2 1
Constraints: n <= 10^3
My Experience: Initially this question seemed very hard to me, but after seeing the constraints I realized that the N^2 solution was sufficient to solve this problem. We can simply brute force on each and every sub-array and calculate its median.
Problem 2: Given N string each of size of M, consisting of lower case English alphabets and a wild card character ‘?’. Two strings are said equivalent if the wildcard characters can be changed to some other characters and then both the string become the same. for example if s=”?cc?” and q=”dc??”, then s and q are equivalent as s and q can be made same i.e. “dccx”.
Find the minimum number of ‘?’ characters possible in a pattern that is equivalent to all the N strings given to you.
Example:
Input: [bug, gub, g?a]
Output: 2
Explanation: “?u?” has 2 ‘?’ and it is equivalent to all input strings.
Constraints: n*m<= 10^5
My Experience: Again this question could have been hard, but the constraints made it quite easy for me, only the implementation part of this question took me some extra time.
Accepted Solution: For each index ‘i’ we can create a set that stores all characters except ‘?’ at that index for each given string. If the set size for that index is greater than 1, it means in our answer string there should be a ‘?’ and increase our result by 1.
Conclusion: I was able to solve both questions without any wrong submissions and got selected for the Interview round.
Contact Us