Add office photos
Amazon logo
Engaged Employer

Amazon

Verified
4.1
based on 25.2k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Clear (1)

10+ Amazon SDE (Software Development Engineer) Interview Questions and Answers

Updated 5 Feb 2024

Q1. Write a program to calculate the sum of level order tree

Ans.

Program to calculate sum of level order tree

  • Traverse the tree level by level using BFS

  • Add the values of each level and return the sum

  • Use a queue to store the nodes at each level

  • Handle edge cases like empty tree or null root

Add your answer
right arrow

Q2. Alien Dictionary with slight modification to sort list of words with some random order

Ans.

Sorting a list of words with a random order using an alien dictionary

  • Create a graph with nodes as characters and edges as the order of characters in words

  • Topologically sort the graph to get the correct order of characters

  • Use the order to sort the list of words

Add your answer
right arrow

Q3. Maximum continous sum in an array of integers

Ans.

Find the maximum continuous sum in an array of integers.

  • Use Kadane's algorithm to find the maximum subarray sum in linear time complexity.

  • Initialize two variables, one for current maximum sum and another for overall maximum sum.

  • Iterate through the array and update the variables accordingly.

  • Example: For array [-2, 1, -3, 4, -1, 2, 1, -5, 4], the maximum continuous sum is 6 (from index 3 to 6).

Add your answer
right arrow

Q4. 2. Are you aware of high and low level design principles

Ans.

Yes, high and low level design principles are important in software development.

  • High level design principles focus on overall architecture and system organization.

  • Low level design principles focus on implementation details and code structure.

  • Examples of high level design principles include SOLID, DRY, and KISS.

  • Examples of low level design principles include naming conventions, code commenting, and code formatting.

  • Both high and low level design principles are important for cre...read more

Add your answer
right arrow
Discover Amazon interview dos and don'ts from real experiences

Q5. write a program to find all the sibling node of the BST

Ans.

Program to find all sibling nodes of a BST

  • Traverse the BST and keep track of parent node

  • If a node has the same parent as another node, they are siblings

  • Recursively check left and right subtrees

  • Use a queue or stack to implement level order traversal

Add your answer
right arrow

Q6. A variant of Longest Increasing Subsequence

Ans.

Find the length of longest increasing subsequence in an array.

  • Use dynamic programming to solve the problem efficiently.

  • Maintain an array to store the length of longest increasing subsequence ending at each index.

  • Traverse the array and update the array for each index.

  • Return the maximum value in the array as the length of longest increasing subsequence.

Add your answer
right arrow

Q7. Maximum of every window of size K in an array

Ans.

Find maximum of every window of size K in an array

  • Iterate through the array and maintain a deque of indices of elements in the current window

  • Remove indices from the front of the deque if they are outside the current window

  • Remove indices from the back of the deque if their corresponding elements are smaller than the current element

  • The front of the deque will always contain the index of the maximum element in the current window

Add your answer
right arrow

Q8. Binary Search in a semi infinite array

Ans.

Implement binary search in a semi-infinite array.

  • Start with the first element and keep doubling the index until the target element is less than the current element.

  • Perform binary search on the subarray from the last doubled index to the current index.

  • If the target element is not found, repeat the process by doubling the last index and searching again.

  • Handle edge cases where the target element is at the first index or not present in the array.

Add your answer
right arrow

Q9. Convert expression to post-fix

Ans.

Convert an expression to post-fix notation.

  • Start with an empty stack.

  • Scan the expression from left to right.

  • If the scanned character is an operand, output it.

  • If the scanned character is an operator, pop two operands from stack, output them in post-fix notation and push the result back.

  • Repeat until the end of expression.

Add your answer
right arrow

Q10. merge overlapping intervals

Ans.

Merge overlapping intervals

  • Sort the intervals based on their start time

  • Iterate through the intervals and merge overlapping ones

  • Return the merged intervals

Add your answer
right arrow

More about working at Amazon

Back
Awards Leaf
AmbitionBox Logo
Top Rated Mega Company - 2024
Awards Leaf
Awards Leaf
AmbitionBox Logo
Top Rated Company for Women - 2024
Awards Leaf
Awards Leaf
AmbitionBox Logo
Top Rated Internet/Product Company - 2024
Awards Leaf
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Amazon SDE (Software Development Engineer)

based on 2 interviews
3 Interview rounds
Technical Round - 1
Technical Round - 2
Aptitude Test Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top SDE (Software Development Engineer) Interview Questions from Similar Companies

View all
Recently Viewed
DESIGNATION
Pyspark Developer
25 interviews
INTERVIEWS
Carwale
No Interviews
INTERVIEWS
Fractal Analytics
No Interviews
INTERVIEWS
Housing.com
No Interviews
INTERVIEWS
Amazon
No Interviews
INTERVIEWS
Fractal Analytics
10 top interview questions
DESIGNATION
INTERVIEWS
Capgemini
No Interviews
INTERVIEWS
Tiger Analytics
No Interviews
INTERVIEWS
Fractal Analytics
No Interviews
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter