Upload Button Icon Add office photos

Filter interviews by

Whole Foods Market Java Developer Interview Questions and Answers

Be the first one to contribute and help others!

Interview questions from similar companies

I appeared for an interview before Sep 2020.

Round 1 - Coding Test 

(2 Questions)

Round duration - 120 minutes
Round difficulty - Medium

10 min for debugging
40 min for problems(coding)
40 min for pyschometric
30 min for aptitude

  • Q1. 

    Total Unique Paths Problem Statement

    You are located at point ‘A’, the top-left corner of an M x N matrix, and your target is point ‘B’, the bottom-right corner of the same matrix. Your task is to calcula...

  • Ans. 

    The task is to calculate the total number of unique paths from the top-left to bottom-right corner of an M x N matrix by moving only right or down.

    • Use dynamic programming to solve this problem efficiently.

    • Create a 2D array to store the number of unique paths for each cell in the matrix.

    • Initialize the first row and first column with 1 as there is only one way to reach each cell in the first row and column.

    • For each cell ...

  • Answered by AI
  • Q2. 

    Most Frequent Word Problem Statement

    You are given two strings 'A' and 'B' composed of words separated by spaces. Your task is to determine the most frequent and lexicographically smallest word in string ...

  • Ans. 

    Find the most frequent and lexicographically smallest word in string 'A' that is not present in string 'B'.

    • Split strings 'A' and 'B' into words

    • Count frequency of each word in 'A'

    • Check if word is not in 'B' and is the most frequent and lexicographically smallest

    • Return the word or -1 if no such word exists

  • Answered by AI
Round 2 - Video Call 

(2 Questions)

Round duration - 90 Minutes
Round difficulty - Easy

timing was 4 pm . we connected on amazon chime. Initially he asked me a few things from resume then moved on to problem solving.

  • Q1. 

    Number of Islands Problem Statement

    You are provided with a 2-dimensional matrix having N rows and M columns, containing only 1s (land) and 0s (water). Your goal is to determine the number of islands in t...

  • Ans. 

    Count the number of islands in a 2D matrix of 1s and 0s.

    • Use Depth First Search (DFS) or Breadth First Search (BFS) to traverse the matrix and identify connected groups of 1s.

    • Maintain a visited array to keep track of visited cells to avoid redundant traversal.

    • Increment the island count each time a new island is encountered.

    • Consider all eight possible directions for connectivity while traversing the matrix.

    • Handle edge ca...

  • Answered by AI
  • Q2. 

    Largest Rectangle in Histogram Problem Statement

    You are given an array/list HEIGHTS of length N, where each element represents the height of a histogram bar. The width of each bar is considered to be 1.

    ...
  • Ans. 

    Find the area of the largest rectangle that can be formed within the bounds of a given histogram.

    • Iterate through the histogram bars and maintain a stack to keep track of increasing heights.

    • Calculate the area of the rectangle formed by each bar as the smallest height in the stack times the width.

    • Update the maximum area found so far and return it as the result.

  • Answered by AI

Interview Preparation Tips

Professional and academic backgroundI applied for the job as SDE - 1 in DelhiEligibility criteria6 CGPAAmazon interview preparation:Topics to prepare for the interview - Data structures , oops, operating systems, database management system , algorithmsTime required to prepare for the interview - 3 monthsInterview preparation tips for other job seekers

Tip 1 : be confident since interviewer is looking at how confident you are with your skills
Tip 2 : dont learn the algorithms but try to understand them
Tip 3 : focus on trees and graphs since amazon asks more of that

Application resume tips for other job seekers

Tip 1 : KEEP RESUME SHORT(1 PAGE)
Tip 2 : DONT BLUFF IN RESUME SINCE MY INTERVIEWER ASKED ME LOOKING FROM IT

Final outcome of the interviewSelected

Skills evaluated in this interview

I appeared for an interview before Sep 2020.

Round 1 - Coding Test 

(2 Questions)

Round duration - 60 minutes
Round difficulty - Easy

