Open In App

Amazon SDE-2 interview experience

Last Updated : 15 Jul, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

Just attended a lateral hiring for Senior Development Engineer, Amazon at Amazon, Gurgaon. Was asked the following questions.

Round 1

Q1 Find the max of each window of size k in a given array.
Q2. Given an even length expression consisting only of ‘{‘ and }’, find the min. number of edits needed to make it a valid balanced expression.

Round 2

Q1. Given a text and a search string, find the shortest substring of the text containing the anagram of the search string.
i/p : text – abcdbabcba, search string – abb
o/p: abcb

Q2. Given a map that maps two integers such that the key is the source level, and value is the max level reachable from the source level, find the min. steps needed to reach the last level beginning from the first level.
eg: i/p: 1->4, 2->3, 3->6, 4->5, 5->8, 6->7, 7->8, 8->-1 (-1 indicates that last level has been reached).
o/p : 3 [1->4, 4->5, 5->8 = 3 steps]

Q3. Given a list/ array of sentences (consisting of alphabetical words), print the sentence(s) that has/have at least as many consonents as it has vowels, and which contains the word that occurs most frequently amongst all the given sentences.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads