Professional Documents
Culture Documents
GFG Flipkart Questions
GFG Flipkart Questions
GFG Flipkart Questions
This article is powered by TopTalent.in A high end Job portal for students and alumni of Premier
Colleges in India. Sign up now for free exclusive access to top notch jobs in India and abroad. Get in
touch with them via facebook, twitter or linkedin. If you like GeeksforGeeks and would like to contribute,
you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article
appearing on the GeeksforGeeks main page and help other Geeks
=>
5
5
/
1
/\
1 5
2
\
=>
Not superimposable
(3) Given a review paragraph and keywords, find minimum length snippet from paragraph which contains
all keywords in any order.
(4) Extended question 3 if there are millions of review, what preprocessing step would you do.
Coding Round: (1 hour 30 minutes)
Given list of expressions:
a = 10
b = a++
c=a+b
d = c*b + a*c
Print out value of last variable (in our example, it is d). First illustrate algorithm and then code in 1 hour.
Managerial Round: (1 hour)
Designing of all previous products I have worked on.
Design Round: (1 hour)
Design Snake and Ladder game.
Expose api to outer world.
Build following from exposed api:
(1) iOS app
(2) Web app
(3) Desktop app
HR Round: (15 minutes)
Why would you join Flipkart if you would have offer from Google and Facebook?
Why you want to join Flipkart?
After few days I received offer. Thank you Geeks as reading geeksforgeeks was wonderful and great
learning experience and helped in preparation for interview.
Many Many congratulations to the Author. If you like GeeksforGeeks and would like to contribute, you can
also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on
the GeeksforGeeks main page and help other Geeks.
groups can be accumulated in bus. After coming back from the tour, each group in the bus will again wait
in the queue at the bus-stand. Bus-driver earns a rupee for each person travelled. You have to find the
earning of the bus driver after R rounds.
For example :
Number of groups G = 4
Group size for each group : 2 4 3 5
Bus capacity : 7
Number of rounds R : 4
2 Multiple roots
3 More than two children
Output :
Indicate the error (considering the priority) in case of any error and exit the program.
Print the tree structure in the bracket notation in case of no errors.
(e.g. (A(B(D)(E))(C(F)(G))) .. Here A is root. B and C are children of A. D and E are children of B. F and G
are children of C.)
Coding round 2 (1 hour) :
Design and code the sudoku solver.
Coding round 3 (on skype) (1 hour 15 minutes) :
There were two problems.
1) A document and a list of words are given. You have to find minimum length window in the document
where all the words can be found.
2) 2-D matrix is given where each cell represents height of cell. Water can flow from cell with higher height
to lower one. A basin is when there is no cell with lower height in the neighbours
(left,right,up,down,diagonal). You have to find maximum size basin block.
Example :
999877
887778
888777
888999
888777
445555
555667
555886
Here there are two basins.
999877
887778
888777
888999
888777
445555
555667
555886
Maximum basin block size : 8
HR+Technical interview (on skype) (1 hour)
HR questions (strengths, weaknesses, why flipkart ?, what kind of env. you like for work ? etc.)
Projects (I explained 2 projects from start to end. They asked me challenges and how you dealt
with them etc.)
Multithreading and its examples
1. Given an array of n distinct integers sorted in ascending order. Find an index i s.t ar[i] = i. Return -1 if
no such index exists. Note that integers in array can be negative.
2. Design a stack which holds an integer value such that getMinimum() function should return the
minimum element in the stack.
FOLLOW UP: Implement popMin() function which would pop minimum element from the original stack.
O(1) implementation was required.(Hint: Use LinkedList to implement stack and store address of minimum
element node in min-stack)
3. Print an organisational hierarchy.
Naveen manages Satish
Satish manages Anushree
Satish manages Sandeep
Gurinder manages Naveen
Gurinder->Naveen
Naveen->Satish
Satish->Anushree,Sandeep
Anushree->
Sandeep->
1. Given an array which is first strictly increasing and then strictly decreasing. Find an element in this
array.Discussions on various approaches and their complexities.
After these two rounds, I was called for Face-2-Face discussions in Bangalore. There I had 4 rounds.
1. Given a sorted and rotated array. Find an element in this array.(Famous Problem)
2. This was an interesting problem. Given a set of intervals like 5-10, 15-20, 25-40, 30-45, 50-100. Find
the ith smallest number in these intervals.
Assume there are no duplicate numbers.
e.g: 1st smallest number = 5
6th smallest number = 10
7th smallest number = 15 and so on.
I told him that we would first sort the interval on basis of starting numbers. Then merge overlapping
intervals to get a set of non-overlapping intervals like 5-10, 15-20, 25-45, 50-100. Now we can find the ith
smallest number after finding the appropriate interval.
FOLLOW UP: He then modified this question to accomodate duplicate numbers also.
Suppose we have intervals like 5-10, 8-12.
Then total numbers in these two intervals would be: {5,6,7,8,8,9,9,10,10,11,12}
So, 1st smallest number: 5
4th smallest number: 8
5th smallest number: 8 (here is the
change since now we have duplicate elements also) and so on.
3. Given a dictionary of 50,000 words. Given a phrase without spaces, add spaces to make it a proper
sentence.
e.g:input: thequickbrownfoxjumpoverlazydog
output: the quick brown fox jump over lazy dog
FOLLOW UP Questions:
1) Worst case complexity of finding a word in HASHMAP given we have B buckets and total of
50,000 words. ( Ans: O(50,000/B) )
2) Complexity of finding a word in TRIE. (Ans: O(Word Length) )
3) Advantages of TRIE over HASHMAP and some similar discussions.
Round-5: Hiring Manager Round(45 mins)
common HR questions like why Flipkart, Why should we hire you etc.
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article
to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help
other Geeks.
Company: Flipkart
Profile: SDE 1
Experience: 7 months
Round 1: Online Coding Exam (2 hour on interviewstreet)
(Need to pass 4 test cases + if time permits 4 hidden test cases)
Q.) There are two strings s1 and s2. Find the maximum of percentage word matching from s1 to s2 and
s2 to s1.
Where, percentage word matching= (Total words matched in s2/total number of words in s1) *100
Round 2: 1st Telephonic interview
Q1) Generate all numbers in ascending order which are having factors as 2,3 and 5. Discuss various
approaches.
Q2) Check whether given Binary Tree is a Binary Search Tree. Discuss various approaches.
Q3) I dont remember
Round 3: 2nd Telephonic interview
Q1) some scenario interviewer described on phone had to identify data structure to model it and algorithm
to solve. Data structure used: Graph and algorithm used: Topological sort
Q2) Given N meeting with their start time s1, s2 .sn and end time e1, e2 .en and K rooms. How to
schedule maximum of N meetings in k rooms. (Concept: Interval partitioning using greedy approach).
Called for onsite interview. All expenses flight, hotel, cab etc..were taken care by company.
Round 4: 1st f2f interview (Machine Coding round) (1hour 10 min)
Given a string regex and another string pat find whether the pattern is acceptable against given regex
string.
Regex string contains following characters and special characters:
1. Normal alphabets a to z and A to Z
2. $ all string should end with all characters preceding $
Example:
Regex :abc$ ,
Pattern: abcd(Not acceptable) , abc(acceptable), ab(Not acceptable), dhfusdhabc(acceptable) etc..
3. ^ all string should start with all characters exceeding ^
Example: Regex : ^abc
Pattern: abcd(acceptable) , abc(acceptable), ab(Not acceptable), dhfusdhabc(NOT acceptable) etc..
Regex: ^ then only pattern acceptable is null.
4. . any character can be mapped to dot except null
Example 1: Regex : .abc
Pattern: Zabc(acceptable) , abc(NOT acceptable), ab(Not acceptable), habc(acceptable) etc..
Example 2: Regex :a.bc
Pattern: abc(NOT acceptable) , aXbc(acceptable), ab(Not acceptable), habc(NOT acceptable) etc..
5. *-the character just preceding * can be repeated n time where (n>=0)
I recently attended Flipkart interviews(off campus). I would like to share my experience with everyone.
Round 1 : Telephonic Interview
1) Print the left view of a tree.
2) Given set of words that are lexographically sorted, find the grammar.
Eg:
abc
acd
bcc
bed
bdc
dab
The order of letters for the given example would be
a->b->c->e->d
Round 2: Telephonic Interview
1) Find the largest basin size in a given matrix.
999888
888777
777777
888899
555563
555333
For the above example, the highlighted values form the maximum size basin.
2) Given a sentence and a set of characters. Find the minimum window within which the set of characters
can be found in the sentence in any order.
3) In a client-server architecture, there are multiple requests from multiple clients to the server. The server
should maintain the response times of all the requests in the previous hour. What data structure and algo
will be used for this? Also, the average response time needs to be maintained and has to be retrieved in
O(1).
The HR sent a mail within 2 days that I was shortlisted for the onsite interviews.
They arrange flight travel to Bangalore, cab facility and accommodation if required.
In-House Round 1: Coding Round (2 hours)
I was asked to write code to parse an XML and do the following options by not hardcoding any value.
1) Validate the XML.
2) Given a level number, print all values of tags in the same level.
3) Search
a tag name for a given value
for value of any tag given a value of tag at any sub levels.
First there was discussion as to how to go about the problem and the algorithm. Then 1 hour for coding
the solution. Finally the code was evaluated and some extensions to the solutions were discussed
In-House Round 2: Hiring Manager (45 mins)
The Hiring Manager was on leave and hence had the interview via phone. This round was a cultural fit
round. The manager checks whether we will fit into the companys work environment. Few questions like,
1) Some unix commands since they work extensively on UNIX platforms.
2) Achievements.
3) Details on previous projects.
4) Most challenging situation.
5) Estimations that need to be done for a project and considerations
Some more questions like these.
In-House Round 3: PS & DS Algo (1 hour)
1) Merge k sorted arrays.
2) Given a tree with edge weights, find any path in the tree with maximum sum of edges.
3) Given a maze, a start point and end point find the shortest path to reach the end point from the starting
point.
4) Given a polygon and a point, find whether the point lies within the polygon or not.
We can roll the dice, as we want to. Need to find the shortest path to reach the 100 level from the starting
of the path. Various other questions were asked on the basis of that only.
2. Given a file with millions of words, need to find top K words on the basis of occurrence.
2nd Telephonic
1. Given a list a1,a2,a3.an. Comparison between elements is given like a1>a2, a3>a5, a4>a2..etc.
We need to find whether is there any situation that we can sort the list in to the ascending order on the
basis of comparison. Yes or No , explain the conditions
2. Given a string example : shoppingwithflipkartiseasy, Now we are given this string and a dictionary
containing valid words , now we need to break the sentence into words separated by space. Output :
shopping with flipkart is easy
Onsite
Coding Round
1. Need to write a fully functionally and working code for a problem statement. Problem is to write the
code for maintaining a directory for any organization where employee will have id, name, post and
manager as attribute. Basically two features need to be implemented: (a). Should be able to do searching
on the basis of name, prefix search for the name should also be supported, (b). For any employee, we
can get the list of all the subordinates which comes under him/her, like for ceo , all the employees list
should get displayed
2. No database is needed, memory storage was asked to used for this
3. Code should be extendable so that new attributes for the employee can be added
4. Approach for maintaining the structure and optimality in searching for required.
Face to Face
1. Given a file containing billions of words, need to find top K words. Other variations like the file size is
100 MB and we can read only a chunk of data at a time, how to maintain that, etc
2. Given a series 2,3,4,5,6,8,9,10,, here in this series all the numbers are present which have factors
only and only either 2,3 or 5. Need to write a node to generate nth number for the series . With best
approach and complexity
3. Given a Alien language, we have the dictionary of that language , but we have only very few words, but
they are all arranged in the lexicographical order. We need to first find whether we will be able to get a
alphabetical order or not, if yes explain approach
1. Most of the questions are on the cultural fit only, but they were tough
2. Situational and behavioural questions he asked, positive attitude and calmness is really required at that
time.
3. I also asked many questions regarding work and etc.
2. Design a contact list for a cell phone which can add & search really quick and is scalable.
Machine coding round
1. Write a program which should create a parse tree, find invalid query and do some optimizations.
Input: fist line contains the list of columns. There will be subsequent lines which will contain the query as
follows.
EMP_ID, EMP_NAME, EMP_DEPT, EMP_AGE
ONSITE INTERVIEWs
1. Design a Synchronized Message broker queues. How will you handle various situations like one queue
is down, automatic failover, active master selection, handling acked and unackedmessages.
2. Design a site like book my show. It was an open ended question so I concentrated on inventory
management. List all entities, classes objects modules and their interactions.
3. Design a secure Card storage system. Again open ended but the concentration was on encryption and
decryption
4. HR round. What are your strength and weaknesses, what did you do that made you happy. What was
your best contribution till date.
5. Design a Traffic signal . List all entities and classes involved. How will you handle pedestrian crossings
etc.
6. Design a game of tic tac toe, handling winning situation etc. NXN, multiplayer, multiplayer with
synchronization, Disaster recovery, data analytics, SWOT of each approach.
12
34
And hence, the reverse level order traversal is
34
12
0
Telephonic Round 1
=====================
1. Find the square root of a given integer. e.g 27 output should be 5, for 32 output should be 6.
2. Given a 2D matrix of integers find the maximum sum path in the matrix.
Telephonic Round 2
=====================
1. Given a number n, find the largest number small than having the same digits as of n. E.g. 231 output
will be 213.
2. Given a long stream of numbers find the largest k numbers at any given point.(I told him I know the
question and told the solution, he moved on).
3. Given k arrays of sorted integers, find the minimum range which contains the number from each of the
k arrays.
e.g. {-1,4,7},{5,9,15,23},{8,24,25,31} output should be 2 range of {7,8,9}
4. Given a binary tree find all the nodes at k distance from a given node.
F2F-R1 Machine Coding Round
============================
1. Create an employee database structure in which Employee has id,name,manager. Three functionalities
required were
a) Given any id return all the employee details
b) Given any name(or id) list all the subordinates of the given employee.
c) Given a name search with prefix search property.
45 minutes of time was given and running code was asked. Interviewer first asked the approach and then
after coding he reviewed the code thoroughly.
F2F-R2 Data Structure and Algorithm
====================================
1. Given a list of words and a 2D matrix(of characters) find all the valid words(present in the given list)
which are possible inside the given matrix.
Words can be formed in all 8 directions from a given cell.
First discussion about approach and then implementation of the logic.
2. Given a binary tree serialize the tree such that it can be retrieved in the same form again.
3. Given a double linked list with one pointer pointing to the next node and the other pointer to any
arbitrary node in the list, duplicate the given linked list.
F2F-R3 Hiring Manager
======================
1. Introduction about the organization and the work being done.
2. My introduction and the work done by me.
3. Asked some of the new ideas ( wow!!!!! features ) which can be implemented in the smart phone.
4. Few other general questions.
F2F-R4 Design Round
====================
1. Design the Tic-Toe game for a smart phone. Discussion about the class diagrams, structure of the
code, code flow, abstraction of code and functionalities.
2. Interviewer asked the approach to implement the above in android.
3. Various android questions.
F2F-R5 Hiring Manger + Reporting Manager
=========================================
Hiring manager was on leave so this happened after a gap of one month after R4.
1. Introduction about work.
2. I asked various questions about work and my role.
3. Design a mobile cab booking application (just screens and functionalities) on board. Asked questions
about the things which I missed during the design.
And what all requirements are needed to before the application goes in development phase.
E.g SSSNEEEW
output EESS
2. A sender will send a binary string to a receiver meanwhile he encrypt the digits. You are given a
encrypted form of string. Now, the receiver needs to decode the string, and while decoding there were 2
approaches.
First, receiver will start with first character as 0; S[0] = 0, P[1] = S[1] + S[0], P[2] = S[2] + S[1] + S[0] and
so on.
Second, Receiver will start with first character as 1; S[0] = 1, P[1] = S[1] + S[0], P[2] = S[2] + S[1] + S[0]
and so on.
You need to print both the strings, after evaluation from both first and second technique. Uf any string will
contain other that binary numbers you need to print NONE.
Input1; 0123210
Output: 0111000
NONE
explanation for NONE S[0] = 1, P[1] = S[1] + S[0] so S[1] = 0
P[2] = s[2] + S[1] + S[0] , S[2] = 1
P[3] = S[3] + S[2] + S[1], S[3] = 2, not a binary character so NONE
Machine Coding Round (on Interview Street)
There was only one question, time limit 45mins
Q1. Word Wrap problem with few conditions, even i didnt remember much conditions here are some
conditions.
i) there can be maximum of X characters in a single line.
ii) there can be maximum of Y number of spaces in the end of the each single line.
iii) if a string length is big enough, so that it cannot be printed in single line, use - in the end of the line
and print string further in the different line.
also there should not be consecutively in the end, if the string contains already - in the end dont put -
character.
E.g. flip-kart and if x = 5 so it should be ->
flipkart
iv) the string should not start with these characters(. , , )
v) the cost value should be minimum, there can not be multiple answer for a single string.
Eg. This is a flipkart online programming test.
x = 10 Y = 3
Output
This is a
flipkart
online programming
test.
First Technical Interview (F2F)They asked me about myself, so i gave my brief intro to them(there were 2 people who were taking the
interview)
and then they asked me about, what coding practices you used to do.As i dont do much coding online so i
gave told them truely that only Codeforce and Spoj
After that they started my interview, that what is the approach that you had used in the Machine Coding
Round and how you implemented and why you uses this type of technique.
My approach was Greedy.
Further they asked me what Data Structure you Know, how you use it some basic questions.
Later they asked me to print vertical nodes together in the binary tree, he asked me why you used
Recursion in the solution.
After that they asked me a question, which was
you are given an array(say C) of characters and an array(say M) which contains the indexes of the array
of characters.
We started moving elements of array(C) according to the position of indexes given in the array(M).
e.g. array A a b c d e f g
array M 1 4 3 5 0 2 6
so array A will change in first to e a f c b d g
again applying same b e d f a c g
again applying a b c d e f g
so after 3 times we got the same sequence of characters.
He wants minimum number of times modification on the array (A) so that the we will again reach to the
initial order.
I gave him first recursive solution, then he says optimize it and after that i gave him O(n) solution; the logic
for the problem came to me from Inplace Transpose of Matrix
the question is like -> http://www.codechef.com/JULY14/problems/SGARDEN/
After this he asked me a question on Next Greater Element, he wants how many ways i can handle this
question.
I told him 3 approaches- 1.O(n^2) 2.O(nlogn) 3.O(n)
He asked me about AVL tree, how you will implement it and then said you have final interview in early
morning
Technical + HR interview(F2F)
In this round, first they asked me about myself while studying My Resume
So they started asking some questions on LINUX like what is gdm but i said sir didnt know much about
linux.
further they asked me how to debug the code, and what is segmentation fault, memory leak and how you
will find the segmentation fault in 5000lines of code.
after that they asked me about my projects, why this project how you did it they grilled me in every
step.. why this why not this and all..
after that he wants some optimization to be performed on the project.
After this they asked me some questions on stack while putting pressure of time that you have 2mins for
this question.
E.g SSSNEEEW
output EESS
2. A sender will send a binary string to a receiver meanwhile he encrypt the digits. You are given a
encrypted form of string. Now, the receiver needs to decode the string, and while decoding there were 2
approaches.
First, receiver will start with first character as 0; S[0] = 0, P[1] = S[1] + S[0], P[2] = S[2] + S[1] + S[0] and
so on.
Second, Receiver will start with first character as 1; S[0] = 1, P[1] = S[1] + S[0], P[2] = S[2] + S[1] + S[0]
and so on.
You need to print both the strings, after evaluation from both first and second technique. If any string will
contain other that binary numbers you need to print NONE.
Round 2(Machine Coding Round):
There was only one question, time limit 45mins
Q1. Word Wrap problem with few conditions, even i didnt remember much conditions here are some
conditions.
i) there can be maximum of X characters in a single line.
ii) there can be maximum of Y number of spaces in the end of the each single line.
iii) if a string length is big enough, so that it cannot be printed in single line, use - in the end of the line
and print string further in the different line.
also there should not be consecutively in the end, if the string contains already - in the end dont put -
character.
E.g. flip-kart and if x = 5 so it should be ->
flipkart
iv) the string should not start with these characters(. , , )
v) the cost value should be minimum, there can not be multiple answer for a single string.
Eg. This is a flipkart online programming test.
x = 10 Y = 3
Output
This is a
flipkart
online programming
test.
Question 1: Powers of 5
http://community.topcoder.com/stat?
c=problem_statement&pm=12155&rd=15177&rm=314191&cr=22639266
Same question with modified language.
Question 2: Apllication of DFS/BFS
You were given a directed graph with n nodes. Given graph was connected. If there is an edge from u to v
then u depends on v. Our task was to find out the sum of dependencies for every node.
Example:
For the graph in diagram, A dependencies: C,D i.e. 2
B dependencies: D i.e. 1
C dependencies: D i.e. 1
And D depends on none.
Hence answer=0+1+1+2=4.
Example:
123456789
987654321
Output:
0 ==> 1111111110
1 ==> -864197532
2 ==> 1219326313718945259
Few cases were checked specifically:
1) Output of 132-132 must be 0 not 000.
2) 2 122222000002 should produce -122222000000 i.e either a or b can be the bigger string.
3) Negative input should be handled. Result of -2+202 = 200.
4) 1000000000 1 = 999999999 i.e. resulting answer can be of different length.
# ).
Round 4 : Technical + HR
Time : 1 Hour
1) Introduction.
2) Asked everything about my project every minute detail, even I was asked to write code for few sections
of my code i.e. how I implemented those features.
3) Asked few questions on teamwork that how would I handle particular situations.
I gave the interviewer a recursive solution. The I was asked to code it. After that I was asked whether I
could optimize the code further. I could not.
2- Given a lane where there are various houses each containing a fixed amount of gold. Now a robber has
to rob the houses such that when he robs a house the adjacent one cannot be robbed.Calculate the
maximum amount of gold collected by him.(Classic Dp question).
3- Given 1000 elephant ,none of whom exact heights are known, there are statements given which will be
of two forms
3.i-E_i is taller than E_j
OR
3.ii-E_i is smaller than E_j
Hi, I was interviewed at Flipkart few days back. I was contacted by one of their head hunters. The process
was as follows :
2 Telephonic interview
1 Machine Coding Round
1 Problem Solving Round
1 Hiring Manager Round
Last 3 rounds were at their office.
Telephonic-1 :
He asked about my previous projects in detail and then asked one problem.
Find the next smallest palindrome give a number. He asked me to write the complete working code.
Telephonic-2 :
Started straight away with the problems.
1. Find the median of a stream of integers. I knew the solution and discussed the heap solution for it.
2. Given an array of integers, find a triplet having sum equal to K.
3. Given an array a1, a2, a3 . ,an, b1, b2, b3, bn. Rearrange this array to a1, b1, a2, b2, .an,bn.
This needs to be done inplace.
Onsite Rounds (f2f)
Machine Coding Round :
This was the most exciting round. Problem was to do 3 operations on very large numbers.
1. Addition 2. Subtraction 3. Multiplication
Input can be positive or negative. In this round, focus was on Design and Coding Skills.
I was given 1 hr 30 mins to code for the problem. I completed in around 1hr 15 mins. Then he asked me
extend my code for decimal numbers as well. I told him the approach. Then he asked me how will i do the
division as well.
Problem Solving Round
In this round he started with the discussion of Machine round problem. Then he asked me a simple
problem. Find the first occurrence of a digit(1-9) other than zero in a stream of integers in less than o(n).
Given i cant have the access to the memory location where stream is written.
He basically wanted to know how i think and how many approaches i can think of, and whether i can
challenge him or not that its not possible. and yes i did.
Then he asked a stock span problem. Given stock prices in an array. Find the buying and selling time so
that profit earned is maximum.
Thats all for now. If i can remember more questions, then I will definitely write to you.
I think apart from the technical knowledge being a fast learner and persistence is important. Also a very
important thing seen in Flipkart is the sense of ownership everyone has. No matter what designation a
person is at.
TopTalent: Whats your advice to students who are aspiring for similar kind of achievement?
The usual technical knowledge and knack for problem solving. The interview at Housing was pretty
straightforward. It was mostly based on the work done in Flipkart. And a few puzzle solving.
Hint: Problem can be boiled down to snake&ladder problem, where forward pointer is a ladder &
backward pointer is a snake.
2) N people are there.
knows(A,B) return true if A knows B, else false.
Celebrity: A is called a celebrity
If A knows none
Everyone knows A
Get celebrity, with less number of knows() method usage.
3) Dictionary of words is given
i.e. [cat, dog, rat, catratdog, catter]
Compound word: A word, which can be split into more than 1 valid words
get compound word, with longest string length.
4th round (Design)
Design notification system (notify the customer with a message)
Client (delivery boy, company updates etc)
Services (Email, SMS, Watsapp)
Scaling up, fault tolerance & failure management
Flexible modifiability of clients & services
5th round(Senior Manager)
1) His info & organization profile
2) My intro
3) Exciting tasks that did at job? Discussion technically
4) Strengths & weaknesses
5) Feedback to the manager, how an ideal manager should be?
6) Why flipkart?
6th round (HR casual)
1) How is the day, how are the interviews?
2) Any offers?
3) Compensation expected?
Hosted on : cocubes.com
Time : 90 mins
No objective questions.
Two coding questions only. We have to complete the function only.
Ques:
Given a mxn grid, each of its element be either ., R, G or B,
where . -> empty, R -> Red, G -> Green, B -> Blue
A Blue strip has width 1 and length greater or equal to one.
A Red strip has length 1 and width greater or equal to one.
If a Red strip and a Blue strip overlaps, the overlapped portion will become G.
Find the minimum number of strips required to cover the whole grid.
1<= m,n <=100 Ex. Input 2 4 ..B. ..B. Output 1 Input 5 5 ..B.. ..GRR ..B.. R.... R.... Output 4 Input 5 5
..B.. ..GRR ..B.. B.... B...G Output 5 Explanation:
Blue strips are vertical.
Red strips are horizontal.
Ex 1:
Only 1 vertical strip from (0,2) to (1,2). [Indexing from (0,0)]
Ex 2:
1 vertical strip from (0,2) to (2,2)
1 horizontal strip from (1,2) to (1,4)
1 horizontal strip from (3,0) to (3,0)
1 horizontal strip from (4,0) to (4,0)
so total 4
Ex 3:
1 vertical strip from (0,2) to (2,2)
1 horizontal strip from (1,2) to (1,4)
1 vertical strip from (3,0) to (4,0)
1 horizontal strip from (4,4) to (4,4)
1 vertical strip from (4,4) to (4,4)
so total 5
2. Manager
3. employee
where an employee can have only 1 mgr, and a mgr has 1+ employees.
We were asked to input employee details(name ,id, salary,rating etc) in any order (employees might be
input before his manager), create the hierarchy and implement these functionality:
1. Print hierarchy given any employee/mgr/ceo (used an n-ary tree + hash table)
2. Given a bonus and performance rating of each employee divide it to the lowest level employees(in the
hierarchy ) in the ratio of their rating. i.e 100 divided among 2:3 is 40 and 60. and print the bonus of each (
simple recursive solution)
3. Top 10 employees with ratio of bonus:salary (used maxheap)
Write working code, modular, extensible, corner case handling etc. was arnd 1.5 2 hrs
2nd round
discussion on your solution of the 1st round, how can you optimize it, then review of the written code
3rd round
Ds and algo
1. snakes and ladders problem
2. median in a stream of integers
3. string searching (KMP / suffix tree was needed : not code just the logic)
4. Given any language , you use libraries , which might use more lib etc . Find the order of building the
libraries (Topological sort)
5. Given a server with a stack with some initial state say 1 Users can modify the stack using regular ops
eg push 2 , pop etc and each op causes a version change. i.e version 1 : 1 , version 2 : 2,1 , version 3 :
3,2,1 , version 4 : 2,
You have to design it s.t person can ask for any version of the stack (keep copies every k times and keep
the ops in an nonvolatile memory)
4th round
Design a new kind of an online poker game
give all entities and relationships in depth
further in depth discussion of how to make it more HA friendly, how to
handle players crashing etc
5th round
HM round
in depth discussion of projects and general questions eg when you disagreed with your mgr etc
anagram. Here, a = aaa and b = bbb. One possible solution is to replace all character a in string a
with character b.
Test Case #01: Either replace a with b, which will generate bb. Or replace b with a to generate aa.
Both of the solution are valid.
Test Case #02: It is not possible for two strings of unequal length to be anagram for each other.
Test Case #03: We have to replace both the characters of any string to make it anagram of other one.
2) Five Years from now
3) Expectations from Flipkart?
4) Hobbies and weekend plans and location related questions
5) Any questions for me?
Keep up the good work guys.