Q1. Given a binary tree, such that each node contains a number. Find the maximum possible sum in going from one leaf node to another. Q2. Suppose you have some guests arriving at a party. For each guest, you are given the arrival and departure time. When a guest arrives he is given a wine glass and when he leaves he returns that wine glass (it becomes available to be given to another guest). Find the minimum number of wine glasses needed to serve all the guests. The arrival and departure team can only be between 1800 to 2359 hours.

Interview Rounds :

12 students were shortlisted for the first interview process. I was told that I came 3rd in the apti test. All the three interviews were telephonic.

Round 1 :

He asked if I had passion for something. I talked about web development and we had a very long discussion on many web technologies, protocols, interoperability, vendor locking, cloud storage, cloud computing, web OSes, domains, DNS, server technologies, web databases. This is where I scored huge points in my interview.

Then he asked very simple questions on merging two sorted arrays, finding the kth element in two sorted arrays, permutations of merging two series such that their relative order is maintained

Eg.

Q1. Suppose you have strings like A, B…, Z, AA, AB, ….AZ and so on. This is similar to the way the columns of excel are named. Given a number you have to find the corresponding string. (e.g. 27 would map to AA). I had to give the algorithm and write the pseudo code for this. Q2. Given n biased coins, with each coin giving heads with probability Pi, find the probability that on tossing the n coins I will obtain exactly k heads. I had to write the formula for this (i.e. the expression that would give us P (n, k)). Q3. Given n positive real numbers, find whether there exists a triplet among this set such that, the sum of the triplet is in the range (1, 2). Do it in linear time and O (1) space.

Round 2 :

• As I had a little experience with website management, questions on Javascript(closures) and mySQL were also asked • They asked me to explain the OOP concepts. • As I told them that I was good at problem solving, they asked me three questions which dealt with operations on a two dimensional arrays wherein every row and every column was sorted. These were quite tough but I solved them in the end.

Eg.

Q1. Suppose we have three positive integers A, B, C. We randomly choose an integer a in the range [0,A] and an integer b in the range [0,B]. Find the probability that a + b<=C. Q2. Repeat the above problem for the case when A, B, C are three positive real numbers. Q3. Given a regular expression and a string (that apart from characters only contains *). Find whether the string satisfies the regular expression. Once the initial solution was given, a good amount of time was spent in considering all possible edge cases and tweaking the algorithm to solve those edge cases.

Round 3 :

• This was my longest (105 minutes) and toughest interview yet.

Q1. Given an array A A = { 4 0 0 3 6 5 4 7 1 0 1 2 } You start at the first element. From here, you can jump as many places ahead as the value of the cell you are at. E.g. from the initial 4, you can jump to 0, 0, 3 and 6. You are stuck if you end up at a 0. Give an efficient algorithm to find the path with minimum jumps from start of the array to the end. (Note: the most obvious solutions are not the best ones) • + is string concatenation operator a1 = “()” a2 = “(“ + a1 + “)” a3 = “(“ + a1 + a2 + “)” a4 = “(“ + a1 + a2 + a3 + “)” . . an = “(“ + a1 + a2 + a3 + …….. + an-1 + “)” Given n and p, find which bracket would come at pth position in an.

• He asked how much programming experience I had, what all programming languages I knew, if I had studied DBMS. Then he asked me questions on javascript, PHP, mySQL.

• Questions on data structures (difference between trees and hash tables), their applications.

Eg.

The length and breadth of my knowledge regarding Databases, networks and data structures was tested. Some of the questions asked were:

Q1. What are relationships? How are they represented in a database? Q2. What is indexing? Explain it with an example. Q3. What is a hash table? Q4. What is an IP address? Q5. What is a MAC address? A6. If a MAC address exists why do we need an IP address? Q7. Give the use cases of binary tree? Q8. What is the advantage of an M-ary tree over binary tree? Q9. Given the different prices of a stock over a time period, find the maximum profit that a person can make by buying and selling the stock within the given time period. The number of such entries can run into millions, so time complexity is important. E.g. the prices are 70, 60,100,150,110. The maximum possible profit in this case is (150-60=90).

Special Part :This was the end of the telephonic interview. Probably he was in two minds after this because I was called again after 10 minutes, and two quick questions were asked:

Q1. How can I contribute to Directi? Q2. What exactly did I do in my internship and how did I benefit my team? Q3. Why I chose ECE if I was so much interested in computer science.

In the end, he gave feedback of how did in the interview and told that I’ll be informed of result later by the HR. But i think The response to these two questions sealed the deal and I was ‘hired’ by Directi .

Thanks Praksh V.for contributing this article. If you would like to contribute, mail us your interview experience at [email protected] We will like to publish it on CrazyforCode and help other job seekers.