Hi, Recently I attended Knowlarity Interview.
1) swap the even bits and odd bits in the number.
I/P: 01010101 O/P:10101010
2) convert a binary tree in Double Linked list. He then asked, how will you handle the case when the parent left and right pointers are changed, but children has not been processed yet
3) Find the min element in Stack in O(1) time, without affecting Push and Pop operation.
1) Left view of a Binary tree
2) Puzzle: Using all(8,8,3,3) and only operators(*,/,-,+), make 24
3) I/P: “My \t India \t is great”
O/P: great is India My
The string can contain many spaces,tabs between the words, but you have to output with 1space between the words.
Next he modified the problem, told to it inplace, without using an auxillary array.
4) There are two arrays.All the elements in the array are same, except one pair. Find that pair. I told Hashing. He told to improve it. It can be done as an equation.
Sum of first array – Sum of second array = x-y
Sum of squares of first array – Sum of squares of second array = x^2- y^2
1) How do you implement LRU cache
2) Your current project in Company
3) I don’t remember
1) You have a stream of numbers. At any time , find the maximum and the unique number at any time.
I/P: 5 6 7 7 6
O/p:5 6 7 6 5
2) There is a Binary Tree. Find the min and max of the binary tree , without using Global variable
3) Check if a Binary tree is BST or not
Round 5 (Director Round):
1) Print the maximum subsequence in the 1d array
A1 =() A2 =() A3 = (A1 + A2) => (()()) A4 = (A3+A2) => ((()())()) A5 = (A4+A3)=> (((()())())(()())) Similarly An= An-1 + An-2
Given n and k, find the kth bracket in nth term in O(n)
I did in O(n+logn). He told to improve it. Then he told the solution in O(k). And then he told to code in computer and gave the inputs to check it.
Round 6 CTO Round:
1) Merge two sorted linked list
2) Puzzle: You are given two eggs. There is a 100 floor building. Find the minimum floor from which if the egg is thrown , breaks , in minimum number of throws. Answer=> 14
Then he asked if I had any questions for him.
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
- Knowlarity Interview Experience | Set 2 (Off-Campus)
- Goldman Sachs Interview Experience | Set 23 (2+ years Experience for Java Developer Role)
- Microsoft Interview Experience (Full Time 2018 Washington DC - with 2.5 years of experience)
- Brocade Interview Experience | Set 2 (For Software Engineer 0-2.5 Years Experience)
- Arcesium Interview Experience | Set 5 (3+ years experience - Developer profile)
- Oyo Rooms Interview Experience | Set 3 (For Backend Engineer, Experience <=1yrs)
- Oyo Rooms Interview Experience | Set 12 (4+ experience Backend Developer)
- 7 Innovation Labs Interview Experience (6 Months Experience)
- Walmart Interview Experience for SDE2 | Set 19 (3.8 years experience)
- Amazon Interview Experience | Set 167 (SDE I for 1 year 6 months experience)
- Walmart Lab Interview Experience | Set 7 (Off-Campus 3 Years Experience)
- Walmart Lab Interview Experience | Set 8 (Off-Campus 3 Years Experience)
- Goldman Sachs Interview Experience | Set 39 (1.5 years experience)
- Adobe Interview Experience for MTS-1 (1.5 Years Experience)
- Microsoft Interview Experience | Set 169 (SDE 2 for 3.5 years experience)