Preguntas de entrevista de Desarrollador de software ii

2 mil

Preguntas de entrevista para Desarrollador De Software Ii compartidas por los candidatos

Principales preguntas de entrevista

Ordenar: Relevancia|Popular|Fecha
A un Software Engineer II le preguntaron...19 de junio de 2014

How many people flew out of Chicago last year?

69 respuestas

Actually the answer is zero. Plans fly, people don't.

Roughly as many who flew into Chicago.

My estimate off the top of my head is 30 planes/hr x 24 hr/day x 365 days/yr x 180 people/plane (avg) = 47M and change. Actual for 2014, Domestic and International, is 70M. This is Passenger Volume so # leaving is 35M. Menos

Mostrar más respuestas

Given an large list of unsorted numbers, find the smallest number. You can access the list only 3 numbers at a time, and keep moving forward 1 number at a time.

6 respuestas

Otherwise called the sliding window problem

You can access the list only 3 numbers at a time: It tells we can read three numbers one after other in N/3 Iterations. So Time complexity will be O(N/3) Menos

This is sliding window problem and priority queue DS can be used to solve this.

Mostrar más respuestas

You have 2 jars and 50 black beads and 50 white beads. How many would you put of each color in each jar so that if a bead was randomly selected from both jars, you had the greatest chance they would match? You have to put all of the beads in the jars.

5 respuestas

1 of either color in the first jar (100% chance to get that color), the rest in the 2nd jar (very close to a 50% chance to get a matching color). Menos

If you fill each jar with half black and half white then you will have a 50/50 chance of drawing a match. If you put any more than half of a color in jar number 1, then you will increase your odds of drawing that color from jar 1, but since there will be a smaller number of those beads in jar 2, you will decrease the odds of drawing that color from jar 2. Therefore any configuration other than half of each color in each jar will result in less than 50/50 odds of drawing a match (like in the answer above). Menos

As long as the ratio of black beads to white beads is 1:1 in both jars, it doesn't matter. Menos

Mostrar más respuestas

Jim has 42 cents and has 8 coins, and Jack has 56 cents and has 6 coins. Which has more nickels than the other?

4 respuestas

Jim has 2 nickel and Jack has 1

Above answer is wrong...doesn't add up. Answer from Sept 9 is correct. But more explicitely, the answer is. Jim has 4 nickels (20), 2 dimes (20) and 2 pennies (2) = 42 cents with 8 coins Jack has 2 nickels (10), 2 dimes (20), 1 quarter (25) and 1 penny (1) = 56 cents with 6 coins But, remember to state the answer to the original question - "Jim has more nickels." Menos

Jim has 4 nickels and jack has 2

Mostrar más respuestas

Given a set of strings. Check if a new string is equal to any of them. Here equal means the letters are the same, like abbc=bacb

4 respuestas

