Questions d'entretiens - Web intern

17 k

Questions d'entretien pour Web Intern partagées par les candidats

Principales questions d'entretien

Trier: Pertinence|Populaires|Date
Amazon
On a demandé à un Web Development Engineer...25 février 2017

Implement Sum(3)(4)(5)=12 with javascript

17 réponses

const Sum = a => b => c => a + b + c;

``` // Lexically nested function definitions defined within enclosing function function Sum(arg0) { function Inner1(arg1) { function Inner2(arg2) { return arg0 + arg1 + arg2; } return Inner2; } return Inner1; } console.log(Sum(3)(4)(5)); ``` Moins

var sum=0; // global variable function Sum(num){ sum=num+sum; return Sum; } Sum(3)(4)(5); Moins

Afficher plus de réponses
Amazon

Vertically and horizontally center an element on the screen using css.

8 réponses

#center{width: 100px; height: 50px; position: fixed; top: 0; left: 0; right: 0; bottom: 0; margin: auto;} Moins

wrong answer. u need to also margin it negative

. container{ Position : absolute; Width : 200px; Top : 50℅; Left : 50℅; Transform : translate(-50℅) } Moins

Afficher plus de réponses
Americaneagle.com

1) Clustered and Non Clustered (SQL)?

7 réponses

What other types questions were on the written test?

Given a scnerio, create a database model

How to improve performance?

Afficher plus de réponses
Google

1) Given a string of parantheses, check if the string is valid. ex: [[]] is valid, ][][ is not valid. How would you solve if the parantheses could be of different types like {,[,(

6 réponses

Use a counter to track the status. Stack solution is no difference from this. Seeing an opening parenthesis increment the counter. Seeing a closing parenthesis decrement the counter. Check the counter is always non-negative. Counter has to be zero when string ends. Moins

Stack the parenthesis up. 1st of course the first parenthesis will go on to the stack. If you see a closing parenthesis, pop the stack and see if the parenthesis matches the one which is just read(closing one), if no match? error else keep going. Moins

To Aegis: If you take "[" as 1 and "]" as -1, then ][][ starts from -1. We can say that's invalid right away. Moins

Afficher plus de réponses
MountBlue Technologies

Print patterns like Swastic sign, 2-D Array manipulations(Bit Difficult) and String manipulations.

6 réponses

They will mail the exact date. The joining date is between 6-16 aug. The difficulty of 2nd round was medium. One question was a bit difficult and the rest were medium.If you are good at coding and regularly doing it then you can easily crack it. Moins

Be sure you are good at coding.

when is your joining??what is the difficulty of 2nd round?

Afficher plus de réponses
Spotify

You have 1000 computers. Each computer contains a text file containing 1 billion floating point numbers. Design an algorithm or algorithms for extracting the top 1000 numbers from the entire list. Describe in detail how long it would take to process and why.

6 réponses

1. 1000 computers - parallel 2. the problem can be divided into 2 parts. (1) find the top 1000 numbers from that 1 billion numbers in one computer To do this. we just need to use merge sort. Everytime use the left part. With some calculation, the solution for this is actually O(N). n is 1 billion. (2) get that top 1000 from the 1k * 1k list. (easy) Moins

There is a very nice parallel sorting algorithm with a very good iso-effeciency. It is called Sample-sorting. I would use that. Moins

You could do a bunch of crazy stuff too... Map reduce and parallel stuff is kinda a given. You'd be reading in strings, so before converting them to numbers, you could just check the position of the comma/point, and skip if your comma/point counter is at a higher value. If there's a minus sign in the beginning ignore the number, provided you already have 1000 positive numbers. Do something crazy with a stream and a router. Write a HD driver that scans the sign bit and exponent bits. lol Find a way to scan vertically for the comma/point. And you wouldn't be sorting you'd be searching. Ideally, it would take as long as it takes to read 1 text file from disk, because you'd be kinda faux streaming it through your code, plus a little extra time, multiplied by the number of files. You'd get a nice boost from dividing your file by the number of processors. 32 cores = 32 pieces of file being processed at the same time. Moins

Afficher plus de réponses
Amazon

Take two arrays and compare them to find duplicates. Only list each duplicate once.

6 réponses

The most upvoted answer on this has a run time complexity of O(m * n) where m and n are the arrays. This is solvable in O(n) by using a hash map, by sacrificing space for complexity: var Array1 = ["a", "b", "c", "d", "e", "f", "c"]; var Array2 = ["c", "x", "y", "f", "c"]; let hash = {}; let result = []; // loop over the largest for (let i = 0; i < Array1.length; i++) { if (!hash[Array1[i]]) { hash[Array1[i]] = 1; } } for (let i = 0; i < Array2.length; i++) { if (hash[Array2[i]]) { result.push(Array2[i]); delete hash[Array2[i]]; } } console.log(result); Moins

var Array1 = ["a", "b", "c", "d", "e", "f"]; var Array2 = ["c", "x", "y", "f"]; Array1 = Array1.filter(function(val) { return Array2.indexOf(val) !== -1; }); Moins

I think that the last solution suggested might still return duplicates. For example if array1 = [1,2,3] and array2 = [2,2,2] we will get the result of [2,2]. This is another solution in O(n) - function findDuplicates(arr1, arr2) { var dict = {}; var duplicates = {}; for (i = 0; i < arr1.length; i++ ) { dict[arr1[i]] = 1; } for (i = 0; i < arr2.length; i++ ) { if (dict[arr2[i]]) { duplicates[arr2[i]] = arr2[i]; } } return Object.values(duplicates); } Moins

Afficher plus de réponses
PE International

"If you were stranded on a desert island, what three development tools would you bring with you?"

5 réponses

This ridiculous, senseless question was the first one asked. It set the tone for what was to follow. Moins

IDE, Build Tools, Version Control!

Git, Codio, and Netflix

Afficher plus de réponses
Bloomberg L.P.

What is a JavaScript callback function?

5 réponses

A callback function is a piece of JavaScript code that executes after the main function that the callback is attached to executes successfully. Moins

udaykanth, I would say that a .forEach() would be the most common and most basic use of a callback function. I'm just writing this to help anyone that might have a hard time thinking up a quick example if the come across this question themselves. Example: var numArray = [ 1, 2, 3 ] ; numArray.forEach( function( i ) { console.log( arr[ i - 1 ] ) } ) ; // logs out // 1 // 2 // 3 Moins

I don't think Bloomberg is a very good company. I am an excellent web developer and have gotten multiple offers from other companies with big names, but was rejected by Bloomberg. They are too demanding during the job interview and it becomes a game of how well you can interview as opposed to how talented an employee you are and how much you can contribute to the growth of the company. Moins

Afficher plus de réponses
Amazon

How would you implement integer division if your language did not offer it.

5 réponses

#Assumes positive numbers def divide(num, divide_by) answer = 0 return answer if divide_by == 0 while(num >= divide_by) num = num - divide_by answer = answer + 1 end answer end puts divide(10,0) Moins

Simpler version (assuming you are allowed to use multiplication), just compute the sign at the end and multiply: function divide(a, b){ if(b == 0) throw "Cannot divide by zero"; var remainder = Math.abs(a); var dividend = Math.abs(b); var result = 0; while(remainder >= dividend){ result++; remainder -= dividend; } if(result > 0 && a*b < 0) result *= -1; return result; } Moins

http://www.bearcave.com/software/divide.htm

Afficher plus de réponses
1 - 10 sur 17 062 questions d'entretien d'embauche

Consultez les questions posées en entretiens pour des emplois similaires