# Front end web developer Interview Questions

"During an interview for a front end web developer position, be prepared to be heavily tested on your technical knowledge of HTML, CSS, and JavaScript and their available tools, as well as you general programming knowledge. To be an outstanding candidate, a strong portfolio of previous front end work and a bachelor's degree in computer science or equivalent work experience will be expected. "

# Front end web developer Interview Questions

"During an interview for a front end web developer position, be prepared to be heavily tested on your technical knowledge of HTML, CSS, and JavaScript and their available tools, as well as you general programming knowledge. To be an outstanding candidate, a strong portfolio of previous front end work and a bachelor's degree in computer science or equivalent work experience will be expected. "

616 Front End Web Developer interview questions shared by candidates

## Top Interview Questions

Sort: Relevance|Popular|Date
Front End Web Developer was asked...February 23, 2010

### What is a JavaScript callback function?

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

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 Less

Is there a front end role at bloomberg. I guess your position must have been labelled software dev right? altho ur a dront end dev Less

### Given a number n where n+1 and n-1 are prime, prove n is divisible by 6

n+1 is prime, n+2 is prime... all prime numbers are odd, so n must be even (i.e., divisible by 2) in any set of 3 numbers (consider 1,2,3 or 4,5,6 or 20,21,22) at least one number is divisible by 3. since n+1 and n+2 can't be divisible by anything, n must be divisible by 3. therefore n is div by 6 Less

### Say there was a function that took 1 second to execute and you needed to run this function 10 million times, how would you cut down on the execution time?

Build a system that would run the functions concurrently.

### If we wanted to implement a method of tracking every click that the user made on the site, how would we want to do this?

Place a JavaScript event listener for all clicks at the document level. Perform actions based on the details of the click. This problem had multiple branches and sub-questions, but the gist is that you would want to capture the events as they bubbled back up to the document level. There are other acceptable answers to this question. Less

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

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

IDE, Build Tools, Version Control!

Git, Codio, and Netflix

### How many characters in the front of a string would need to be added in order to make it a palindrome.

Here's a python solution: def min_add_for_pal(word): drow = word[::-1] # Reverse string if drow == word: return 0 for shift in range(len(word)): if word[:-shift] == drow[shift:]: return shift return None # Shouldn't reach here Less

A better asnwer is to do it in-place with pointers. O(N) speed and O(N) space. function checkPalindrome(i, input){ var leftPointer = 0; var rightPointer = 0; if(i===0){ //base case of single char return true; } var odd = (i+1)%2; //we know it's not 0 if(odd){ leftPointer = i/2; //not 0 rightPointer = i/2; //not 0 while(input[leftPointer] === input[rightPointer] &amp;&amp; leftPointer &gt; 0 &amp;&amp; rightPointer 0 &amp;&amp; rightPointer &lt; input.length){ leftPointer = leftPointer - 1; rightPointer = rightPointer + 1; } } if(input[leftPointer] === input[rightPointer] &amp;&amp; leftPointer === 0){ return true; }else{ return false; } } var improvedMinPalindromeAddition = function(input){ var inputArray = input.split(""); //max string size is greater then max array size(4.29 billion elements)..we could also do it inline w/string manipulation var largestPalindrome = 0; for(var i=0;i Less

function isPallindrom(str) { if (!str) return; let start = 0; let end = str.length -1; while (start start) { console.info(str.substring(0, end)) if (isPallindrom(str.substring(0, end))) { return count; } else { count++; } end--; } return count; } Less

### Imagine you had three boxes One contains two black marbles One contains two white marbles One contains both a black and a white marble Each box was labeled with their correct contents (BB, WW, BW). However a malevolent intern has swapped the labels so that they are all incorrect. You are allowed to take one marble out of a box and look at it, without looking inside. Using this method, what is the minimum number of draws you need to determine the contents of all three boxes?

If you can't answer this in the time they give you (I got 5 mins) not only are you dumb asf and obviously not good at the skills you say you have, but you're also not suited to be a member of the elite Ad Exchange Group. Less

A more positive, supportive answer then the previous. The key to this riddle is that all three boxes are labeled incorrectly. You should pull a marble from the box labeled "both". Whatever color comes out, lets assume black, you then know with certainty that this box should be labeled "black,black" since all boxes are labeled incorrectly. That leaves you with one box with no label, a label for "both" no longer attached to a box, and a box labeled "white,white". Since all boxes are labeled incorrectly, the box labeled "white, white" must be wrong and changed to "both". Then the "white,white" label goes on the other box. In summary form, all you need to do is pull one marble. Less

### What are Closures?

HTML design questions

What was in machine test?

CSS, inside the head tag: JS, usually at the bottom of the body tag but still inside it: Less

I talked through it. Couldn't remember the exact syntax off the top of my head.