Possible JavaScript Interview Questions for Developers
Technical interviews can be scary if you don’t prep ahead of time.
So how do you prep for a technical interview? Everyone has their own way to prep, so I will just mention how I prepped. Spoiler alert, I didn’t do a lot of prep.
When I started interviewing, I was still in bootcamp, so I was busy with learning and keeping up with my lessons and projects. Thus, I didn’t go straight into data structures and algorithms, which was apparent in one interview for an internship.
I felt like crap afterward. I thought it was a mistake to transition into tech. But I continued to work on my JavaScript fundamentals, and I landed an offer two months later, right when I was finishing up with the React/Redux portion of the bootcamp. Of course, DSA is important but so are the fundamentals, so this article will mostly list possible questions for JavaScript fundamentals.
Resources
Besides the book that is raved by almost every software engineer, Cracking the Coding Interview*, which mostly focuses on DSA, there are also simpler questions that focus on the fundamentals.
MDN is a great resource to use if you’re ever stuck with syntax or just want to see if a certain method already exists. This is my go-to resource and most of the answers to the possible questions can be found on MDN.
I also find myself using W3 Schools, although it’s usually for CSS.
There is always the OG site for JavaScript, which also has a resources section.
Forcing yourself to remember the answers is one way of doing it, but I’ve learned that in order to be able to better recall information, it’s best to learn it. It sounds simple enough, right?
There is no need to memorize things when search engines are just a click away, but learning something is helpful for interviews. Playing around with concepts in a sandbox environment is my go-to way of learning a new concept. Luckily, for JavaScript developers, you can also just use the browser as your sandbox!
Possible Questions
- What is the difference between
undefined
andnull
? - What does the
&&
operator do? - What does the
||
operator do? - Is using the
+
(unary plus operator) the fastest way in converting a string to a number? - What is the DOM?
- What is event propagation?
- What is event bubbling?
- What is event capturing?
- What is the difference between
event.preventDefault()
andevent.stopPropagaton()
methods? - How to know if the
event.preventDefault()
method was used in an element? - What is
event.target
? - What is
event.currentTarget
? - What is the difference between
==
and===
? - What does the
!!
operator do? - How to evaluate multiple expressions in one line?
- What is hoisting?
- What is scope?
- What are closures?
- What are the falsy values in JavaScript?
- How to check if a value is falsy?
- What does
use strict
do? - What’s the value of
this
in JavaScript? - What is the prototype of an object?
- What are the new features in ES6?
- What is the difference between
var
,let
, andconst
? - What are arrow functions?
- What are classes?
- What are template literals?
- What is object destructuring?
- What are ES6 modules?
- What is the
Set
object and how does it work? - What is a callback function?
- What is a promise?
- What is
async
/await
? - What is the difference between the spread operator and the rest operator?
- What are default parameters?
- What is AJAX?
- What are the ways of making objects in JavaScript?
- What is the difference between a function expression and a function declaration?
- What is the difference between the
Object.seal()
method and theObject.freeze()
method?
The list of possible questions is endless and it’s okay if you don’t know how to answer a question. It’s always better to be honest than to lie or pretend.
If you want to prep for the behavioral interview, I have an article for that as well.
If you want to expand your knowledge, consider reading Free Coding Courses for Landing Your First Dev Job.
I also have articles on:
*affiliate link