Flipkart Interview Experience | Set 18 (For SDE I)
I have recently attended Flipkart for SDE 1 @ Bangalore. Thanks to GeeksforGeeks team which has been the only single source of my preparation and helped me a lot. Below is my experience.
- Machine Coding Round:
- Design a book catalogue search (API’s were given for the search, full needs to be implemented as running application)
- Second Round:
- Discussion on the design and optimization of the application
- Basic DS questions (Eg: which data structure to be stored to increase search efficiency …Ans: B+ tree)
- Data Structures and Problem Solving Round:
- Given two unsorted arrays A and B in which B can accommodate in A
How will you merge the two arrays?
Time complexity and space complexity were also given importance.
- Perimeter of the binary tree in clockwise direction(All kind of possible approaches
and efficient approach were discussed)
Time complexity and space complexity were also discussed.
Second DS Round Skipped
- Given two unsorted arrays A and B in which B can accommodate in A
- Hiring Manager Round:
- Problem Statement
Sid is obsessed about reading short stories. Being a CS student, he is doing some interesting frequency analysis with the books. He chooses strings S1 and S2 in such a way |len(S1)?len(S2)|?1.
Your task is to help him find the minimum number of characters of the first string he needs to change to enable him to make it an anagram of the second string.Input Format:
The first line will contain an integer T representing the number of test cases. Each test case will contain a string having length |S1|+|S2| which will be the concatenation of both the strings described above in the problem. The given string will contain only characters from a to z.Output Format:
An integer corresponding to each test case is printed in a different line i.e., the number of changes required for each test case. Print? 1 if it is not possible.Constraints:
1?T?100
1?|S1|+|S2|?104Sample Input:
5
aaabbb
ab
abc
mnop
xyyxSample Output:
3
1
-1
2
0Explanation:
Test Case #00: We have to replace at least three characters from any of the string to make both of strings 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.
- Five Years from now
- Expectations from Flipkart?
- Hobbies and weekend plans and location-related questions
- Any questions for me?
- Problem Statement
Keep up the good work guys.
All the best for other geeks 🙂
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.
Please Login to comment...