DEV Community

Cover image for What to Look for in a React Developer? Here are a Few Questions to Ask Them
Devansh Khetrapal
Devansh Khetrapal

Posted on

What to Look for in a React Developer? Here are a Few Questions to Ask Them

Are you looking for a React front-end developer but have no idea how to find the right one? Maybe you’re an entrepreneur who’d like to focus more on the core business operations and don’t have any technical background.. or just a curious reader. Either way, I’m here to help!

With so many websites like Facebook, Airbnb, BBC having been built with React, it’s no surprise that React is the most loved front end framework, as was declared in a survey by StackOverflow

But how do you choose the right React developer for you when there are so many of them out there? Fortunately, we have a list of interview questions for your candidates that will reveal the ones that you’d want to work with. 

But first, let’s make sure you yourself have a clarity on what kind of developer will fit your ideal candidate profile.

Know This Before Hiring a Developer

Your Business Model

What are your revenue models? Do you sell software as a service? If yes, then what kind of solutions does that software offer? Are you a web development company that offers developers to other businesses? Answering all these questions will help you clarify the specific role requirements of the developer. 

Your Budget

Considering what size of projects you’re willing to take up, you have to decide whether you need a single developer or a dedicated development team. Then you have to see what you’ll have to spend to get an experienced developer. Either you’ll have to raise your budget, or settle for a lesser experienced developer who can work within your budget. 

Your Scale of Operations

How long have you been present in the Software Development Industry? How many new clients are you able to gain over a period of 3 months? What size of projects are you able to take up? These questions will help you understand what scale you’re operating at, and should help you decide what kind of developers you need and how many of them.

Questions You Need to Ask a React Developer

Now is when things can get a bit technical. We’ll also let you know the answers to those questions so that you also understand what you’re asking. 

Following are the interview questions you can put forth so as to make sure you hired the right React developer:-

#1 - What is React?

That’s a simple and vague question, but I’d argue that that’s exactly what you need to start off the interview with. The developer’s articulation while answering this will give you a clear idea of how deeply they understand the technology.

Just for reference, here are the answers you should get:-

  • React is a front-end JavaScript library.
  • It was developed by Facebook in 2011.
  • It follows the component based approach that helps in building web applications from reusable UI components.
  • It is used for developing interactive and complex web and mobile User Interface.
  • It was open-sourced only in 2015, yet has one of the largest communities supporting it.

#2 - Difference Between Real DOM and Virtual DOM

React is based on Virtual DOM, but understanding both Virtual and Real DOM is important for a React developer. You may want to understand a DOM if you want to ask this question.

  • Real DOM- It updates at a slow speed as opposed to Virtual DOM.- It can directly update HTML.- It can create a new DOM if the element gets updated.- It’s expensive to do DOM manipulation.- It wastes a lot of memory.
  • Virtual DOM- It updates at a faster speed as opposed to Real DOM.- It cannot update HTML directly.- It updates the JSX if the element gets updated.- It’s really simple to do DOM manipulation.- There is no memory waste in Virtual DOM.

#3 - Advantages of React

If the candidate is experienced enough, they will be able to tell you all the benefits of using React, that will mainly outline around the following points:-

  • It increases the application’s performance and helps deliver a great user experience.
  • It can be easily used on the client as well as server side.
  • Code’s readability is fast because of JSX.
  • It can easily integrate with frameworks like Angular, Meteor, etc
  • It makes it easy to write UI test cases.

#4 - Disadvantages of React

A candidate trying to sell themself as a Reactjs expert must also know its disadvantages. If they’ve worked on several projects, they’ll be able to tell you the hurdles they faced during the process. If you get the responses from the following, you’ll know you’re on the right track:-

  • React is not really a framework, it’s a Javascript library.
  • Since it’s a large library, it takes time to be understood.
  • Can be a bit difficult for the new programmers to start with.
  • Coding becomes complex since it uses inline templating and JSX.

#5 - What is JSX?

JSX is an abbreviation for JavaScript XML. It’s a type of file used by React which utilizes the expressiveness of JavaScript along with HTML like template syntax. 

If the above answer is hard to wrap your mind around, ask them how it is useful, and they should tell you that JSX helps reduce the clutter and makes the HTML file really easy to understand. This file can make applications robust and boosts its performance. 

#6 - Elaborate on Virtual DOM

Virtual DOM is just a copy of the real DOM. It’s a lightweight JavaScript object which is a node tree that lists the elements, their attributes and content as Objects and their properties. 

React creates a node tree out of the React components by utilizing its render function. It then updates this tree in response to the variations in the data model which are caused by various actions performed by the user or by the system.

Here are 3 steps to understanding how Virtual DOM works:-

Step 1: At the time when any underlying data changes, the entire UI will be re-rendered in Virtual DOM representation.

Alt Text

Step 2: After that, the difference between the previous DOM representation and the new one will be calculated.

Alt Text

Step 3: Once the calculations are done, the real DOM will update itself with only the things that have actually changed.

Alt Text

#7 - How is React different from Angular?

