Preguntas de entrevista para el puesto de Software Engineer | Glassdoor.es

Preguntas de entrevista de Software Engineer

280

Preguntas de entrevista para Software engineer compartidas por los candidatos

Principales preguntas de entrevista

Ordenar: RelevanciaPopular Fecha

Write function to calculate sum of first N powers of 2 starting from 1. You shouldn't use any built-in function for calculating power. Implement the most efficient solution.

4 respuestas

//This method takes O(nLog(n)) private static int sum(int n) { int sum=0; for(int i=1;i<=n;i++) { sum += power(i, 2); } return sum; } private static int power(int base, int exp) { if(exp==0) return 1; int temp = power(base, exp / 2); if(exp%2==0) return temp * temp; else return base * temp * temp; }

You can do this with bitwise operations. The way to come to the solution is by making a table of the calculations in binary. N Sum Sum(bin) 1 2 10 2 6 110 3 14 1110 The progression becomes apparent and then you just need to figure out a way of getting that number with bitwise operations. ((1 Gives 1 followed by N zeros ((1 Makes the above into 1s (minus one spot) ((1 Adds a zero at the end by moving everything one step to the left

You can do this with bitwise operations. The way to come to the solution is by making a table of the calculations in binary. N Sum Sum(bin) 1 2 10 2 6 110 3 14 1110 The progression becomes apparent and then you just need to figure out a way of getting that number with bitwise operations. `((1 Gives 1 followed by N zeros `((1 Makes the above into 1s (minus one spot) `((1 Adds a zero at the end by moving everything one step to the left

Do you like to break interview processes for companies by posting them in glassdoor?

3 respuestas

Given a the price of a stock over time in an array, write an algorithm that identifies the optimum time time to buy the stock and the optimum time to sell in order to get the largest profit. You can only traverse the array one time.

2 respuestas

Code a FizzBuzzRazz test. If it's divisible by 3 print "Fizz" if it's divisible by 5 print "Buzz" if it's divisible by 7 print "Razz" if it's divisible by 3 and 5 print "FizzBuzz" if it's divisible by 3 and 7 print "FizzRazz" if it's divisible by 5 and 7 print "BuzzRazz"

2 respuestas

The first interaction was not a question, it was only a... "Well, tell me".

2 respuestas

Build battleship.

1 respuesta

We have to classes: A and B. Class A has a property that refers to an instance of B and Class B has a property that refers to an instance of A. Is it correct? Does it have any problem? If so, how would you solve it?

1 respuesta

How do you manage a farm of servers in North Korea

1 respuesta

Why do you think there are fewer women in IT jobs?

1 respuesta

what was your last project ?

1 respuesta
110 de 280 Preguntas de entrevista