There was 2 coding questions
Based on ds and algorithms

  • Q1. 

    Ninja's Pattern with Powers of 2

    Ninja, who loves playing with numbers, sets out to arrange numbers within 'N' rows. The unique arrangement follows these rules: the first row contains 1 number, the second...

  • Ans. 

    Generate a pattern of numbers in rows following a specific sequence based on powers of 2.

    • Start with 1 number in the first row, 2 numbers in the second row, 4 numbers in the third row, and so on based on powers of 2.

    • Fill the pattern with numbers in increasing sequence from 1 to 9, recycling back to 1 after reaching 9.

    • Output the pattern for a given number 'N' of rows.

    • Example: For N = 4, the pattern would be 1, 23, 4567,

  • Answered by AI
  • Q2. 

    Validate Binary Search Tree (BST)

    You are given a binary tree with 'N' integer nodes. Your task is to determine whether this binary tree is a Binary Search Tree (BST).

    BST Definition:

    A Binary Search Tr...

  • Ans. 

    Validate if a given binary tree is a Binary Search Tree (BST) or not.

    • Check if the left subtree of a node contains only nodes with data less than the node's data.

    • Check if the right subtree of a node contains only nodes with data greater than the node's data.

    • Recursively check if both the left and right subtrees are also binary search trees.

    • Example: For a node with data 4, left subtree nodes (2, 1, 3) are smaller and righ

  • Answered by AI
Round 2 - Coding Test 

(2 Questions)

Round duration - 60 minutes
Round difficulty - Easy

There was 2 coding questions based on ds and algorithms

  • Q1. 

    Zig-Zag Array Rearrangement

    You are provided with an array of distinct elements, and your task is to rearrange the array elements in a zig-zag manner. Specifically, for every odd index i, the element ARR[...

  • Ans. 

    Rearrange array elements in a zig-zag manner where every odd index element is greater than its neighbors.

    • Iterate through the array and swap elements to satisfy the zig-zag condition.

    • Ensure that for every odd index i, ARR[i] > ARR[i-1] and ARR[i] > ARR[i+1].

    • Multiple correct answers may exist for a given array.

  • Answered by AI
  • Q2. 

    Flatten a Linked List

    You are provided with a linked list of 'N' nodes. Each node contains two pointers: NEXT, pointing to the next node in the list, and CHILD, pointing to a linked list. Each child linke...

  • Ans. 

    Flatten a linked list of sorted child linked lists into a single sorted linked list.

    • Traverse the linked list and maintain a priority queue to keep track of the next smallest element.

    • Merge the child linked lists into the priority queue while traversing the main linked list.

    • Pop elements from the priority queue to create the final flattened linked list.

  • Answered by AI
Round 3 - Video Call 

(1 Question)

Round duration - 45 Minutes
Round difficulty - Medium

My interview started at 9:30 and it took around 45 minutes to complete my interview.This was held on Amazon Chime and the interview lasted for 1 hour. Firstly the interviewer asked to introduce about myself, later asked regarding the projects I have mentioned in my resume. Then started displaying the coding question. The first question is number of islands in a matrix.

  • Q1. 

    Number of Islands Problem Statement

    You are provided with a 2-dimensional matrix having N rows and M columns, containing only 1s (land) and 0s (water). Your goal is to determine the number of islands in t...

  • Ans. 

    Count the number of islands in a 2D matrix of 1s and 0s.

    • Use Depth First Search (DFS) or Breadth First Search (BFS) to traverse the matrix and identify connected groups of 1s.

    • Maintain a visited array to keep track of visited cells to avoid redundant traversal.

    • Increment the island count each time a new island is encountered.

    • Consider edge cases like when the matrix is empty or all cells are water (0s).

  • Answered by AI

Interview Preparation Tips

Professional and academic backgroundI applied for the job as SDE - 1 in HyderabadEligibility criteriaAbove 65 percentAmazon interview preparation:Topics to prepare for the interview - Data Structures and Algorithms, Operating Systems, Computer Networks, JavaTime required to prepare for the interview - 3 monthsInterview preparation tips for other job seekers

Tip 1 : Be enough confident, don't be nervous. Maintain atleast 2 projects in your resume.
Tip 2 : You should be able to answer each and every thing present in your resume. Don't lie in your resume.
Tip 3 : Prepare Data Structures and Algorithms well. They mostly check our Problem Solving ability to find the solutions for the real world problems

Application resume tips for other job seekers

Tip 1 : Mention your skills in which you are perfect
Tip 2 : Mention atleast two projects

Final outcome of the interviewRejected

Skills evaluated in this interview

I appeared for an interview in Sep 2020.

Round 1 - Coding Test 

(2 Questions)

Round duration - 90 Minutes
Round difficulty - Easy

Two coding questions were asked and 90 minutes of time was allotted to solve both the problems

  • Q1. 

    Find All Pairs Adding Up to Target

    Given an array of integers ARR of length N and an integer Target, your task is to return all pairs of elements such that they add up to the Target.

    Input:

    The first line ...
  • Ans. 

    Given an array of integers and a target, find all pairs of elements that add up to the target.

    • Iterate through the array and for each element, check if the target minus the element exists in a hash set.

    • If it exists, add the pair to the result. If not, add the element to the hash set.

    • Handle cases where the same element is used twice to form a pair.

    • Return (-1, -1) if no pair is found.

  • Answered by AI
  • Q2. 

    Shortest Path in a Binary Matrix Problem Statement

    Given a binary matrix of size N * M where each element is either 0 or 1, find the shortest path from a source cell to a destination cell, consisting only...

  • Ans. 

    Find the shortest path in a binary matrix from a source cell to a destination cell consisting only of 1s.

    • Use Breadth First Search (BFS) algorithm to find the shortest path in the binary matrix.

    • Keep track of visited cells to avoid revisiting them.

    • Update the path length as you traverse the matrix.

    • Return -1 if no valid path exists from source to destination.

  • Answered by AI
Round 2 - Video Call 

(2 Questions)

Round duration - 60 Minutes
Round difficulty - Medium

The duration was approx 1 hour. The interview was taken by a young SDE-2.

  • Q1. 

    Character Frequency Problem Statement

    You are given a string 'S' of length 'N'. Your task is to find the frequency of each character from 'a' to 'z' in the string.

    Example:

    Input:
    S : abcdg
    Output:
    1...
  • Ans. 

    The task is to find the frequency of each character from 'a' to 'z' in a given string.

    • Create an array of size 26 to store the frequency of each character from 'a' to 'z'.

    • Iterate through the string and increment the count of the corresponding character in the array.

    • Print the array of frequencies as the output.

  • Answered by AI
  • Q2. 

    Fire in the Cells Problem Statement

    Given a matrix MAT of size N * M, where each cell is either on fire or safe, determine if a person can reach an escape cell without being burnt. The person starts from ...

  • Ans. 

    Determine if a person can reach an escape cell without encountering fire in a matrix.

    • Check if the person can reach an escape cell without encountering fire by simulating the movement of the person and fire spread.

    • If the person can reach an escape cell, return the time taken; otherwise, return -1.

    • Consider the constraints and edge cases while implementing the solution.

  • Answered by AI
Round 3 - Video Call 

(2 Questions)

Round duration - 60 Minutes
Round difficulty - Hard

The interviewer introduced himself and asked me to introduce myself.
I told him about the different projects that I had done and the work in the previous company.
I had worked on AWS(Amazon Web Services) so he asked me all the AWS services that I had worked with and to explain one of them. 
I explained about the working of ECS(Elastic Container Service).
After this, he moved to the coding questions.

  • Q1. 

    Maximum 0-1 Distance Problem Statement

    Given a binary matrix of size N*M, find the maximum distance 'di' for every 0-cell to its nearest 1-cell, where the distance is measured using Manhattan distance. Th...

  • Ans. 

    Find the maximum Manhattan distance from a 0-cell to its nearest 1-cell in a binary matrix.

    • Iterate through the matrix to find all 0-cells and calculate their distances to nearest 1-cells using Manhattan distance formula

    • Keep track of the maximum distance found so far and update it if a larger distance is encountered

    • Return the maximum distance as the final result

  • Answered by AI
  • Q2. 

    Search for Indices with Given Difference and Distance

    You are provided with an array containing 'N' non-negative integers, along with two other non-negative integers 'K' and 'M'. Your task is to identify ...

  • Ans. 

    Find a pair of indices in an array with given difference and distance constraints.

    • Iterate through the array and check all possible pairs of indices to satisfy the conditions

    • Use nested loops to compare each pair of indices and their corresponding elements

    • Return 'valid' if a pair of indices is found that meets the conditions, otherwise return 'invalid'

  • Answered by AI
Round 4 - Video Call 

(1 Question)

Round duration - 60 Minutes
Round difficulty - Medium

The interviewer was a very senior person with at least 10-15 years of experience. He introduced himself and asked me to tell him about myself. (Leadership principle questions followed)
 

  • Q1. 

    Special Binary Tree Problem Statement

    Determine whether an arbitrary binary tree is special. A binary tree is called special if every node in this tree has either zero or two children.

    Example:

    Input:
    ...
  • Ans. 

    Determine if a binary tree is special if every node has zero or two children.

    • Traverse the tree and check if each node has either 0 or 2 children.

    • Use a recursive approach to check children of each node.

    • If any node has only one child, return false immediately.

    • Example: For the given input, the output should be true.

  • Answered by AI
Round 5 - Video Call 

(2 Questions)

Round duration - 60 Minutes
Round difficulty - Medium

The interview started with introductions and some Leadership principle questions. The interviewer was again a senior person with at least 10-15 years of experience.

I was asked to explain some AWS services.
He asked me to tell about a time when I had a tight deadline and how I worked during it.
He asked me about a time when I took initiative and came up with something new which helped the entire team.
I had prepared well for the LP questions and was able to answer everything.
After this, we move on to coding questions.

  • Q1. 

    Word Presence in Sentence

    Determine if a given word 'W' is present in the sentence 'S' as a complete word. The word should not merely be a substring of another word.

    Input:

    The first line contains an in...
  • Ans. 

    Check if a given word is present in a sentence as a complete word.

    • Split the sentence into words using spaces as delimiter.

    • Check if the given word matches any of the words in the sentence.

    • Ensure that the word is not just a substring of another word in the sentence.

  • Answered by AI
  • Q2. 

    LRU Cache Design Question

    Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:

    1. get(key) - Return the value of the key if it exists in the cache; otherw...

  • Ans. 

    Design a Least Recently Used (LRU) cache data structure that supports get and put operations with capacity constraint.

    • Use a combination of hashmap and doubly linked list to implement the LRU cache.

    • Keep track of the least recently used item and update it accordingly.

    • Ensure to handle cache capacity by evicting the least recently used item when the cache is full.

  • Answered by AI

Interview Preparation Tips

Professional and academic backgroundI completed Computer Science Engineering from Visvesvaraya National Institute Of Technology. I applied for the job as SDE - 1 in HyderabadEligibility criteriaNoneAmazon interview preparation:Topics to prepare for the interview - Data Structures, Algorithms, OOPS, Graphs, TreesTime required to prepare for the interview - 7 MonthsInterview preparation tips for other job seekers

Tip 1 : Start with the basics if you have lost touch with competitive coding. Don't directly jump to interview questions.
Tip 2 : Create a timetable and set goals. Keep aside 3-4 hours for studying. Consistency is the key.
Tip 3 : Focus on medium and hard questions. Solving a lot of easy questions doesn't help.

Application resume tips for other job seekers

Tip 1 : You should have good projects to showcase.
Tip 2 : Keep it clean and simple.

Final outcome of the interviewSelected

Skills evaluated in this interview

I appeared for an interview before Sep 2020.

Round 1 - Coding Test 

(2 Questions)

Round duration - 90 minutes
Round difficulty - Medium

Online test which can be attempted anytime between 22 May 2020, 06:00 AM and 25 May 2020, 01:00 AM

  • Q1. 

    Postfix Expression Evaluation Problem Statement

    Given a postfix expression, your task is to evaluate the expression. The operator will appear in the expression after the operands. The output for each expr...

  • Ans. 

    Evaluate postfix expressions by applying operators to operands in a given order.

    • Iterate through the postfix expression and push operands onto a stack

    • When an operator is encountered, pop the required number of operands from the stack, apply the operator, and push the result back onto the stack

    • Continue until the entire expression is evaluated and the final result is left on the stack

  • Answered by AI
  • Q2. 

    Dice Throws Problem Statement

    You are given D dice, each having F faces numbered from 1 to F. The task is to determine the number of possible ways to roll all the dice such that the sum of the face-up num...

  • Ans. 

    The task is to determine the number of possible ways to roll all the dice such that the sum of the face-up numbers equals the given 'target' sum.

    • Use dynamic programming to solve the problem efficiently.

    • Create a 2D array to store the number of ways to achieve each sum with different number of dice.

    • Iterate through the dice and sum possibilities to fill up the array.

    • Return the result modulo 10^9 + 7.

    • Optimize the solution ...

  • Answered by AI
Round 2 - Video Call 

(2 Questions)

Round duration - 60 minutes
Round difficulty - Medium

June 25 2020
Timing: 12:00 pm to 1:00 pm
This round was completely devoted to coding. I was asked to introduce myself and then 2 coding questions were asked.

  • Q1. 

    Find First and Last Positions of an Element in a Sorted Array

    Given a sorted array ARR consisting of N integers and an integer X, find the first and last positions of occurrence of X in the array.

    Note:

    ...
  • Ans. 

    Find the first and last positions of an element in a sorted array efficiently.

    • Use binary search to find the first occurrence of X in the array.

    • Use binary search to find the last occurrence of X in the array.

    • Handle cases where X is not present or present only once.

    • Return the first and last positions as 0-based indices.

  • Answered by AI
  • Q2. 

    Maze with N Doors and 1 Key Problem Statement

    You are given an N x N maze where some cells have doors, and you have a key that can be used only once to open a door. Determine if there exists a path from t...

  • Ans. 

    Determine if there exists a path from the top-left cell to the bottom-right cell of a maze with N doors and 1 key.

    • Use depth-first search (DFS) or breadth-first search (BFS) to explore possible paths through the maze.

    • Keep track of the cells visited and use the key only once to open doors.

    • Check if the bottom-right cell is reachable after traversing the maze.

    • Handle edge cases such as the top-left and bottom-right cells ha...

  • Answered by AI
Round 3 - Video Call 

Round duration - 60 minutes
Round difficulty - Medium

9th July 2020
6:30PM to 7:30PM

Round 4 - Video Call 

(1 Question)

Round duration - 60 minutes
Round difficulty - Easy

23-July 2020
4:00 PM to 5:00 PM
Coding questions + Several questions on computer fundamentals and networking were asked in a rapid-fire manner.

  • Q1. 

    Stock Trading Maximum Profit Problem

    Given the stock prices for 'N' days, your goal is to determine the maximum profit that can be achieved. You can buy and sell the stocks any number of times but can onl...

  • Ans. 

    The goal is to determine the maximum profit that can be achieved by buying and selling stocks on different days.

    • Iterate through the stock prices and buy on the days when the price is lower than the next day's price, and sell on the days when the price is higher than the next day's price.

    • Calculate the profit by summing up the differences between buying and selling prices.

    • Repeat the process for each test case and output

  • Answered by AI
Round 5 - Video Call 

(1 Question)

Round duration - 60 minutes
Round difficulty - Medium

6- Aug 2020
3:00 PM to 4:00 PM
Resceduled to: @5:30 PM
Projects, Fundamentals check, Behavioral, Coding

  • Q1. 

    Path Counting in Directed Graph

    Given a directed graph with a specified number of vertices V and edges E, your task is to calculate the total number of distinct paths from a given source node S to all ot...

  • Ans. 

    Calculate total number of distinct paths from a given source node to all other nodes in a directed graph.

    • Use dynamic programming to keep track of the number of paths from the source node to each node.

    • Consider the modulo operation to handle large numbers efficiently.

    • Start by initializing the number of paths from the source node to itself as 1.

    • Iterate through all edges and update the number of paths for each destination ...

  • Answered by AI

Interview Preparation Tips

Professional and academic backgroundI completed Computer Science Engineering from Dr. B.R. Ambedkar National Institute of Technology. Eligibility criteriaDevelopment skills and leadership principlesAmazon interview preparation:Topics to prepare for the interview - Data structures, OOPS, Operating systems, DBMS, NetworkingTime required to prepare for the interview - 6 monthsInterview preparation tips for other job seekers

Tip 1 : Be confident while answering questions
Tip 2 : Make the interview conversational and Always keep a smiling face
Tip 3 : Ask something at the end of the interview which shows your interest in the company
Tip 4 : Prepare projects on the skills mentioned in the resume

Application resume tips for other job seekers

Tip 1 : Mention projects and internships.
Tip 2 : Keep your resume short and crisp.

Final outcome of the interviewSelected

Skills evaluated in this interview

I applied via Company Website and was interviewed in May 2021. There was 1 interview round.

Interview Questionnaire 

1 Question

  • Q1. General knowledge question

Interview Preparation Tips

Interview preparation tips for other job seekers - General knowledge question

I appeared for an interview in Aug 2017.

Interview Questionnaire 

7 Questions

  • Q1. Implement Merge Sort.
  • Ans. 

    Merge Sort is a divide and conquer algorithm that sorts an array by dividing it into two halves, sorting them separately, and then merging the sorted halves.

    • Divide the array into two halves

    • Recursively sort the two halves

    • Merge the sorted halves

  • Answered by AI
  • Q2. Given a BST containing distinct integers, and a number ‘X’, find all pairs of integers in the BST whose sum is equal to ‘X’.
  • Ans. 

    Find pairs of integers in a BST whose sum is equal to a given number.

    • Traverse the BST and store the values in a hash set.

    • For each node, check if (X - node.value) exists in the hash set.

    • If yes, add the pair (node.value, X - node.value) to the result.

    • Continue traversal until all nodes are processed.

  • Answered by AI
  • Q3. Given a set of time intervals in any order, merge all overlapping intervals into one and output the result which should have only mutually exclusive intervals.
  • Ans. 

    Merge overlapping time intervals into mutually exclusive intervals.

    • Sort the intervals based on their start time.

    • Iterate through the intervals and merge overlapping intervals.

    • Output the mutually exclusive intervals.

    • Example: [(1,3), (2,6), (8,10), (15,18)] -> [(1,6), (8,10), (15,18)]

  • Answered by AI
  • Q4. What are the different types of hashing? Suggest an alternative and a better way for Linear Chaining.
  • Ans. 

    Different types of hashing and alternative for Linear Chaining

    • Different types of hashing include division, multiplication, and universal hashing

    • Alternative for Linear Chaining is Open Addressing

    • Open Addressing includes Linear Probing, Quadratic Probing, and Double Hashing

  • Answered by AI
  • Q5. Implement AVL Tree.
  • Ans. 

    An AVL tree is a self-balancing binary search tree where the heights of the left and right subtrees differ by at most one.

    • AVL tree is a binary search tree with additional balance factor for each node.

    • The balance factor is the difference between the heights of the left and right subtrees.

    • Insertion and deletion operations in AVL tree maintain the balance factor to ensure the tree remains balanced.

    • Rotations are performed ...

  • Answered by AI
  • Q6. Minimum number of squares whose sum equals to given number n.
  • Ans. 

    Find the minimum number of squares whose sum equals to a given number n.

    • Use dynamic programming to solve the problem efficiently.

    • Start with finding the square root of n and check if it is a perfect square.

    • If not, then try to find the minimum number of squares required for the remaining number.

    • Repeat the process until the remaining number becomes 0.

    • Return the minimum number of squares required for the given number n.

  • Answered by AI
  • Q7. Insertion sort for a singly linked list.
  • Ans. 

    Insertion sort for a singly linked list.

    • Traverse the list and compare each node with the previous nodes

    • If the current node is smaller, swap it with the previous node

    • Repeat until the end of the list is reached

    • Time complexity is O(n^2)

  • Answered by AI

Interview Preparation Tips

Round: Test
Experience: There were 2 coding questions (no penalty for wrong submission) and 20 Multiple Choice Questions(with negative marking). We were given 90 minutes to solve them. MCQs were based on Data Structures, OS, CN, C outputs, OOP etc.
Tips: Experience in Competitive Programming might help in solving coding questions. No constraints were mentioned and detailed Instructions related to problem were stated vaguely. So code carefully.
Duration: 1 hour 30 minutes
Total Questions: 22

Round: Technical Interview
Experience: The interviewer asked me to introduce myself and a brief introduction of the projects that I have done. She first asked me questions related to my project. After that she moved on to the data structures part.
Tips: Take your time to approach the problems and if the question is not clear ask the interviewer to explain it again.

Round: Technical Interview
Experience: The interviewer asked me about how my previous round went. After that, he asked me to introduce myself and a brief introduction of the projects that I have done. He first asked me a few questions related to my project. Then he moved on to the data structures part. In this round the interviewer gave me strict time limit for coding the solution on paper for each problem and as soon as I was done coding he gave me 2-3 minutes every time to find errors and debug my code.
Tips: Do not panic even if the interviewer sets time limit while solving problems. If the question is not clear ask the interviewer to explain it again.

College Name: The LNM Institute Of Information Technology, Jaipur

Skills evaluated in this interview

Interview Questionnaire 

6 Questions

  • Q1. Given a Linked list , print yes if it is palindrome else print no
  • Q2. Print the level order traversal of the binary tree in the spiral form
  • Ans. 

    Print the level order traversal of binary tree in spiral form

    • Perform level order traversal of the binary tree

    • Alternate the direction of traversal for each level

    • Use a stack to reverse the order of nodes in each level

    • Print the nodes in the order of traversal

  • Answered by AI
  • Q3. Maximum of all subarrays of size k(Expected Time Complexity O(N). Input : arr[] = {1, 2, 3, 1, 4, 5, 2, 3, 6} k = 3 Output : 3 3 4 5 5 5 6
  • Ans. 

    Find the maximum element in each subarray of size k in a given array.

    • Iterate through the array from index 0 to n-k.

    • For each subarray of size k, find the maximum element.

    • Store the maximum elements in a separate array.

    • Return the array of maximum elements.

  • Answered by AI
  • Q4. Given Two sorted array of size size n each. Find the Kth largest element in these two array (Expected Time Complexity Log(n))
  • Ans. 

    To find the Kth largest element in two sorted arrays, we can use the merge step of merge sort algorithm.

    • Merge the two arrays into a single sorted array using a modified merge sort algorithm.

    • Return the Kth element from the merged array.

  • Answered by AI
  • Q5. Website having several web-pages. And also there are lot many user who are accessing the web-site. say user 1 has access pattern : x->y->z->a->b->c->d->e->f user 2 has access pattern : z->a->b->c->d user 3...
  • Q6. Given two array , one of size m+n and contains m element and other position are empty , 2nd array is of size n and contains n element. both array are sorted , now merge the second array to first one such t...
  • Ans. 

    Merge two sorted arrays into one sorted array with expected time complexity of (m+n).

    • Use a two-pointer approach to compare elements from both arrays and merge them into the first array.

    • Start comparing elements from the end of both arrays and place the larger element at the end of the first array.

    • Continue this process until all elements from the second array are merged into the first array.

  • Answered by AI

Interview Preparation Tips

Round: Test
Duration: 90 minutes

Skills: Algorithm , OS, DBMS, data structure
College Name: NIT BHOPAL

Skills evaluated in this interview

Interview Preparation Tips

Round: Test
Experience: Coding questions were comparatively easy. There were three questions.1. Given a string map each character of which to the corresponding digit in a 10 digit mobile phone keypad.2. Don't remember, will add when it comes to my mind.3. Don't remember, will add when it comes to my mind.

Skills: Coding ability, Complete knowledge of working of internet.,
College Name: IIT Bombay

Interview Preparation Tips

Round: Test
Experience: Just 1 online test



Round - I (90 mins)



Online Test conducted @ HackerRank



a. M.C.Qs (Operating System + Aptitude + C Programming Language + Object Oriented Programming)



b. Programming (2 coding questions)The Online Exam started off after a brief Presentation on Amazon.





The MCQs were largely based on Operating System, Data structures and Algorithms, OOP concepts, C language and Aptitude.



Coding Questions



1. Determine whether a Linked List is a palindrome or not.



2. Given few sets of intervals print out the the entire intervals without overlapping , if they overlap then combine them into one.



Eg: Input : (5,7) (1 , 6) (2 ,4) (10 ,14) (8,9)



Output : (1,7) (8,9) (10,14)



Advice: Must solve at least 1 coding question to have a good chance for selection into the next round
Tips: CGPA holds importance because it is basic eligibility criteria for written test and then secondly it increases odds in your favor of your selection more than those with lower CGPA with same interview performance. Prepare a good resume



1. Prioritize your content



2. Put the most important information first (Academic Projects + Internship)



3. Proofread it twice



Advice : Do your best and leave the rest to god

Round: Test
Experience: Round II

2 Coding questions

1. Classic 2-sum problem

2. Given numbers a, b as the seeds for the Fibonacci sequence determine if a third number 'k' is a part of that sequence or not. (Tricky)
Total Questions: 2

Round: Other Interview
Experience: Round III
1. Tell me about yourself
2. Project + Internship Discussion
3. Compress a given string "aabbbccc" to "a2b3c3"
constraint: inplace compression, no extra space to be used
assumption : output size will not exceed input size

Round: Technical Interview
Experience: Round IV
1. Internship Project Discussion (30 mins)
2. Find the largest count of 0s in a row in a matrix of 0s and 1s sorted in an ascending order row-wise.
3. Replicate a tree with random pointers inplace

Round: Other Interview
Experience: Round V
1. Question related to graphs involving concepts of Depth and Height of a tree. (Took a lot of time in solving it ! but finally recognized the pattern)
2. Maximum size square sub-matrix with all 1s
3. Find the median of an infinite series of integers
4. Find the most popular Google searches. (solved it using Trie and Max-Heaps)
2 more questions but can't remember them.Finally after waiting for more than 9 hours the results were announced and I was selected
Tips: Be cool and always ask the interviewer questions at the end of the interview. Explain the interviewer your progress while solving the question so that you both are on the same page + its easier for him to understand. Behavioral and H.R.
Tips
1. Speak clearly and with confidence
2. Always prepare yourself beforehand for some common questions like:
a. Tell me about yourself.
b. Why should I hire you?
c. What are your strengths and weaknesses? (give examples)
d. What is your Dream Company?

General Tips: They judge you purely on the basis of your knowledge and performance during the face to face interviews. The extra curricular activities are not given much consideration as Amazon focuses its recruitment procedure purely on the basis of your Technical Knowledge. Prepare a good resume
1. Prioritize your content
2. Put the most important information first (Academic Projects + Internship)
3. Proofread it twice
College Name: NIT JAIPUR

Interview Questionnaire 

8 Questions

  • Q1. Given a n-ary tree. Devise an algo which determines the position at which the 3rd B is present from the given index in constant time complexity
  • Ans. 

    The algorithm finds the position of the 3rd occurrence of 'B' in an n-ary tree from a given index in constant time complexity.

    • Traverse the n-ary tree using a depth-first search (DFS) algorithm

    • Keep track of the count of 'B' occurrences

    • When the count reaches 3, return the current position

    • If the end of the tree is reached before the 3rd 'B', return -1

  • Answered by AI
  • Q2. Given a dictionary with limited words. Check if the string given to you is a composite of two words which are already present in the dictionary
  • Ans. 

    Check if a given string is a composite of two words from a limited dictionary.

    • Create a hash set of all the words in the dictionary.

    • Iterate through all possible pairs of substrings in the given string.

    • Check if both substrings are present in the hash set.

    • If yes, return true. Else, return false.

  • Answered by AI
  • Q3. Given a single linked list of certain nodes. Switch adjacent nodes. Eg. 1 2 3 4 will be 2 1 4 3
  • Ans. 

    Switch adjacent nodes in a single linked list.

    • Traverse the linked list and swap adjacent nodes.

    • Keep track of previous node to update its next pointer.

    • Handle edge cases for first two nodes and last node.

    • Example: 1->2->3->4 becomes 2->1->4->3.

  • Answered by AI
  • Q4. Given a binary search tree. Traverse only the left sub-tree
  • Ans. 

    Traverse only the left sub-tree of a binary search tree.

    • Start at the root node

    • If the left child exists, visit it and repeat the process

    • If the left child does not exist, return to the parent node

    • Continue until all nodes in the left sub-tree have been visited

  • Answered by AI
  • Q5. Implementation of AVL tree. I told solution in nlogn. He asked me optimize further
  • Q6. Write a program to test whether a string and all strings that can be made using the characters of that string are palindrome or not Input Output mmo True yakak True travel False
  • Q7. Next, I was asked to design an efficient data structure for two lifts in a building of n floors
  • Ans. 

    Design an efficient data structure for two lifts in a building of n floors.

    • Use a priority queue to keep track of the floors each lift is heading to

    • Implement a scheduling algorithm to determine which lift to assign to a new request

    • Consider adding a weight limit to each lift to prevent overloading

    • Use a hash table to keep track of the current location of each lift

  • Answered by AI
  • Q8. Given a Integer, find the maximum number that can be formed from the digits. Input : 8754365 output : 8765543
  • Ans. 

    To find the maximum number that can be formed from the digits of an integer.

    • Convert the integer to a string

    • Sort the characters in descending order

    • Join the sorted characters to form the maximum number

  • Answered by AI

Interview Preparation Tips

Skill Tips: They were looking for really cool coders. High expectation on accurate answers. looking for deep understanding of algorithms and data structures.
Skills: Algorithms, Data structures
College Name: PSIT

Skills evaluated in this interview

Tell us how to improve this page.

Interview Questions from Similar Companies

Amazon Interview Questions
4.0
 • 5.1k Interviews
American Express Interview Questions
4.1
 • 367 Interviews
RSPL Group Interview Questions
4.1
 • 196 Interviews
Sodexo Interview Questions
4.1
 • 165 Interviews
McDonald's Interview Questions
4.1
 • 125 Interviews
Future Group Interview Questions
4.3
 • 78 Interviews
Burger King Interview Questions
3.8
 • 72 Interviews
LOREAL Interview Questions
4.0
 • 59 Interviews
Pizza Hut Interview Questions
3.9
 • 43 Interviews
View all
Compare Whole Foods Market with

Amazon

4.0
Compare

Mahindra & Mahindra

4.1
Compare

American Express

4.1
Compare

Sodexo

4.1
Compare
Did you find this page helpful?
Yes No
write
Share an Interview