Flipkart Interview Questions
- 0of 0 votes
AnswersYou are given some equations which may contain > or = on different-different operand. For example there are valid input and invalid (a=5, b<a=50)
- kri1311 May 26, 2015 in India
String e1 = "a>b=1";
String e2 = "a>b=2";
String e3 = "a>c>e=3";
String e4 = "a>c>f=4";
String e5 = "b>a=5";
String e6 = "a>b>c=5";
String e7 = "b=7";
String e8 = "a>b>c>d=99";
String e9 = "a>b=99";
You need to create JSON string from it.
{
‘a’: {
‘b’: [1,2,99],
‘c’: {
‘e’:3,
‘f’:4
}
},
‘b’: {
‘a’ : 5
}
}
Highlighted one are invalid bec as they come they ask for overwrite the data (a>b>c = 5; C has e and f so we can overwrite.
Input: You are given those string in string array
Output:
Construct JSON
Print it
If you print in same as above (nice manner) +point| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersGiven daily stock rates of last year give the average stock rate price for a given day range
- kri1311 May 26, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersHow would you design Hospital management system ?
- kri1311 May 26, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswerThere are M chocolate packets each packet can have variable number of chocolates in each packet. There are N students (N < M). Distribute chocolate packets to student such that
- kri1311 May 26, 2015 in India
a) each student gets 1 packet
b) suppose m1,m2,…mn are the packets which are chosen to be distributed in sorted order of number of chocolates in them (nm-n1 must be minimum)
M = 1, 3, 4, 6 (4 packets with specified number of chocolates in them)
N = 2
Ans = 3,4| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersAssume you have a starting 4 digit number, say 1234 and and ending 4 digit number 4567. For changing a bit of a number from 1 to 3 (for example), it will take 2 steps (from 1->2 and from 2->3). So to convert 1234 to 4567, you’ll have to change each and every bit individually in some number of steps. (Change 1->4 in 3 steps, 2->5 in 3 steps and so on). Now there is a list of blacklisted numbers. So while transforming start to end, if you reach a blacklisted number, then you cannot change that particular bit, you’ll have to move to another bit. E.g. Assume 1434 is a blacklisted number, and while transforming you reach it, then you have to change either 1, or 3 or the last 4. So you have to find the least number of steps in which start number can be transformed to end number.
- kri1311 May 26, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersI was asked to design a snake and ladder game. The game can have more obstacles than just snake and ladders.
- kri1311 May 26, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE1 - 0of 0 votes
AnswersThere is a n player game of cards. The deck of card is not fair, i.e. any card can be there any number of times. A card has a number and a color. Each player gets k card each (n and k can be harcoded in the solution). The computer starts the game by throwing a card from the deck of cards. Assume the card is 4 of Green. Then the other player has to throw either a 4 of any color or Green of any number. If the player does not have any such card, then it can say pass. The player who finishes all his card wins. The logic of selecting the card by the user can be hardcoded (Eg, If you use a list data structure for storing the cards for a player, then you can say that the player always throws the first card from the list). The logic was required only to start and conclude the game.
- kri1311 May 26, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersTwo players, two field; and have multiple ships located in their fields. They are guessing each others ship position and hitting. Tell who wins first. Design maintainable code which can incorporate future change.
- kri1311 May 26, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersDesign a cricket series. Extend it to olympics.
- kri1311 May 26, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersDesign and build tic tac toe game. The code should be up and running. It should be scalable to multi-users and nXn grid.
- kri1311 May 26, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersTwo players, two field; and have multiple ships located in their fields. They are guessing each others ship position and hitting. Tell who wins first. Design maintainable code which can incorporate future change.
- tarunjain07 May 21, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE1 Object Oriented Design - 0of 0 votes
AnswersPrint the bottom view of the binary tree.
- kri1311 May 19, 2015 in India
Example :
1
/ \
/ \
2 3
/ \ / \
4 5 6 7
/ \ / \
8 9 10 11
/
12
Output should be :
8 12 9 10 5 6 11 7
Solution is different from http://www.geeksforgeeks.org/bottom-view-binary-tree/| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersGiven an array and a target number. you have to print all sequences that generates the target number.
- kri1311 May 18, 2015 in India
you can use two arithmetic operators '+' and '-' to perform operations among array elements.
Note: you can't modify the array and you have to use all the elments of the array. and the order would be same as given in the array.
Example : 1 9 1 2 , Target Number = 9
1 + 9 +1 -2 =9
output should be "1 + 9 +1 -2 "| Report Duplicate | Flag | PURGE
Flipkart SDE1 - 1of 1 vote
AnswersYou are given a catalog of books, which have following attributes :-
- neer.1304 May 14, 2015 in United States
Name, Author, Publisher, Publish year, Category, Price, Count (sold)
Implement following APIs on top of this catalog -
1) addBookToCatalog(Book)
2) searchBook(by partial book name/author)
3) getMostSoldBooks(by author name/category, limit)
Expectations:
Maintain DB on memory
Code should be readable. Design, handle naming convention,handle exceptions & should be running| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Algorithm - 0of 0 votes
Answersdesign snakes and ladders game(multiplayer). extend it so that it can be hosted overs a server and played over a server
- aditya.eagle059 May 08, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
Answersgiven daily stock rates of last year give the average stock rate price for a given day range
- aditya.eagle059 May 08, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
Answersgiven n-ary tree. zigzag level order traversal.
- aditya.eagle059 May 08, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
Answersgiven unsorted array and a number K. Find 2 numbers such that sum is K
- aditya.eagle059 May 08, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
Answersthere are M chocolate packets each packet can have variable number of chocolates in each packet.
- aditya.eagle059 May 08, 2015 in India
There are N students (N<M).
Distribute chocolate packets to student such that
1) each student gets 1 packet
2) suppose m1,m2,...mn are the packets which are chosen to be distributed in sorted order of number of chocolates in them (nm-n1 must be minimum)
M = 1, 3, 4, 6 (4 packets with specified number of chocolates in them)
N = 2
Ans = 3,4| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
AnswersYou have an organizational structure, which shows hierarchy of the organization. This hierarchy contains employees E or managers M who has some Employees or Managers reporting to M. Employee has ( id, name, JobDesc, salary etc). Design the data structure you would be using to store this hierarchy
- neer.1304 May 07, 2015 in United States
1: Given an ID of an employee , print all the employee ID's who are directly reporting or indirectly reporting to the manager.
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
3. Top 10 employees with ratio of bonus:salary
Note :-
1) Employee can have only 1 mgr, and a mgr has 1+ employees.
2) Input can be in any order for ex- employees might be input before his manager.| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Algorithm - 0of 0 votes
AnswerAssume a Game where a player can jump from one step to other to reach the final step.
- vinodjayachandran March 21, 2015 in India
From any given step Player can go to another step in any direction North, South, East or West. (i.e ) from Any given step user has a choice of multiple steps to choose from to proceed towards final step.
Some steps may not lead you in right direction to final step, in that case he need to retrace back.
To jump from one step to another Player uses a ladder. Distance between adjacent steps is not constant, they differ for each pair.
What is longest length of a ladder needed for the player to reach the final step from the starting step.| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Algorithm - 1of 1 vote
AnswersImplement a MessageBroker which accept messages from Publisher and deliver to Subscriber.
- vinodjayachandran March 15, 2015 in India
To begin with start with single Publisher and Subscriber. But design it in such a way to scale up to many publisher and subscriber associated with a Single Broker.
Take Performance and parallel processing into consideration.| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Problem Solving technical - 0of 0 votes
Answers#include <stdio.h>
- sumit January 06, 2015 in United States
int main()
{
printf(&unix["\0c%set\012"],(unix)["chak"]+"Trick"-0x67);
}| Report Duplicate | Flag | PURGE
Flipkart Systems Design Engineer C - 2of 2 votes
AnswersDesign and Implement a Telephone database structure in which a Customer Entry has PhoneNum,Name,Address.
- R@M3$H.N December 31, 2014 in United States
a) Given any PhoneNum return all the Customer details
b) Given any Name list all the Entries (As Name can be duplicate, only PhoneNum is unique)
c) Also Name searching should support Prefix Based.| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Algorithm - 0of 0 votes
AnswersDesign Maps: You have set of [lat, long] for all famous locations. Given your position [lat, long] return all famous locations within r radius of your position.
- darklight November 27, 2014 in India| Report Duplicate | Flag | PURGE
Flipkart Software Engineer / Developer Data Structures - 0of 0 votes
AnswersConsider the following class definition:
- newbee August 19, 2014 in India
class Node {
List<Node> children;
void addChild (Node child);
}
Assume you have a node object like above. This node object can contain a child node object. Assuming you are given one of these objects, write a function to determine the maximum path length from the root node to the most distant remote node. .| Report Duplicate | Flag | PURGE
Flipkart Senior Software Development Engineer Algorithm