Flipkart interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Flipkart
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, Pointers, OOPS, Operating Systems, DBMS, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Have a thorough understanding of all core subjects.
Tip 2 : Practice coding questions from GFG and Leetcode.
Tip 3 : Go through previous interview experiences.

Application process
Where: Referral
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have a short concise resume.
Tip 2 : Mention all necessary skills and projects worked on.

Interview rounds

01
Round
Medium
Online Coding Test
Duration45 minutes
Interview date13 Oct 2020
Coding problem2

The first round was an online coding round with 2 coding questions to be solved within 45 minutes. Both the questions were based on basic DSA (data structures and algorithms).

1. Maximum Number of Ones

Moderate
20m average time
80% success
0/80
Asked in companies
Paytm (One97 Communications Limited)AmazonMicrosoft

You are given a matrix ‘M’ having dimensions ‘WIDTH x ‘HEIGHT’ and provided with an integer ‘N’. The matrix ‘M’ can take only binary values, i.e., 0 and 1. Your task is to find the “maximum number of ones” that the matrix ‘M’ can have such that every square sub-matrix of M of dimensions ‘N’ x ‘N’ has no more than ‘MAXONES’ ones.

Problem approach

I solved using an O(n+m) approach. Starting from first row and first column, go on incrementing col index until we find a 1. When 1 is found, update the answer and move on to the next row. Remember to take care of the edge cases.

Try solving now

2. Sort an array in wave form

Easy
10m average time
85% success
0/40
Asked in companies
GoogleFlipkartTech Mahindra

You have been given an unsorted array ‘ARR’.

Your task is to sort the array in such a way that the array looks like a wave array.

Example:
If the given sequence ‘ARR’ has ‘N’ elements then the sorted wave array looks like - 
‘ARR[0] >= ARR[1]’ and ‘ARR[1] <= ARR[2]’
‘ARR[2] >= ARR[3]’ and ‘ARR[3] <= ARR[4]’
‘ARR[4] >= ARR[5]’ and ‘ARR[5] <= ARR[6]’  And so on.
Note:
1. ‘ARR[0]’ must be greater than or equal to ‘ARR[1]’.

2. There can be multiple arrays that look like a wave array but you have to return only one.

3. We have an internal function that will check your solution and return 'True' in case your array is one of the solutions otherwise return 'False'.

Explanation

The given array ‘ ARR = { 4, 3, 5, 2, 3, 1, 2 } ’
The below figure is a visual representation of the given ‘ARR’ and you can see we can express ‘ARR’ in a waveform array because 
4>3 and 3<5 
5>2 and 2<3
3>1 and 1<2
And it follows the condition of wave array.

subsequence

Follow up:
Try to solve this problem in linear time complexity.
Problem approach

In this approach, we sort the given array, then swap all the adjacent elements of the array and we see array will loop like a wave form array.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date19 Oct 2020
Coding problem2

This was the first technical interview round. It was entirely based on DSA.

1. Number of Islands

Easy
0/40
Asked in companies
AdobeSamsungArcesium

You have been given a non-empty grid consisting of only 0s and 1s. You have to find the number of islands in the given grid.

An island is a group of 1s (representing land) connected horizontally, vertically or diagonally. You can assume that all four edges of the grid are surrounded by 0s (representing water).

Problem approach

The question boils down to finding the number of connected components in an undirected graph. Now comparing the connected components of an undirected graph with this problem, the node of the graph will be the “1’s” (land) in the matrix. 
BFS or DFS can be used to solve this problem. In each BFS call, a component or a sub-graph is visited. We will call BFS on the next un-visited component. The number of calls to BFS function gives the number of connected components. A cell in 2D matrix has 8 neighbors. So for each cell, we process all its 8 neighbors. We keep track of the visited 1s so that they are not visited again using a visited matrix.
Time Complexity : O(m*n) where m*n is the size of the given matrix
Space Complexity : O(min(m,n))

Try solving now

