Amazon attempts

1st Amazon attempt (Cape Town):

  • Kadane’s Algorithm
  • Implementation of HashTables
  • Difference between new and malloc

2nd Amazon attempt:

Online test questions:

  • LCA
  • Delete duplicate nodes in Linked List

1st telephonic:

  • Generate excel column names (A, B,… , Z, AA, BB,… , ZZ, AAA,…)
  • Find square root of a number without using sqrt()

2nd telephonic:

  •  Print if there exists a path with sum equal to K
    • Print the path
    • Return only True or False

1st onsite:

  • isBST
  • Circular linked list
    • Number of nodes in the loop
    • First node that is circularly linked
  • Rope puzzle

2nd onsite:

  • In a BST find two numbers with sum K
  • Array return index of number from where left and right sum are same

Amazon third attempt:

Onsite written test:

  • Find if a given LinkedList is palindrome or not
  • Given an ‘ascending sorted’ and rotated array find the index of the given number
  • Next largest number in a BST when a node is given

1st onsite:

  • Distance between given two nodes in a binary tree (Upon hearing about LCA, wanted a solution for finding it in O(n) time and O(1) space)
  • Kadane’s Algorithm
  • In an array, delete a number if there exists greater number than it, on its right side

2nd onsite:

  • Delete duplicate elements in a string
    • Do this in O(1) space and O(n^2) time complexities
    • Do this when resulting string can be in any given order (O(n) time and O(1) space)

3rd onsite:

  • Data structure that supports insertion, deletion and searching in O(log n) time
  • Vertical sum in a binary tree
  • In a gven 2 D array with sorted rows, sort the whole matrix

* * * * *

Leave a comment

Filed under Interviews

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s