amazon logo
Amazon· Intern

Amazon | Intern | Interview questions | Stipend & Other Details

Result
Offer
Posted
10 Aug 2023
269 reads

Summary

I had a 60-minute interview for an Intern position at Amazon where I was asked four LeetCode-linked questions. I provided two approaches for each problem, securing an offer for the role.

How it went

I participated in an interview for an Intern position at Amazon. The interview lasted 60 minutes. I was presented with four distinct coding problems, all of which were direct links to LeetCode problems. For each question, I was able to provide two approaches: first, an explanation of my logic, and then a more detailed explanation accompanied by code. I was told that a functional code snippet was sufficient, without needing full input/output handling. I successfully cleared the interview and received an offer.

Questions asked (4)

  1. 01

    Linked List Cycle

    Data Structures & Algorithms · Easy

    Given the head of a singly linked list, return true if there is a cycle in the linked list. Otherwise, return false. There is a cycle in a linked list if some node in the list can be reached again by continuously following the next pointers. Internally, pos is used to denote the index of the node that tail's next pointer is connected to. pos is -1 if there is no cycle. Note that pos is not passed as a parameter.

    Open the problem
  2. 02

    Linked List Cycle II

    Data Structures & Algorithms · Medium

    Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if some node in the list can be reached again by continuously following the next pointers. Internally, pos is used to denote the index of the node that tail's next pointer is connected to. pos is -1 if there is no cycle. Do not modify the linked list.

    Open the problem
  3. 03

    Best Time to Buy and Sell Stock II

    Data Structures & Algorithms · Medium

    You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then immediately sell it on the same day. Find the maximum profit you can achieve.

    Open the problem
  4. 04

    Count Good Nodes in Binary Tree

    Data Structures & Algorithms · Medium

    Given a binary tree root, a node X in the tree is named a 'good node' if in the path from the root to X, there are no nodes with a value greater than X.val. Return the number of good nodes in the binary tree.

    Open the problem

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!