void main() { char a[]= "bony"; char [b]="subhao"; int l, c; char ch; l=strlen(a); int i,j; for(i=0;i Menos

void main() { char a[]= "bony"; char [b]="subhao"; int l, c; char ch; l=strlen(a); int i,j; for(i=0;i Menos

using System; using System.Collections.Generic; namespace SampleNamespace { public class SampleClass { public static void Main() { string a = "string1"; string a2 = "1string"; Dictionary _dict = new Dictionary(); //load it up - linear loop foreach(char _c in a) _dict.Add(_c, _c); bool _matched = true; //just loop through second string chars and check from dictionary //if there is not a match break the look and string are not equal foreach(char _c2 in a2) if (_dict.ContainsKey(_c2) == false) { _matched = false; break; } if (_matched) System.Console.WriteLine("Matched..."); else System.Console.WriteLine("Does not match..."); } // End of Main function (program statup) } // End of SampleClass } // End of SampleNamespace Menos

Mostrar más respuestas

How would you find a duplicate number in a very large unsorted array of ints.

4 respuestas

[Apologies for multiple posts, I don't see any way to edit a post once made ...] There is also a way to find 2 different numbers instead of just 1 resulting from any of the above variations. If you first do the above xor O(n), your answer is actually A^B since you cannot separate the 2 numbers ... yet. The trick here is to get A and B into different unsorted subarrays, with all the other pairings that self-cancel into either subarray with them (but still in pairs together). That is done by noticing that even though you have no idea what A and B are individually, you do know that since the total is A^B that any 1-bit in the total A^B means that bit is different between A and B. So divide up *all* the numbers based on each having a 0 or 1 in one of those different bits. pseudocode -get the A^B total via the xor O(n) algorithm previously posted -determine as pivot an Nth bit which is different between A and B (any 1-bit in the A^B total) -run through all the same numbers again, but this pass accumulate xor's into an even or odd total depending on the chosen bit - the final answer for A and B will be the 2 accumulated totals Complexity: 2 O(n) which is just O(n) Menos

O(n^2) is the usual naive answer but there are properties that if true can reduce this to O(n) using bit ops: In general, if the given array range can also be generated where the duplicated number you are trying to find gets no special treatment and is included just like all the rest a single time, then you can get the answer this way: set total to 0 foreach (n in given array) xor all n into total foreach (n in generated range) xor all n into total total is your answer This works because all the non-duplicated single entries will cancel out via xor with their single entry from the generated set (since they are all paired) and the duplicated number will have an extra odd entry (since it will have 2 entries already from the given array + 1 from the generated set = 3 entries). And because of course xor is commutative; the order of the xor'ing doesn't matter: 6^6^5^5^4^4 = 0, as does 6^5^4^5^4^6 It is a variation of these problems: - find a missing number in an unsorted array - find an unduplicated number in an unsorted array of duplicates Menos

I should have added t the above: Ask the interviewer if the array of N has any special distribution. In particular, for the duplicate question here, ask if the array of N contains [0, N-2] or [1, N-1] values unsorted, in addition to one extra entry duplicated in that set duplicated. Menos

Mostrar más respuestas
Orbitz Worldwide

How can you solve n^m efficiently only using +, -, *, /.

4 respuestas

There is no need to solve it recursively. it is pretty simple int calculateExp(int n, int m) { exp = n for (i = 1; i <= m; i++) { exp = exp*n } return exp; } Menos

Disadvantage of recursion is the large amount of space on the stack for a large m in this case. Menos

This is one solution that doesn't deal with negative exponents exp(n, m) { if (m == 0) return 1 if (m == 1) return n exp = exp(n, m / 2) if ( isOdd(m) ) exp = exp * n return exp } Menos

Mostrar más respuestas

Phone Interview 1: (1)Find maximum height of BST. This is easy using recursion. Then he asked me to do it iteratively, which I somehow managed to solve. (2)The Dutch flag problem. This was not tough. But the next question was tough. It was about finding particular keys in a dictionary. They have a custom function that tells you if a key is in the dictionary and you to find out if for given input, you get required output. For example -- The dictionary is like: {hi,hello,sir,how, are, you} And you have a function isWord(x) that tells you if a particular word is in that dictinary. So if the input is hisirhowareyou the output must be hi sir how are you I couldn't solve this problem. :(

4 respuestas

this is a typical word break problem... you can check this Menos

I think what you can do is use a trie DS, and using that you can start checking for character by character and once you hit a word, you start again from the root with next character. On second thoughts we can keep building a string and on addition of every new character we search if the string is available in the dictionary or not. if it is we print the string as a word as whole and start building thr string from scratch else if it is not we move to next character. Menos

This question is not precise. According to the statement you don't have a dictionary, but API. What are you supposed to do with the given input - find all substrings, subsequences or divide it into as many words in dictionary as possible? Menos

Mostrar más respuestas
Tower Research Capital

Expectation for coding Questions: Must be sort of analytical questions testing knowledge of DS/Algos and problem-solving skills, that could be done in 65-70 minutes. Reality: Problem Solving tricky questions, I would say they are not really checking candidate's Data Structures knowledge. Standard DS/Algos can be used to come up with the sol, but again coming up with the optimised sol. is the challenging part, I feel. I though it could only be done in the given time frame with most optimised approach, only if candidate had gone through that kind of question in the past. Brute Force or Semi-optimised approach can be thought of, but coming up with most optimised approach in the given time frame, needs some serious practice and some luck too😅. According to me, either questions' difficulty level should be reduced or time can be increased.

3 respuestas

I agree with the above . Go ahead ask difficult questions but the time span is too less . Menos

Just to let readers know, this interview experience was for Tower Research Gurugram office, India Menos

P.S: Above interview exp. was for around 2+ Years of Exp.


Write code that reverses words in a string.

3 respuestas

$string = "Write code that reverses words in a string" $words = $string -split " " [array]::Reverse($words) $words -join " " Menos



Viendo 1-10 de 2368 preguntas de entrevista