Amazon | Campus Technical Interview Experience

amazon logo
amazon
August 22, 202112 reads

Summary

I participated in the Amazon campus technical interviews, which comprised multiple challenging rounds. The interviews heavily focused on data structures and algorithms, covering a diverse set of problems across different complexities.

Full Experience

During my Amazon campus technical interview experience, the process involved several rounds designed to assess problem-solving capabilities. From what I recall and gathered from other students, we encountered a wide range of algorithmic challenges. In one round, I remember tackling questions like finding the largest BST subtree in a binary tree and determining if an array could be divided into pairs whose sum is divisible by a given 'k'. Another round featured the classic Knight's Tour problem, a challenging backtracking exercise, alongside a more straightforward task like finding the second largest element in an array and flattening a binary tree. Later rounds continued this trend, with problems such as maximizing profit from stock transactions, handling median calculations in a stream of integers, and finding previous permutations. The interviewers also explored advanced tree concepts like the Lowest Common Ancestor in an N-ary tree and dynamic programming challenges like 'Uncrossed Lines'.

Interview Questions (10)

Q1
Largest BST Subtree
Data Structures & AlgorithmsHard

Given a binary tree, find the largest subtree that is also a binary search tree (BST) and return the size of the subtree.

Q2
Check if Array can be Divided into Pairs Divisible by K
Data Structures & AlgorithmsMedium

Given an array of integers arr and an integer k, return true if it is possible to divide the array into pairs such that the sum of each pair is divisible by k.

Q3
Knight's Tour Problem
Data Structures & AlgorithmsHard

Solve the Knight's Tour problem, finding a sequence of moves for a knight on a chessboard such that it visits every square exactly once.

Q4
Find Second Largest Element in Array
Data Structures & AlgorithmsEasy

Given an array of integers, find the second largest element in it.

Q5
Flatten Binary Tree to Linked List
Data Structures & AlgorithmsMedium

Flatten a binary tree into a 'linked list' in-place. The 'linked list' should follow the same order as a pre-order traversal of the binary tree.

Q6
Best Time to Buy and Sell Stock
Data Structures & AlgorithmsEasy

Given an array prices where prices[i] is the price of a given stock on the ith day, find the maximum profit you can achieve.

Q7
Median in a Stream of Integers
Data Structures & AlgorithmsHard

Design a data structure that supports adding new numbers and finding the median of all numbers added so far.

Q8
Previous Permutation
Data Structures & AlgorithmsMedium

Given an array of integers, find the lexicographically previous permutation of the numbers.

Q9
Lowest Common Ancestor (LCA) for N-ary Tree
Data Structures & AlgorithmsMedium

Find the lowest common ancestor (LCA) of two given nodes in an N-ary tree.

Q10
Uncrossed Lines
Data Structures & AlgorithmsMedium

Given two integer arrays nums1 and nums2, return the maximum number of uncrossed lines you can draw connecting elements nums1[i] and nums2[j] such that nums1[i] == nums2[j] and the lines do not intersect.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!