A developer must have an understanding of multiple frameworks so that they have reasoning to back their preference of using React over any other framework. One the questions you can put forth in an interview is to ask the difference between Angular and React.

Angular is a structural framework designed to build progressive web apps. It also supports the (MVC) programming structure. Here are some of the key differences between React and Angular:-

  • Purpose: Angular is a structural framework for developing dynamic web apps, whereas React is a javascript library used to build UI components.
  • Architecture: AngularJS is based on MVC (Model-View-Controller) and utilizes Real DOM as opposed to React, which is based on Virtual DOM. Also, Angular is based on Typescript while React is based on Javascript.
  • Data Binding: React allows you to do one way data binding whereas Angular allows for 2-way data binding.
  • Debugging: Angular offers testing and debugging for a complete project with just a single tool while React requires a set of tools to perform different types of testing.
  • Javascript LibraryAngularJS doesn’t provide the ability to add the javascript library to the source code whereas React does allow you to do so.

#8 - Difference between Stateful and Stateless Components

All you need to know about state is that it’s the data that a developer imports, typically to show the user, that is subject to change. Why could it change? Because the database may be updated, maybe the user modified it. There are so many reasons why data could change.

What’s the difference? Well, one has state and the other doesn’t. Quite literally.

The stateful components keep track of the changing data, while stateless components print out what is given to them via props, or they will always render the same thing.

If a React developer has years of experience, they’ll understand that they should always aim to make components as simple and stateless as possible, so that they can be reused, even if they don’t have immediate plans to reuse a component. 

Briefly, here’s what the difference between the two is:-

Alt Text

#9 - What are the Different Phases of a Component's Lifecycle?

There are 3 different phases of React component’s lifecycle:

  • Initial Rendering Phase: This first phase is when the component is about to start its life cycle and make its way to the DOM.
  • Updating Phase: As soon as a component is added to the DOM, it can potentially re-render and update when a prop or state change occurs. That happens in this phase only.
  • Unmounting Phase: This is the last and final phase of a component’s life cycle in which the component is destroyed and removed from the DOM.

#10 - What is a Higher Order Component (HOC)?

Higher Order Component is a more sophisticated way of reusing component logic. Essentially, it’s a pattern that is derived from React’s compositional nature. Higher Order Components are custom components which wrap another component within it.

HOCs can accept any dynamically provided child component but they will not modify or copy any behavior from their input components. You can term HOCs as ‘pure’ components.

These can be used for several tasks like:

  • Reusing the code, logic and bootstrap abstraction.
  • Render Hijacking.
  • Props manipulation.
  • State abstraction and manipulation.

Wrapping Up

I believe that the pandemic has adjusted companies to hire developers who can work remotely. How is it relevant here? Because the list of questions you ask before hiring remote employees is very different.

You can add those to the existing interview questions to make sure you’re moving in the right direction. Hopefully, this was a comprehensive guide to help you understand what questions you can ask a React front developer in an interview.

Top comments (2)

Collapse
 
dmauldin profile image
Dave Mauldin

Some issues with the Angular vs React section. Since Angular and AngularJS seem to be used interchangeably, I'll just give the benefit of doubt here that the poster has never been an Angular (2+) dev.

  • Angular and AngularJS are used seemingly interchangeably here. This is absolutely not true and IMHO is a large part of the reason why Angular is not more popular. AngularJS is the very old 1.0 project and completely different than anything Angular 2.0+.
  • Architecture: Angular does most of it's work in the ShadowDOM, which for Angular's use case, you can think of as having a VirtualDOM for each component or component tree, that is attached to the DOM. Angular does change detection and updating of components with much better performance than updating the DOM, directly. This has the added benefit of encapsulation of components, ex: keeping styles from affecting elements outside of the ShadowDOM they're set on. ShadowDOM is also a web standard that is implemented by all modern browsers (and of course has polyfills). While it has similarities, it is still functionally different from React's VirtualDOM and thus the performance can vary, but again, much faster than direct DOM change detection or manipulation, while providing additional features.
  • Data Binding: Technically, both provide 2-way data binding. React recommends to not do it. Angular does not recommend against it, but it's rarely used in larger applications. I think the real difference here is that React recommends a use pattern for components where Angular lets you decide. In Angular, you can easily work in the same way as React, like passing in the state to be updated or better yet, a function to be used by the child component.
  • JavaScript Library: This statement is actually hard to read, but I think it's intending to say that you can include React from a CDN, whereas Angular is always compiled into the app. While you can include React from a CDN and this can be useful if you're just adding a couple of components to an existing app, it's a very uncommon use case. If you are going to build a larger app, using React from a CDN is not a win. Are you going to do that for all of your libraries? For Angular, since it's a framework and not just a library, this would be something like adding React, ReactRouter, Axios, RxJS, etc. etc. all from CDN. Chances are, you'd get a much smaller total download (and memory footprint) by tree-shaking and bundling, which Angular is setup for, by default. And, AFAIK, is what React devs do by default, as well. I'll give you the point that, if you're just creating some components for an existing site, Angular is not for you. ;)
Collapse
 
praveen__pkm profile image
Praveen Mishra

Great insights, Dave!