4 Types of JavaScript Questions in a Technical Interview
One of the most confusing parts with technical interviews is knowing what is going to be on it. Most people have no clue as to what to study for when preparing for their technical interviews. This is because the types of questions depend on various different factors such as the job that you are applying for, the amount of experience you have on your resume, the type of company you want to work at, and many more.
In this article, we’ll be going over the 4 different categories of questions that you will encounter during a JavaScript technical interview.
After doing over 100 different technical interviews, I noticed a pattern that every single company follows. I realized that there are really only 4 categories of questions in which an interviewer can ask you during a technical interview. The four categories are as follows:
- Category #1: Conversational(Verbal) Technical Questions
- Category #2: Written Technical Questions
- Category #3: Algorithms and Problem Solving
- Category #4: Practical / Build-Me-Something
Knowing Your Fundamentals First!
Before looking at the 4 categories of questions, it’s important to note that the type of job we are interviewing for. A Backend Developer will need to know things are that different from a Frontend Developer. An Embedded Systems Developer that specializes in C++ will have a technical interview that is far different from a General Software Engineer or Web Developer. As stated before, I will be focused on the JavaScript-based technical interviews, but this can be generalized for other types of technical interviews as well.
These are the fundamental skills you need to brush up on if you are interviewing for a JavaScript-based role:
- HTML
- CSS
- JavaScript
- Node.js
- General Web Knowledge like security and performance
- Framework (React.js, Angular, Vue, etc...)
Category #1: Verbal Technical
The first category is what I call conversational or verbal technical types of questions. These questions usually involve the Interviewer asking the interviewee (you) things such as:
- Definitions of concepts in your own domain.
- Comparing and contrasting different ideas.
- Core fundamentals of the language or technology of your choice.
Here are some examples:
- Explain what prototypical inheritance is in JavaScript?
- Can you tell me the advantages and disadvantages of using React.js?
- What are the different primitive types in JavaScript?
Verbal / conversational technical questions are usually there to "just break the ice" and for the interviewer to get a feel for “if you know your shit”. Some interviewers might just end the interview in 5 minutes if they see that the interviewee clearly doesn’t know what he is talking about. This one of the easier parts of the technical interviews (I find) because they are the easiest to prepare for. I usually find that most interviewers will ask roughly the same questions, simply because they are just so simple and anyone can just "memorize" a bunch of them without really knowing how to code. But don’t get me wrong, some people (like me) will grill candidates hard on the verb portion. I’ve also had some interviews where the entire hour was just having a deep technical conversation between me and the interviewer.
My suggestion as to how you can prepare for this portion of the interview is to just google "JavaScript Interview Questions" and try to do a bunch of them. You’ll find that you might have gaps in your knowledge and struggle with either explaining certain topics or have never encountered certain questions or concepts before in your life. Try doing a bunch of "Top 100 JavaScript Interview Questions" and make sure you get enough practice by doing a bunch of them. Of course, if you find any gaps in fundamental knowledge, make sure to address them and properly learn the concepts, because this isn’t a memorizing exercise, you actually have to know what you are doing.
Category #2: Written Technical
The second category of interview questions is the written technical. These sort of questions are a step up from the verbal questions, but not interactive as say writing an algorithm on a whiteboard. The key thing here is tracing through a block of code. What usually happens in this case is that the interviewer will either come with a block of pre-written code or write some code on the whiteboard and ask you to debug it.
Take this for example:
const x = 10
if (x > 5) {
x = 11 y = x
}
console.log(x)
console.log(y)
The questions would then be something like:
- What is wrong with the code here?
- What is the output of the code?
- Will this code compile?
- How can you refactor this block of code?
- What are some test cases you can write for this block of code?
I don’t usually practice this portion of the technical, I just try to remember to: make sure to trace through every line of code during the interview and explain my own thought process. This type of question is usually just looking to see your attention to detail. Since verbal questions can be a lot more ambiguous, written questions are purposefully used to slow down the pace of the interview in order to see if the interviewee truly knows the minutiae of the problem presented before him.
Category #3: Algorithm / Problem Solving
Now, the most hated types of technical interview questions, ahh yes… the algorithms portion. I’m going to get straight to the point here. Unless you are interviewing for Google or Apple, you do not need to know algorithms in depth. You do not need to know how to balance an AVL tree, reverse a complex skip-list, or how to do complex dynamic programming problems. From my personal experience interviewing at more than 100 companies, 95% of the time, a company that is outside of the Bay Area will not ask you complex data structure and algorithms problems. If they do ask them and you are not prepared, then just let it go, you were unlucky.
What I focused on was knowing the strings and arrays API in JavaScript well. This means you know how to use functions like:
- Array.slice
- Array.splice
- Array.push
- Array.pop
- Array.concat
- String.substr
- String.length
- String.includes
- Etc…
Also, make sure you are comfortable with using objects, and know how to loop through arrays and objects along with their key/value pairs without having to google for them.
And needless to say, make sure you know the most common/basic constructs of JavaScript like if statements, for loops, variable declaration, etc...
The best way to practice is to go on Leetcode and do all the easy strings and arrays problems. I find that doing about 50 - 100 questions is more than enough to be prepared for 70% of all the interviews.
Category #4: Practical / Build-Me-Something
Last but not least is the Practical / Build-Me-Something category. This is probably the most common type of question that will appear in an interview, especially for frontend developers.
There are mainly 2 ways for the interviewer to evaluate you with this type of question.
The first is to give you a take home assignment, which you will complete in a certain amount of time. Afterwards, when you move forward during the interview process, the interviewer will ask you about the code.
The second, from my experience is less common, but appears if you are applying for senior or technical lead positions. It's when you are asked to code some sort of application on the spot. The interview might let you do it in the framework of your choice like React or Angular, or might just force you to do it in Vanilla JavaScript.
And if you are wondering are some of the most common things that I have seen in an interview, they are:
- Todo list
- Progress bar
- Navigation Bar
- Infinite scroll (with backend API)
- Anything that involves a frontend and backend
Notice how these are not complex applications, they are just small simple throw-away-applications that can be completed within a couple of hours. Do note that some interviewers will allow googling and some will not. From my experience, the ones who do not allow googling are quite reasonable and will make the question a lot easier.
Conclusion
There you have it, 4 of the most common types of technical questions that can appear on a JavaScript interview. Now that you know these 4 categories, make sure to start studying so you can ace your next interview!