Skip to main content

Technical

That Time I Flunked my JavaScript Technical Interview: Some Tips from Personal Experience

Man on mounted desktop computer working.

As the title suggests, this article is about those times that I did not land the job that I was applying for because I did not know the answer to a particular question.

It did not mean that I was bad at my job or that I did not know JavaScript. I have been using it almost every day since I became a software engineer. So, what went wrong? In this article, I will tackle some of those problems where I have struggled as well as some common questions asked to candidates applying for JavaScript related positions (Front-end, Back-end, or Full Stack).

Knowledge of Concepts

The way companies get a feel for how experienced a candidate may be is by asking very specific questions about core concepts of the programming language that the open position requires. Below are some concepts that I have been asked about during interviews.

Closure, Timeouts, and Scoping

According to MDN web docs (2020), “A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment)”. In simple terms, this means that variables and properties inside a function are exclusive to that function, but the function can have access to outer properties.

Simple enough, right? But the real challenge comes when the interviewer asks you something like this: in the code below, what would the output be for the following?

for (var i = 0; i < 3; i++) {

setTimeout(function() {

console.log(i);

}, 3000);

}

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Arturo Estrada

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram