Software developer Interview Questions in Barcelona, Spain | Glassdoor.co.in

Software developer Interview Questions in Barcelona, Spain

480

software developer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

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 Answers

//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 Answers

Irrelevant. Definitely, they were out of my scope (I've never worked with javascript in that way). Anyway, before you start the test they make you check you accept their Code of Honour. They don't have honour. Since the beginning, the recruiter saw me very interested. After the test, I asked for the solution, or what they were expecting to see, and I ended up copying the questions (I broke their code of Honour, because you are not allowed to do that) because she didn't even bother on replying me any more, and if they didn't want me to get the solutions, don't worry, I will get them myself ;)

2 Answers

"Imagine its your first week in the company and I ask you to do a presentation of your choice in front of your colleagues, what would it be about?"

2 Answers

With which RB value do you identify the most? Can you give an example of when you showed this value?

2 Answers

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 Answers

If you would have 1 million Euros, what car would you buy, if you can only spend this money on cars?

1 Answer

Asked me to create an application

1 Answer

En el currículo especificas que tienes un nivel medio de ingles...

1 Answer

¿Qué te motiva para cambiar de trabajo?

1 Answer