Brush up on your knowledge of variables, data types, functions, loops, conditionals, and objects.
Preparing for an interview isn’t fun! In fact, it’s probably the least fun thing about being an engineer.
In fact, it’s something I tried to avoid for most of my career. But I had to face reality in 2019 when I got laid off suddenly.
I also had to work remotely at the time and there weren’t a ton of remote jobs available. I spent every day prepping for coding interviews. I always treat my job search like it’s my actual job! And that was quite a bit easier when you literally do not have an actual job and you have to pay rent in San Francisco next month!
I was able to find an incredible remote job that taught me so much. It completely changed the trajectory of my career and it was the first time where I felt I really deserved my senior title.
And now I want to help you crush your JavaScript coding interview.
Don’t skip the basics!
A JavaScript interview may include questions on HTML or CSS. Sure, an interviewer is not going to go in depth about HTML and CSS, but you want to feel comfortable at least being able to look at an element in the DOM for example! You don’t want to be caught unaware if someone asks you how to look something up in the DOM!
So… Brush up on your understanding of the Document Object Model (DOM) and its manipulation using JavaScript.
Here’s a list of the basics before an interview!
HTML:
CSS:
DOM:
And don’t forget about the JavaScript basics as well!
Review your JavaScript Basics
Start by revisiting the fundamentals of JavaScript..
Brush up on your knowledge of variables, data types, functions, loops, conditionals, and objects. Sometimes we write so much React that we forget the basics!
What if you’re asked in an interview to solve some simple JavaScript functions without a framework? Are you going to be able to do it? That’s what practice is for!
Here’s a list of the things you should review:
And make sure you feel comfortable answering questions. For example, with the 'this' keyword, which refers to the object or function that invokes it, could you answer the questions below?
2. What is the difference between global scope and local scope? Provide some examples.
3. How does lexical scoping work in JavaScript? Can you describe its benefits?
4. What is the purpose of the 'let' and 'const' keywords introduced in ES6? How do they differ from 'var' in terms of scoping?
5. Discuss hoisting in JavaScript and how it can impact variable scope.
Make sure you are also comfortable in JavaScript's built-in functions, such as map, filter, and reduce, and familiar with concepts like closures, promises, and async/await. Review array methods and understand how to manipulate arrays effectively as well. Long story short, just be comfortable!
Here are a few concepts to review:
Additionally, make sure you have a basic understanding of RESTful APIs, HTTP methods, and how to make asynchronous requests using JavaScript's Fetch API or Axios.
Which brings us to another concept to review.. Async JavaScript!
Don’t wait on your Asynchronous JavaScript prep!
Asynchronous programming questions might be asked in a JavaScript interview! And you don’t want to feel like you’re not solid on the concept.
Revise the concepts of callbacks, promises, and async/await for your interview. Even 15 minutes a few times a month can be helpful!
Data Structures and Algorithms
JavaScript interviewers often assess candidates on their ability to solve complex problems. Familiarize yourself with data structures, like:
Here are a few questions you might see in a coding interview focused on JavaScript:
Practice solving coding challenges on platforms like LeetCode and HackerRank to improve your skills for an interview. Once a week, can you turn Netflix off and do 1-2 questions? I think you can! Let’s be honest, you’ve already watched Grey’s Anatomy season 3.. Three times in fact.
And while you’re working on solving the interview questions, talk out loud! This will help you to feel comfortable explaining your thought process during the actual interview.
Pick a framework
It’s pretty rare these days to go in for an interview and expect to not know some type of frontend framework and be able to solve problems with it.
Pick one framework like React, for example, and be extremely comfortable in writing components, debugging, and solving problems with it.
Testing
Sometimes you might be expected to debug the bug in Javascript. At the bare minimum, you want to be able to read a Javascript test and feel comfortable at least with one testing framework.
If you don’t feel comfortable with testing, set up automated unit testing using frameworks like Jasmine, Mocha, or Jest in your own side project to learn.
Remember, interviews also assess problem-solving, communication, and critical thinking skills, so be sure to showcase your thought process and explain your decisions clearly.