Open In App

Amazon Interview Experience for SDE-1(On Campus)

Improve
Improve
Like Article
Like
Save
Share
Report

Round 1 (Online Assessment 2hr 30min): The assessment consisted of four components, a code debugging section (20 minutes), a coding test (70 minutes), a work styles assessment (20 minutes), and a reasoning ability section (35 minutes).

Coding test questions:

  1. Given a number x, and a row-wise and column-wise sorted matrix, check if x exists in the matrix or not.
  2. Given a linked list, create a copy of that linked list and return a pointer to the head of the new linked list. 

Round 2 (Online Interview 30 mins):

  1. A small discussion on trees and graphs
  2. Given a directed graph, check if it is a tree or not. Write complete clean code.

Round 3 (Online Interview 1 hr):

Interviewer: Select any one of your projects, we will then discuss it.

Did a detailed discussion on the project. The interviewer asked many technical details related to approach, implementation, results, etc, and non-technical questions like, “what was the most challenging part”. This took 30 minutes.

Design question: We have a system where logs are continuously being generated. Say, a few logs every minute. Each log will have a timestamp. Log type can be an error, info, etc. We are only interested in error logs. The error can be also of many types. 

Timestamp  log type sublog type noOfInstances
7/12/2020 12:35:00 Error  abc  2
7/12/2020 12:36:25 Error  xyz  3
7/12/2020 12:36:25 Info   pqr  2
7/12/2020 12:37:20 Error  xyz  1

At any time we want to fetch Error types and their number of instances in the last t minutes from the current time.  The value of t depends on the query. In addition, you should be able to tell the error name with the highest number of instances in the last t minutes.
Interviewer, then further asked to tell the top k error name with the highest number of instances in the last t minutes.

Few more small questions like “how will you store data”, “how will you do this”, etc

Round 4(Online Interview 1 hr):

  1. Given a binary tree, Convert it to its mirror tree. I wrote a recursive function whose return type was void. The interviewer further asked to write one more solution, using a non-void return type function. Then a small discussion comparing both approaches, recursion-stack, worst and avg case time complexities, etc
  2. Given a BST, a node value, and an integer K. Print all nodes which are at distance K from the given node. Nodes at distance K from a node can be in all 3 directions. The left path, the right path, path via parent. The interviewer further asked to do the same question for the Binary tree.

I was able to answer all questions and write error-free clean code in one go. I got the offer 🙂


Last Updated : 10 Dec, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads