i
Flipkart
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Machine coding round with 3 hours to make UI for a given problem statement
Top trending discussions
I appeared for an interview before Sep 2020.
Round duration - 120 minutes
Round difficulty - Medium
10 min for debugging
40 min for problems(coding)
40 min for pyschometric
30 min for aptitude
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...
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 ...
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 ...
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
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.
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...
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...
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.
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.
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
Tip 1 : KEEP RESUME SHORT(1 PAGE)
Tip 2 : DONT BLUFF IN RESUME SINCE MY INTERVIEWER ASKED ME LOOKING FROM IT
I appeared for an interview before Sep 2020.
Round duration - 60 minutes
Round difficulty - Easy
There was 2 coding questions
Based on ds and algorithms
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...
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,
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).
A Binary Search Tr...
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
Round duration - 60 minutes
Round difficulty - Easy
There was 2 coding questions based on ds and algorithms
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[...
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.
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...
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.
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.
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...
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).
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
Tip 1 : Mention your skills in which you are perfect
Tip 2 : Mention atleast two projects
I appeared for an interview in Sep 2020.
Round duration - 90 Minutes
Round difficulty - Easy
Two coding questions were asked and 90 minutes of time was allotted to solve both the problems
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
.
The first line ...
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.
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...
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.
Round duration - 60 Minutes
Round difficulty - Medium
The duration was approx 1 hour. The interview was taken by a young SDE-2.
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.
S : abcdg
1...
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.
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 ...
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.
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.
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...
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
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 ...
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'
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)
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.
...
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.
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.
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.
The first line contains an in...
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.
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...
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.
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.
Tip 1 : You should have good projects to showcase.
Tip 2 : Keep it clean and simple.
I appeared for an interview before Sep 2020.
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
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...
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
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...
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 ...
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.
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.
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.
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...
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...
Round duration - 60 minutes
Round difficulty - Medium
9th July 2020
6:30PM to 7:30PM
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.
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...
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
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
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...
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 ...
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
Tip 1 : Mention projects and internships.
Tip 2 : Keep your resume short and crisp.
I appeared for an interview in Aug 2017.
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
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.
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)]
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
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 ...
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.
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)
I appeared for an interview before Dec 2020.
Round duration - 60 Minutes
Round difficulty - Medium
This round was purely based on Data Structures and Algorithms . One has to be fairly comfortable in solving Algorithmic problems to pass this round . Both the questions asked were quite common and luckily I had already prepared them from CodeStudio and LeetCode.
Given a Binary Tree with 'N' nodes, where each node holds an integer value, your task is to compute the In-Order, Pre-Order, and Post-Order traversals of the binar...
Compute the In-Order, Pre-Order, and Post-Order traversals of a Binary Tree given in level-order format.
Implement functions to perform In-Order, Pre-Order, and Post-Order traversals of a Binary Tree.
Use level-order input to construct the Binary Tree.
Traverse the Binary Tree recursively to generate the required traversals.
Ensure proper handling of null nodes represented by -1 in the input.
Return the three traversals as
Given a Singly Linked List of integers, your task is to reverse the Linked List by altering the links between the nodes.
The first line of input is an intege...
Reverse a singly linked list by altering the links between nodes.
Iterate through the linked list and reverse the links between nodes
Use three pointers to keep track of the current, previous, and next nodes
Update the links between nodes to reverse the list
Return the head of the reversed linked list
Round duration - 45 Minutes
Round difficulty - Medium
This round basically tested some concepts from Data Structures and File Manipulation .
Given two arrays A
and B
with sizes N
and M
respectively, both sorted in non-decreasing order, determine their intersection.
The intersection of two arrays in...
The problem involves finding the intersection of two sorted arrays efficiently.
Use two pointers to iterate through both arrays simultaneously.
Compare elements at the pointers and move the pointers accordingly.
Handle cases where elements are equal and update the intersection array.
Return the intersection array as the result.
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
I appeared for an interview before Jan 2021.
Round duration - 60 minutes
Round difficulty - Easy
Two coding questions were given in the first round to be solved in 60 minutes.
Given an array A
containing 'N' integers and an integer m
, rearrange the elements of the array such that the differences between the array elements and m
are sor...
Rearrange array elements based on their differences from a given integer.
Calculate the differences between each element and the given integer.
Sort the elements based on their differences while maintaining the original order for elements with the same difference.
Implement a function to rearrange the array elements as per the given criteria.
Given an arbitrary binary tree, a node of the tree, and an integer 'K', find all nodes that are at a distance K from the specified node, and return a list of th...
The task is to find all nodes in a binary tree that are at a distance K from a given node.
Traverse the binary tree to find the given node
From the given node, perform a depth-first search to find all nodes at distance K
Use a list to store the values of the nodes at distance K
Return the list of values in any order
Round duration - 60 minutes
Round difficulty - Easy
This was a technical round with questions based on DSA, DBMS, Computer Networking and project based questions.
Ninja is tasked with printing a triangle pattern based on a given number 'N' for any test case.
N = 4
1
232
34545
4567654
The pat...
Print a triangle pattern of numbers based on a given number 'N'.
Iterate through each row and print the numbers accordingly
Use spaces to center-align the numbers in each row
Increment the numbers in each row as per the pattern
Web server serves static content over HTTP, while application server runs dynamic content and business logic.
Web server handles HTTP requests and responses, serving static content like HTML, images, and CSS.
Application server executes business logic, runs dynamic content, and interacts with databases.
Web server examples include Apache, Nginx, while application server examples include Tomcat, JBoss.
Web server focuses on...
The internet is a global network of interconnected computers that communicate using standardized protocols.
The internet is made up of a vast number of interconnected networks of computers.
Data is transmitted over the internet using protocols such as TCP/IP.
Websites are hosted on servers connected to the internet, and users access them using web browsers.
Internet Service Providers (ISPs) provide access to the internet f...
SQL query to find the nth highest salary
Use the 'SELECT DISTINCT' statement to get unique salary values
Order the salaries in descending order using 'ORDER BY' clause
Use 'LIMIT' and 'OFFSET' to get the nth highest salary
Round duration - 30 minutes
Round difficulty - Easy
Typical HR round with behavioral problems.
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
I applied via Campus Placement
Regex for email validation
Start with a string of characters followed by @ symbol
Followed by a string of characters and a period
End with a string of characters with a length of 2-6 characters
Allow for optional subdomains separated by periods
Disallow special characters except for . and _ in username
Print prime numbers in a given range and optimize the solution.
Use Sieve of Eratosthenes algorithm to generate prime numbers efficiently
Start with a boolean array of size n+1, mark all as true
Loop through the array and mark all multiples of each prime as false
Print all the indexes that are still marked as true
Find angle between hour and minute hand in a clock given the time.
Calculate the angle made by the hour hand with respect to 12 o'clock position
Calculate the angle made by the minute hand with respect to 12 o'clock position
Find the difference between the two angles and take the absolute value
If the angle is greater than 180 degrees, subtract it from 360 degrees to get the smaller angle
To un-hash a string, use a reverse algorithm to convert the hash back to the original string.
Create a reverse algorithm that takes the hash as input and outputs the original string
Use the same logic as the hash function but in reverse order
If the hash function used a specific algorithm, use the inverse of that algorithm to un-hash the string
based on 1 interview
Interview experience
Senior Executive
2.6k
salaries
| ₹2 L/yr - ₹9 L/yr |
Team Lead
1.8k
salaries
| ₹1.2 L/yr - ₹10 L/yr |
Operations Executive
1.8k
salaries
| ₹1.2 L/yr - ₹6.3 L/yr |
Assistant Manager
1.6k
salaries
| ₹6 L/yr - ₹21 L/yr |
Executive
1.3k
salaries
| ₹1.2 L/yr - ₹7 L/yr |
Amazon
Myntra
Snapdeal
Meesho