Panda Guru LogoPanda
Guru

Amazon SDE 6m Internship Interview Experience

Round 1: Online Assessment 1 (via Mettl)

Questions: Given an array of integers arr and a constant y, find the length of the largest subset such that the absolute difference between any two elements in the subset is greater than or equal to y.

Example: For the input

arr = {-900, 1, 1, 2, 100, 101, 2, 4, 5, 10, 18, 20, 15} y = 4

the expected output is 7. One possible largest subset is {-900, 1, 100, 5, 10, 20, 15}, where the difference between any two elements in the subset is greater than or equal to 4.

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 2: Online Assessment 2 (via Hackerrank)

Questions:

  1. Given an array of integers arr and a constant x, find the number of pairs (i, j) such that: i < j and arr[i] + arr[j] is divisible by x

    Example: For the input

    arr = [3, 8, 2, 7, 1, 9] x = 5

    The valid pairs are (3, 7), (8, 2), (7, 8), and (1, 9) because their sums are divisible by 5. So, the expected output would be 4.

  2. Given an array of strings where each string consists of lowercase alphabets and the character '?' return a string that has the fewest '?' characters while matching all the given strings. The character '?' can be replaced with any lowercase alphabet to achieve a match. (The array consists of strings of same length)

    Examples:

    • For the input array of strings ["a?c", "??c", "abc"], the expected output is "abc"
    • For the input array of strings ["adc", "??c", "abc"], the expected output is "a?c"
Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.


Round 3: Virtual Interview

Questions:

  1. Check whether array can be made strictly increasing by removing at most one element. Time Complexity: O(n)
    Leetcode: Remove One Element to Make the Array Strictly Increasing

  2. Merge Intervals. Time Complexity: O(nlogn)
    Leetcode: Merge Intervals

Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.