# Amazon attempts

1st Amazon attempt (Cape Town):

• 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
• 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)
• 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

* * * * *