# 2K

Ingeniero Iii interview questions shared by candidates

## Top Interview Questions

Sort: Relevance|Popular|Date
Software Development Engineer III was asked...17 July 2012

### Telephone interview: Find largest integer from an array of integers. The integers in the array are arranged in strictly increasing (no 2 integers are same) or strictly increasing then decreasing; so like a curve and you have to find the peak. Discuss time complexity. Write code.

The question is a variation of the commonly asked problem of finding the start/end index of a sorted array that has been rotated. Takes O(log n) time. Less

You can solve this question using ternary search

First, binary search will not work since just looking at a single point will not tell you if it's on the decreasing or increasing side of the curve. What you need is modified binary search. Looking at position i check position i+1 if it's increasing then search right otherwise search left; Code: int peak(vector V, int i, int iStart, int iEnd){ assert( i &gt;= 0 &amp;&amp; i = 0 &amp;&amp; iStart = 0 &amp;&amp; iEnd &lt; V.size()); assert( iStart &lt;= i &amp;&amp; i &lt;= iEnd ); if (i == iEnd) return i; int iCurr = V[i]; int iNext = V[i+1]; int iStartNew = iStart; int iEndNew = iEndl if( iCurr &lt; iNext ) iStartNew = i; else iEndNew = i; int iNew = (iEndNew-iStartNew)/2; if( iNew == i ) iNew++; return peak(V, iNew, iStartNew, iEndNew); } Less

### phone screen question: what is the derivative of veloctiy?

Acceleration

Guys...the (time) derivative of velocity is, without a doubt, acceleration.

dx/dt; delta of distance over delta of time

### Return k smallest element in a tree

DFS inorder return first k visited nodes (using auxiliary array)

using a rather complicated recursion.

look number of values on the left of the current node, if adding this node we get k - this is the node we are looking for. Less

### given rand5() that return 1-5 uniformly produce rand7() that returns 1-7 uniformly

int S=0; int i; for (i=1, i&lt;=5, i++) S=S+rand5(); return ( S % 7) + 1; S spans 5 to 25 (inclusive, which are 21 values evenly/uniformly spread) Less

The above solution (with the sum) is not correct because, for example, you have several “options” to get to a sum of 6 (1+2+1+1+1, 2+1+1+1+1 etc...), but only one option to get to a sum of 5 (get 1 five times). So the 5 to 25 range is not evenly distributed. You are more likely to get certain numbers. So the rand7 does not return 1-7 uniformly. Less

int a = rand5(), b = rand5() while (a*5 + b &lt; 10) {a = rand5(), b = rand5()} return (a*5 + b) % 7 Less

### Technical Manager = What are you doing? How much are you willing to contribute? etc. This is mostly behaviour round. HR = Again, straight forward questions. Technical = this round contains two coding test. You will work as a team with some other candidate on a test. Basically, you have to demonstrate your teamwork skills. Also, how well you handle the situation e.g. are you a follower or a leader etc.

Hi, Can you share what kind of questions were asked in the 1st technical test?

Well first round was basic OOPS knowledge. Since it's been more than 2 months, I do not exactly recall all the questions but it was straight forward. Less

Regarding main face to face interview, I've already mentioned two questions in my original post. Less

### You climb a 60 foot tree and have the ability to span up to 3 feet at a time. What's the minimum number of branches you'd have to touch to get the top?

Not enough information. No idea how many branches there are or what is the location of each one. And what kind of tree could you scale all the way to the top while fully supporting your weight? Was this a 100-foot tree that was cut off after 60 feet? Less

20 branches

Divide 60 by 3.

### Explain this: var Bob = { name: "Bob", name_fn: function(){ return this.name; } } console.log(Bob.name_fn()) //"Bob" var fn = Bob.name_fn console.log(fn()) //undefined

when you call fn() its scope is in global. The function call should be scoped properly to work. You should use call or apply to make it work. Less

It's essential to demonstrate that you can really go deep... there are plenty of followup questions and (sometimes tangential) angles to explore. There's a lot of Software Engineer III experts who've worked at PayPal, who provide this sort of practice through mock interviews. There's a whole list of them curated on Prepfully. prepfully.com/practice-interviews Less

fn is "Bob" and not a method.

### given list[list[String], where each list[String] represents a node in the following manner: node.id -&gt; child0.id -&gt; child1.id -&gt; ... rebuild the tree.

Using a HashMap to store existing id's

Didn't get the question. list[String] will have nodes all the way down to the leaf or just one or two immediate children ? Less

I would use a HashMap , A, for node.id -&gt; Node Object. Meaning that when reading a line I would create a Node Object with the given id. And child Id which appears in this map (A) I will add a pointer to it from the parent. If the child id is missing, then I will add the parent to another HashMap, B, which stores child.id -&gt; [List of parents]. So that actually when reading a line and creating a new Node, I will also look at HashMap B, and update all it's parents (and remove them from map B). Less

### Write a pgm to find out if call stack address is increasing or decreasing

@M: it's a pretty common question irrespective of the nationality of the interviewer. I was asked the same question by a Caucasian guy at a different firm and I didn't get the job - not because of my (or his) nationality, but because I wasn't technically strong enough. Less

M. I am here in states and am Indian and I bet you have no idea how difficult Indian interviewers are! If you are an Indian and he is Indian too, he would give you a benefit of doubt! Yes some of us are like that, but I guess every where there are some folks like that! Cheers! Less

what kind of entrance exam? Such stupid interview, guess pretty much like those in India. My expereince was if interviewer &amp; candidate are from India, no such testing etc. If interviewer is from India and candidate is of other nationality, yes, because that will give the interviewer an excuse not to hire. Less