2. Pair sum in a BST

Easy
15m average time
80% success
0/40
Asked in companies
Paytm (One97 Communications Limited)MicrosoftFlipkart

You are given a binary search tree and an integer ‘S’. Your task is to find all the pairs of nodes in the BST which sum to the value ‘S’. If no such pair exists, then print -1 - 1.

Note:

You can use extra space of the order of not more than O(log n).

A binary search tree (BST) is a binary tree data structure which has the following properties.
• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.

Note:

1. All the elements of the Binary Search Tree are unique.
2. You can’t use the same node value/element of BST twice.
Problem approach

This problem can be solved using hashing. The idea is to traverse the tree in an inorder fashion and insert every node’s value into a set. Also check if, for any node, the difference between the given sum and node’s value is found in the set, then the pair with the given sum exists in the tree.
Time Complexity :O(n).

Try solving now
03
Round
Medium
Video Call
Duration50 minutes
Interview date22 Oct 2020
Coding problem2

This was the second technical interview round. It was entirely based on DSA. It started with a brief introduction and then we proceeded to the coding problems.

1. Next Greater Element

Moderate
20m average time
90% success
0/80
Asked in companies
FlipkartPhonePeInfosys

You are given an array arr of length N. You have to return a list of integers containing the NGE(next greater element) of each element of the given array. The NGE for an element X is the first greater element on the right side of X in the array. Elements for which no greater element exists, consider the NGE as -1.

For Example :

If the given array is [1, 3, 2], then you need to return [3, -1, -1]. Because for 1, 3 is the next greater element, for 3 it does not have any greater number to its right, and similarly for 2.
Problem approach

The brute force solution is to use two loops. The outer loop picks all the elements one by one. The inner loop looks for the first greater element for the element picked by the outer loop. If a greater element is found then that element is printed as next, otherwise, -1 is printed.
Time Complexity: O(N2) 
Auxiliary Space: O(1)

The above approach can be optimized using stack data structure. 
Steps :
Push the first element to stack.
Pick rest of the elements one by one and follow the following steps in loop. 
1. Mark the current element as next.
2. If stack is not empty, compare top element of stack with next.
3. If next is greater than the top element, Pop element from stack. next is the next greater element for the popped element.
4. Keep popping from the stack while the popped element is smaller than next. next becomes the next greater element for all such popped elements.
• Finally, push the next in the stack.
• After the loop in step 2 is over, pop all the elements from the stack and print -1 as the next element for them.

Try solving now

2. Flip Bits

Easy
15m average time
85% success
0/40
Asked in companies
InfosysFlipkartMyntra

You are given an array of integers ARR[] of size N consisting of zeros and ones. You have to select a subset and flip bits of that subset. You have to return the count of maximum one’s that you can obtain by flipping chosen sub-array at most once.

A flip operation is one in which you turn 1 into 0 and 0 into 1.

For example:
If you are given an array {1, 1, 0, 0, 1} then you will have to return the count of maximum one’s you can obtain by flipping anyone chosen sub-array at most once, so here you will clearly choose sub-array from the index 2 to 3 and then flip it's bits. So, the final array comes out to be {1, 1, 1, 1, 1} which contains five ones and so you will return 5.
Problem approach

I solved it using Kadane's Algorithm.

Try solving now
04
Round
Easy
HR Round
Duration30 minutes
Interview date23 Oct 2020
Coding problem1

The Final Round of the process was a Hiring Manager round, which was taken by an Engineering Manager.

1. Basic HR questions

Where do you see yourselves in 5 years? 

What is your strength and weakness?

 How did I grow technically and personality wise in the last 3 years?

Problem approach

Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the work environment etc.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

Which SQL clause is used to specify the conditions in a query?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Flipkart
1992 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 2 problems
Interviewed by Flipkart
1638 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Flipkart
2097 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 4 problems
Interviewed by Flipkart
1118 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15292 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15116 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10047 views
2 comments
0 upvotes