Whiteboard Coding Interviews: 6 Steps to Solve Any Problem
Question 2: What do you know about scopes?
Scope is an important topic that can be troubling for some JavaScript developers. To test your knowledge, recruiters may ask open-ended questions like the one in the “What do you know about scopes?” or more specific ones, such as “What are the differences between declaring a variable with var, let, and const?”
You may also need to determine the output of a code, considering scope types, closures, and hoisting:
Since variables declared with let are block-scoped, x is only available inside the loop, and the console.log outside the loop will throw an error.
If you had difficulty with this example, you should brush up on your scope knowledge. If you haven’t mastered the basic JavaScript mechanics, it may negatively affect your interview score.
2. Aliasing – Pointers & ReferencesIt is not a revelation that an amazingly high number of professional developers have a lot of confusion about pointers and references. And I don’t mean
In the interview process, we usually ask candidates to answer a simple programming problem-solving question that involves pointers/references, like manipulations on single-link lists. As much as we rarely deal with direct lists manipulation nowadays, we believe it shows whether a candidate can deal with real-life scenarios where multiple levels of indirection occur e.g. in data models. (And as David Wheeler used to say, “All problems in computer science can be solved by another level of indirection, except of course for the problem of too many indirections.”)
1. Scalability & Optimization
If you are planning to do something big, it will need to scale well in this way or another. A basic understanding of scalability is assessed by an automated Codility assessment.
During the technical interview process, we ask candidates to answer a simple programming problem-solving question which has multiple solutions with different simplicity/scalability trade-offs (e.g. compute prefix sums of a sequence of numbers). We assess whether a candidate notices the scalability aspect and whether he/she can deliver the working solution with better scalability.
Time permitting we probe deeper, asking “can it possibly be done better?” This question opens discussions about possible optimizations, sometimes going down to the hardware level, but also about intrinsic limitations of computing machinery, which greatly illustrates whether candidate a can apply theory to a concrete problem.
Question 4: What are arrow functions?
Interestingly, junior developers may find answering this JavaScript coding interview question easier because arrow functions were introduced with ECMAScript 6 (ES6) in 2015. If you learned JavaScript before that time, you might not be too familiar with more recent features. In contrast, newer developers have probably already learned JavaScript based on ES6.
In a nutshell, arrow functions are a short-form way for writing functions (but there’s a lot more you need to know about them!):
Recruiters expect you to know about crucial changes and updates in the JavaScript ecosystem. After all, they’re looking for developers who build applications in a modern, clean, and sustainable way! So make sure you’re always up to speed.
You might also like: Programming Problem-Solving Interview Questions You Should Ask