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

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
Bloomberg L.P.
Front End Web Developer was asked...February 23, 2010

What is a JavaScript callback function?

5 Answers

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

Show More Responses
IXL Learning

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

1 Answers

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

Lab49

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?

1 Answers

Build a system that would run the functions concurrently.

LinkedIn

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?

1 Answers

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

PE International

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

5 Answers

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

Show More Responses
Pinterest

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

4 Answers

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] && leftPointer > 0 && rightPointer 0 && rightPointer < input.length){ leftPointer = leftPointer - 1; rightPointer = rightPointer + 1; } } if(input[leftPointer] === input[rightPointer] && 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

Show More Responses
Ad Exchange Group

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?

2 Answers

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

Mobikasa

What are Closures?

2 Answers

HTML design questions

What was in machine test?

FamilySearch.org

Could you link your CSS and JS file to your HTML document?

2 Answers

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.

Google

Asked me to write a throttle function in javascript. Well, essentially...he wanted me to write a function that would call another function, but not if it had been called within a certain set time, which is essentially what a throttle function is. I completely flailed, but it's a useful function to have...probably why they put it in the underscore library which is what I based this answer on.

2 Answers

/* var handle = setTimeout[myFunction, 5000); // Do this before it runs, and it'll never run clearTimeout(handle); */ // async(queue calls) or sync(and throw calls away while executing) var lastTime = new Date().getTime(); function foo() { var newTime = new Date().getTime(); var gap = newTime - lastTime; console.log('foo called, gap:' + gap); lastTime = newTime; } //Calls it immediately the first time and throttles it on subsequent calls //Non-queueing so calls during throttle period are ignored throttleFunction = function(func, wait) { var args, result; var timeout = null; //timeout call that acts as a flag var previous = 0; return function() { var now = new Date().getTime(); var remaining = wait - (now - previous); //how much time is left on wait args = arguments; //just pass along the args if (remaining <= 0) { clearTimeout(timeout); //reset Timeout function call timeout = null; //reset timeout variable previous = now; //reset time so we know when the last time function was called result = func.apply(this, args); args = null; //reset args } return result; }; }; document.addEventListener("scroll", throttleFunction(foo, 2000)); Less

// Can't we just add a flag on the throttled function itself? function fn() { console.log('run at', new Date().getTime()); } function throttle(fn, delay) { if (!fn.lastRun || new Date().getTime() - fn.lastRun > delay) { fn.lastRun = new Date().getTime(); return fn(); } else console.log("wait"); } document.addEventListener("scroll", throttle.bind(null, fn, delay)); Less

Viewing 1 - 10 of 616 Interview Questions