JavaScript Interview Questions

Basic JavaScript

  • Give a high level overview of how JavaScript interacts with the DOM.
  • What are some different ways that JavaScript code can be embedded into or linked into an XHTML page?
  • Are objects passed by value or by reference? Does the type of object matter?
  • Is JavaScript an object-oriented language? Why or why not?
  • What is your favorite way to debug JavaScript?
  • What is JSON? What are some common uses of JSON?
  • What is the difference between undefined and null?
  • What does the isNaN() function do?
  • What will the following code do?
    function printMe() { var b = 5; alert (a+b); }
    var a = 3; var b = 2;
    printMe();
    alert(a+b);
  • What is a for…in loop?
  • What is the difference between window.onload and onDocumentReady? Which are you (typically) more likely to use?
  • What are a few different ways to attach handlers (e.g. click, blur, etc.) to a DOM element? Are any better than the others?
  • What's unique about functions in JavaScript? (The answer you're looking for here is that they're first class objects; e.g. you can pass a function as an argument to another function, just like you could pass an object. Explore this concept with the interviewee to see how much they know.)
  • What's an anonymous function?
  • What is JavaScript namespacing? Why would you want to use it?

jQuery

  • Basic: what is jQuery?
  • How do you select a DOM element (or elements) in jQuery?
  • What does it mean to chain functions in jQuery?

Discussion

matt jaft, Feb 4, 2012 07:18 AM

thank you

Lorna Richards, Mar 5, 2012 06:10 PM

This would be a great deal more useful if you actually included a discussion of the suggested responses.

David Ordal, Apr 4, 2012 02:21 AM

Lorna-

Thanks for your comment. I've left the responses out on purpose; these questions are designed to trigger ideas for things an engineering manager might ask. If someone can't answer them themselves, IMHO thier best bet is to find an engineering friend who can and have them do the technical part of the interview. Most 'canned' responses, like you find on some other sites, don't really help unless you understand the intricacies of his the tech works.

D

Chris, Jun 27, 2012 05:34 PM

That's pretty annoying. I'm trying to study up for an interview and now you've added another hour or so of research to my crash course. I'd have to agree this is a little useless, at least for my purpose.

Sunil Gupta Akula, Apr 9, 2012 09:53 AM

Hello David,

If possible post the answers too. Only questions will not helpful, again the person to search the answers by googling.

By posting the answers for the particular question which he can read and grasp there itself.

Thanks,
Sunil.

people/hr/good-technical-interview-questions/javascript-questions.txt · Last modified: Aug 20, 2010 06:22 AM by dordal
© 2005-10 David Ordal / DO IT, LLC. All Rights Reserved.