React Interview Questions — for the interviewer

Julius Koronci
7 min readApr 11, 2021

--

Finding the right people with the right skills, the right personality, solid experience and good attitude is an incredibly difficult task.

Nowadays, everyone can write some code, so the first challenge is to find people with some skills. The fact that developers have some skills, can solve some algorithms still doesn’t mean that they can build applications. If we are building something small or we are a startup we can ignore the lack of experience but if we are building an enterprise application we need people with experience, people who understand the difference in complexity, have already experienced the pain of technical debt etc. They should have a strong focus on clean code, understand why a function which has more than 15 lines of code or have nested ifs can cause issues in 1 year, understand that we are writing code not for ourselves but others to read and our future selves etc.

In this article we will be focusing on senior developers and enterprise applications so we can understand the requirements on people better.

So what is a senior developer?

Someone who has at least 7 years of experience, why?

  1. Because nothing can replace experience, you just have to go trough the pain of building and delivering applications to understand certain concepts.
  2. You have to feel the pain of technical debt.
  3. You have to suffer trough delivery deadlines,
  4. You have to suffer trough conflicts in your team.
  5. You need to mature and be able to have some empathy.
  6. You need to learn to say no. Your PM or boss comes to you and says we need it after tomorrow. A senior developer should be able to say sorry but I will need 2 weeks to deliver it. Your PM says, skip the tests and quality for now and a senior developer should be able to convey that, no we are not making shortcuts about quality because it always will bite back and we will not gain any time by compromising on quality.

Depth of knowledge

There is a few ways to split developers

  1. Junior developer — is someone who need overseeing and constant control and guidance. It can be a person who is just starting his career, someone who knows about things but not necessarily knows how to do them or it can be the Ninja developer who thinks he knows everything the best and if you let him be, he goes into writing his own OS or programming language just to create an HTML form.
  2. The mid level developer — has some experience, know how to do things but still lacks the knowledge of why to do things
  3. The senior developer — knows why to do things, has a broader knowledge of technologies, has experience with multiple programming languages, knows about builds and pipelines, CI/CD, has an understanding of design patterns and software architecture.

So the senior developer knows why to do things, it means he has a deep knowledge of React and JavaScript. He understands the workings behind the scene, understands the engine, the compilation phase, how the DOM works in the browser, he understand the reasons for decisions made by the Facebook team, understand why solid test coverage is so important and so on.

Team work

With a group of senior developers the debates about personal preferences and opinions is a never-ending fight. A senior developer should be able to suppress his ego for the good of the team. A senior developer should be able to present his opinions without insulting or making others uncomfortable. Since he has deep understanding he is able to argue why and not just saying because I think so or because this famous guy said so. Senior developers should able to think ahead, understand the weaknesses of their team and make up for it. For instance, if I know we will have a bunch of junior devs on the team, we will have a lot stricter quality guidelines and we will avoid wiring way too abstract code even though it will restrict us a little. We can leverage the lack of skills of junior developers to improve our delivery just by planning accordingly. Sometimes people just give some irrelevant task to the junior guy to not be bothered but a senior developer has many boring work he needs to do so if he spends some time teaching, he can benefit even from a person with a lack of knowledge and experience and help him grow.

The interview questions

Since we made some assumptions about senior developers we can prepare focused questions to verify the knowledge, skills and experience of the candidate.

After introductions I prefer to inform the candidate there is no tricky questions, we are looking for his opinions, experience and understanding. I also like to mention that it is ok to say if he doesn't know the answer.

I prefer to start with the following question:

In your opinion what are the skills and experience a senior react developer should know and have. What is it you would be looking in a candidate.

This question gives a lot of space for the candidate to showcase his experience, the closer he gets to our definition of senior developer the better. We are looking here for the big picture answers not a list of programming or algorithm questions.

What are design patterns? What is your favorite design pattern? How would you explain the adapter design pattern?

Every senior developer will come across design patterns in his career, it is something which can not be avoided. Design patterns are solutions for common problems, their knowledge and understanding is crucial for problem solving.

The adapter design pattern is a very good one to test the problem solving skills of a developer. The likelihood that someone knows it is high but even if someone doesn't know it it a very good way to verify his understanding by letting the candidate to figure the pattern out on the interview.

DRY, SRP, KISS, YAGNI, Separation of concerns or SOLID principles

It is a good idea to have a chat about these basic principles to see what opinions the candidate has. Whether he understands the importance of these principles. We can verify here, how important the candidate finds clean code and its benefits for the future of the application.

What kind of programming language is JavaScript

We are looking for 2 things here, the fact that JS is a compiled language and how this compilation works and we are also looking for understanding the OOP part of JavaScript but also the fact that it fully supports functional programming.

Functional programming, what it is and why is it important?

Since we are hiring a React developer and react is a functional library it is important for the candidate to have some understanding of it. We are not looking just for shallow knowledge of what is a pure function, we are looking for understanding of the principles and what the approach brings to the table. Why the Facebook guys decided to go down this way etc.

Explain why there is hoisting in JavaScript

Here, we are not looking for how hoisting looks like but why there even is hoisting in the programming language, we are looking for an understating of the lexing phase during compilation. This is not something every developer should necessarily know but it is a good way to test the thought process and also see how developers react if they don't know something. If they will just admit it like they should or they will try to talk their way out of it :D

What is the difference between function declarations and arrow functions

This closely connects to the hoisting question and we are looking for an understanding of the difference between execution context and lexical context.

Explain how async code works behind the scenes

Here we are guiding the candidate towards the event loop and JavaScript engine.

Explain the virtual DOM and reconciliation algorithm

We are verifying the depth of knowledge of React, a senior developer should be interested in the inner workings not just how it should be used

New features in latest react version

Being a software developer is constant learning it is very important to be up to date and engaged

What is in your opinion a good architecture for an enterprise frontend application?

Enterprise applications are applications developed over years by multiple developers, they consist of several modules, packages multiple feature etc. so organizing such a project is an important skill and shows some experience.

How would you approach this code review example?

We have a PR open with a function which has several nested ifs. One of our team mates says that nested ifs are code smell and we should refactor this function. Another team mate says, this function is small and focused so it doesn't matter if we have a couple of nested ifs and readability is not that bad.

This looks at multiple aspects, first we verify the understanding if importance of clean code. The broken window principle, the frog in the well or just like my father in law used to say, 1 euro times 10 000 is 10 000 euros. If the candidate understand that even though in the scope of this small function the nested ifs really don't matter but in the bigger picture it is very important to keep the code clean because the mess will just grow. others will follow, refactor will just glue some other mess to it and we built a habit of not writing clean code in the first place. The butterfly effect after one year for small code messes is huge and everyone with experience understands it.

Do you comment your code? Why is it a code smell?

With this question we are looking for a little provoking, we want to get the candidate a little bit flustered and get him into a small argument to see how he reacts. OFC code comments are a failure to express yourself with code, developers understand how code works and if a piece of code has such high complexity that we need to explain it in comments, it needs refactoring. Also feature requirements should be kept in documentation updated by our BA and so forth but no matter what the candidate says we should try to poke him a little :). We are leaving this question as the last one, because we don't want to get our candidate nervous from the start, there is just a few people who are able to manage an interview while anxious or flustered.

Hope this gives some guidance to people who are doing interviews and are looking for some inspiration and ofc it can also give a good idea for candidates what they should prepare for. For more concrete technical questions you can check my other article: https://blog.usejournal.com/react-interview-questions-13f8839f2711

--

--