***Team : OneNote ***
Round 1 :
Date : 05-02-2022
Question 1 : Given two linkedlist l1, LinkedList l2 . Add numbers of these linked lists and store these values in new LinkedList
My approach :
Round 2:
Given a NM matrix, search an element in it.
Expected time complexity : N(log M)
Explained it with binary search.
**Second question : (wasn't actaully expecting a design question this much early)
Design A Logger
I wasn't prepared for desigining round at all.
Result : So rejected.
**Interview :2
Team : microsoft 365
Date : 26-03-2022 : Saturday(today morning)
**Round 1 :
Question 1 :
Implement a Queue that has functionality for enque, deque .
you have to use array/array's of fixed size = 5 as a backing store.
Interviwer was impressed when I said i use LinkedList of arrays to solve this problem
I would have two pointers rear and front.
rear=0;
front=0;
Enque : initially these are 0 but when we insert element , we move forward. when front == 4, that means array is filled, you need to create new array and assign it to LinkedList node.
Deque: Get linkedlist on FIFO base increase the rear pointer.
But wasn't good at implemeting it. so got stuck.
Round 2 :
You are given two apis
1). findfirst() : returns the first item in the folder structure
2), findnext() : returns the next item(can be a file/ directory).
Question :
1). Print the all files in a level wise(BFS)
2). print by going to last depth (DFS)
3)optimize above code to write in same method by use of flag.
printItems(Strng path, boolean flag){
}
explanined first two parts but third question couldn't explain.
Result : Reject