# 616

Front End Web Developer interview questions shared by candidates

## Top Interview Questions

Sort: Relevance|Popular|Date
Front-End Web Developer was asked...August 8, 2011

### "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

### 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

### 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

### 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.

### 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.

/* 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 &lt;= 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 &gt; delay) { fn.lastRun = new Date().getTime(); return fn(); } else console.log("wait"); } document.addEventListener("scroll", throttle.bind(null, fn, delay)); Less

### Elaborate on quirks of box-model margin and padding

Explain the use of VW in CSS sizing as opposed to percentage.

Percentage can be affected by a parent where vw looks at visible width. Vw is newer and has limited support in legacy browsers Less

### Coding challenge was to integrate the Imgur API and create a view of all the images in a thumbnail displaying few metadata fields of each image/video. Another view was to display the original image/video with all the metadata relevant to it.

I created the application in Angular 8, along with RxJS, HTML5, CSS and BEM pattern. Implemented few other concepts like Angular Routing and Proxying API calls. Also, i published the application on GitHub pages Less

I'm also into Angular, can you share the link to your code challenge solution? Why did you deny the job offer if you could solve it just fine? Thank you! Less

### Name front end technologies and frameworks you use

I listed my preferred technologies, they use vue.js and tailwind.css

i use Laravel framework

Viewing 1 - 10 of 616 Interview Questions