Amazon | Campus Technical Interview Experience

Posted
22 Aug 2021
272 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.

How it went

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'.

Questions asked (10)

  1. 01

    Largest BST Subtree

    Data Structures & Algorithms · Hard

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

  2. 02

    Check if Array can be Divided into Pairs Divisible by K

    Data Structures & Algorithms · Medium

    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.

  3. 03

    Knight's Tour Problem

    Data Structures & Algorithms · Hard

    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.

  4. 04

    Find Second Largest Element in Array

    Data Structures & Algorithms · Easy

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

  5. 05

    Flatten Binary Tree to Linked List

    Data Structures & Algorithms · Medium

    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.

  6. 06

    Best Time to Buy and Sell Stock

    Data Structures & Algorithms · Easy

    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.

  7. 07

    Median in a Stream of Integers

    Data Structures & Algorithms · Hard

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

  8. 08

    Previous Permutation

    Data Structures & Algorithms · Medium

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

  9. 09

    Lowest Common Ancestor (LCA) for N-ary Tree

    Data Structures & Algorithms · Medium

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

  10. 10

    Uncrossed Lines

    Data Structures & Algorithms · Medium

    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.

Know someone preparing? Send it to them:WhatsAppLinkedInX

Interviewed at Amazon recently?

Write up your rounds while you still remember the questions. It helps the next person more than you would think.

Share your experience
Discussion 0

Questions for the author, or how your own interview compared.

Join the discussion

Sign in with Google to comment or ask the author a question.

No comments yet

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