With Only 6 Questions You Can Judge A JavaScript programmer Ability

INTERVIEW QUESTIONS JavaScript Quizzes Tips and Tricks

Please hold  a pen and paper.

 

  1. I have an HTML table with five cells in it. Each cell has a button and a field. You do not have control over the HTML or naming conventions used for IDs, etc. Write an event handler that can be applied to each button which will call a function and write the result of that function to the field that is in the cell of the button that was clicked. Do not iterate over the cells of the table.
  2. Explain to me how OOP works in JavaScript. This is going to involve a conversation about prototype inheritance, closures, and lexical scoping.
  3. Give me an example of something that you would use a closure for – explain the closure you’ve written.
  4. Describe how you would develop a single-page application without using a framework.
  5. JavaScript is a functional programming language. Give me an example of how you can use higher order functions in JavaScript to iterate over and apply a function to every element in an array. Do not use a for or while loop.
  6. I need to be able to store a DOM element so that it may, based on the results of a LATER event be moved from one container element to another. For example, I need to create a button which removes an LI from an OL or UL. The element needs to be stored during the current session so that – based on the result of ANOTHER event, I can then either attach it to the second container, move it back to the first container, or discard it. (I’m interested in their knowledge of scoping in the session.. if they recommend a global, I’ll say ok, if we don’t want to use a global variable what other options do we have? This is not an over difficult question, but it allows you to see how they think when the obvious answer isn’t the best choice).

I don’t expect them to get all of these perfect (particularly #5) off of the top of their head. I want to know that they understand the concepts at a level where they can use them.

(Answers will be posted in next post)

(Visited 38 times, 1 visits today)

Leave a Reply