Company – STB team, Microsoft IDC.
Location – Hyderabad.
First interview
- A quick introduction.
- Few questions on multi-threading like –
…a. What is race condition?
…b. What is critical section? -
Write a code to find out longest substring without any repetition of characters with O(n) complexity.
Ex. String - abcdefghaxyzpbn Output string - bcdefghaxyzp
- Two linked lists are merged at one point. Find the merging node.
Second Interview
- A quick introduction
- Few project related questions mentioned in resume.
- If you have huge log file, you need to print last ‘n’ lines from the log file. Write a code for it assuming regular file read operations.
He was also expecting that the page hit is minimum.
I had provided a solution which would read the file one by one and then will store it in a ‘n’ size circular linked list. -
If you have a m*n floor, find out a ‘k’ size square tile which will take care of filling the complete floor without breaking of tile.
Use GCD logic.
Third interview
- A quick introduction and he also asked what was asked in previous interviews.
- We have a m*n matrix, every element in row is in increasing order and every element in column is in increasing order. Find out a position of element ‘k’ from the matrix with O(m+n) complexity. Write a code for it.
- We have a ‘n’ steps and a ball which take either 1 step at a time or 2 steps at a time. Find out the number of possible ways it covers exactly ‘n’ steps.
This article is compiled by Girish.