Skip to content

Interview Experience 6 (Intern)

sggarg edited this page Aug 13, 2017 · 1 revision

##1st Round Online coding round with 20 MCQs and and 2 programming questions which were:

  1. Find the first non-repeating alphabet in the given word else print ""-1"". e.g.- w in twitter
  2. Given a nXn matrix which is filled with the no.s 1 to n^2 in row major order. Given k, find the kth no. when traversed in spiral order. e.g.:

1 2 3

4 5 6

7 8 9

if k=6, output 8.

##2nd Round

  1. Code for checking if the given set of parenthesis is well balanced or not. Specify the time and space complexity.
  2. Program to find the height of a binary tree. I wrote a recursive function then he asked for non recursive one. And specify its time and space complexity.
  3. Why can't we use *p instead of **p for storing address of a pointer variable as both contains the address?

##3rd Round First he asked some simple questions from theory of computation about finite automata. And he drew a finite automata and asked me to give it's regular expression.

Then he asked questions from OOPs about polymorphism, encapsulation, inheritance, virtual function, in-line function and friend function.

Given a binary tree and a value k, find the path(from root to leaf) whose sum is equal to k and store the nodes of that path in any data structure.

Clone this wiki locally