Web Development Engineer Interview Questions | Glassdoor

# Web Development Engineer Interview Questions

52

Web development engineer interview questions shared by candidates

## Top Interview Questions

Sort: RelevancePopular Date

### Web Development Engineer at Amazon was asked...

May 24, 2009
 How would you implement integer division if your language did not offer it. 5 Answershttp://www.bearcave.com/software/divide.htm#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)I think this is all you need, as the question asks for integer division I.e. 2 integer inputs to provide integer output 3 / 4 = 0 (dividend is less than the divisor) 2 / 1 = 2 (divisor is 1) 4 / 2 = 2 (divisor is a factor) 7 / 5 = 1 (dividend is greater than divisor) Note: solution below is for positive integers public static double divide(int dividend, int divisor) { int remainder = dividend; int count = 0; while (remainder > divisor) { remainder -= divisor; count++; } return count; }Show More ResponsesEDIT: To also handle divide by zero and negative numbers public static int divide(int dividend, int divisor) throws ArithmeticException{ int remainder = dividend; int count = 0; if (divisor == 0) { throw new ArithmeticException("Divide by 0"); } if (remainder > 0 && divisor = divisor) { remainder -= divisor; count--; } } else if (remainder 0) { remainder *= -1; while (remainder >= divisor) { remainder -= divisor; count--; } } else if (remainder = divisor) { remainder -= divisor; count++; } } else { while (remainder >= divisor) { remainder -= divisor; count++; } } return count; }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; }

### Web Development Engineer at Amazon was asked...

Jun 17, 2013
 Vertically and horizontally center an element on the screen using css. 8 Answers#center{ width: 100px; height: 50px; position: absolute; left: 50%; top: 50%; }wrong answer. u need to also margin it negative#center{width: 100px; height: 50px; position: fixed; top: 0; left: 0; right: 0; bottom: 0; margin: auto;}Show More Responses#center{ width: 100px; height: 50px; position: fixed; left: 50%; top: 50%; margin-top: -25px; margin-left: -50px; }Flexbox. Flexbox is the answer. If you need older browser support you can make it happen with faking-table layout using CSS "display: table;", you can then use the "vertical-align" property. .centered-content { display: flex; align-items: center; justify-content: center; box-sizing: border-box; } .centered-content .centered-item { max-width: 50%; /* Really only here to not max-out the horizontal centering effect. */ box-sizing: border-box; }. container{ Position : absolute; Width : 200px; Top : 50℅; Left : 50℅; Transform : translate(-50℅) }
div { width: 100px; height : 100px; background: #d0d0d0; position: absolute; top: 50%; left: 50%; transform : translate(-50%, -50%); }
#centre {margin : 0 auto; width:100%;height:100%}

### Engineer - QCS Server Web Applications Development at Qualcomm was asked...

Jan 26, 2011
 How to discover if the given number is Power of 2 ? 4 Answers10=2 100=4 1000=8… Caught the thing .. he didn't like my implementation. don't be nervous!return (( x!=0) && (x & (x -1) == 0)) a number which is power of two will have single 1 in binary representation ex. 16 00010000 x-1 will have pattern 00001111 hence x&(x-1) will always be 0 for power of two numbers. Need to check condition for x!=0 since 0 is not a power of two. Special case to handle.if you can figure this out inside an hour, congratulations this isnt something that should be in an interview to be honest the level of difficulty of the answer that algo came up with is at the level of an upper division course that has a proof of it written in wikipedia i honestly like the brute force solutionShow More ResponsesDivide the number by 2, and repeat, until the result is a not an integer number (in this case is not a power of 2) or the result is 1 (in this case the number was a power of 2).

### Engineer - QCS Server Web Applications Development at Qualcomm was asked...

Jan 26, 2011
 Binary tree , left node has smallest value . Print 5 10 20 25 and then “count of nodes=4”… 2 Answersrecursion ... defined "current=head" in the method so it doesn't changes ofcourse, even if I sent current.next in recursion... don't be nervous!Did not get this question? Could you please eleborate it more?

### Web Development Engineer at Amazon was asked...

Feb 25, 2012
 A simple CSS positioning question that starts with an independent widget (like a start rating widget)1 AnswerThey will evolve and complete it till you start breaking and loosing it to see how far they can push you.

### Web Development Engineer at Amazon was asked...

Feb 25, 2012
 Write a JS code to travers the DOM and find an element with a specified class name1 AnswerStart simple. They will try to push you to optimize it (O(n) vs O(log n), recursive etc). Be aware of edge cases. Depthvs breadth)

Jun 24, 2011
 Given 2 images in HTML markup: how would you position the lower above the upper in CSS?1 AnswerUse positive margin-top on the first image, and a negative margin-top on the lower image.

Jun 24, 2011
 In jQuery, describe how the selector syntax works for the click function.1 Answer\$('element').click(); induced a click event. \$('element').click(function () { }); handles a click event.

### Software Engineer/Web Developer at Six Fried Rice was asked...

Mar 15, 2010
 HAVING clause ?1 AnswerI used it before but couldn't recollect it that time

### Software Engineer (Web Developer) at Yelp was asked...

Feb 22, 2015
 Second question was not really a question but a very healthy session of pair programming where I was speaking and a senior developer was coding. He chose JAVA and we were creating a list data-structure (with add, count, delete) operations. The catch was that we were going to do it TDD style. So I guided him on what kind of test we can write and how to pass that test and so on. We kept doing it and in 45 minutes we had a very well tested working list data structure.1 AnswerI had previously done complete projects TDD style so I found it really fun.
110 of 52 Interview Questions