Published on

How to prepare for React JS interview for junior developers - Part 01 ?


I have been taking many interviews with junior to senior developers and wanted to share a few topics that I found very impressive if a junior or regular developer explains them well…

Disclaimer : This is my suggestion don't take these as the ultimate guide for cracking interviews.

The Basics:

Before reacting, I assume you already have a good understanding of Javascript; at least you have been preparing for Javascript topics. If not, I suggest watching a few videos on youtube. Here I will only cover general react topics, which I feel are missing in many junior developers i interviewed.

Hooks vs Classes:

I personally don't recommend any candidate who is not experienced with react hooks. I saw a few developers think it's just syntax changes, and they can adapt that in a week, so no big deal? No, that's not true. You will face new problems/mistakes when moving from classes to hooks (aka functional components), and since you are not experienced, you will not be able to deliver good quality code.

If you are still not started on React hooks ?

So you are still working on classes and your current job won’t allow you to work on hooks. I suggest take few hours and read through (or watch a video) on hooks. that will give you a general idea. Learn about (useState, useReducer, useRef, useCallback, useMemo..). there are much more to learn but at start just read these once and start building few basic projects .

Start building following projects (they often been asked in interviews as well)

Counter app :

You can build an counter app (Level1), Stopwatch timer (level2), POMODORO timer app (level3)

Todo app:

Start building a todo app, then try to persist data with localStorage (you can learn how simple this is with custom hooks) and once you feel comfortable try to build a clone of popular todo apps like todoist.

Multi-level dropdown tree:

Learn how you can use recursion to create multilevel dropdown lists. Build sometime like windows StartMenu on xp (cool project) or easy one you can replicate something similar to vscode file explorer.

React JS interview topics :

  • What is flux modal? Unidirectional flow (Describe data flow in react?)
  • The drawback of using JSX.
  • What is the use of a key prop?
  • React component lifecycle with react hooks
  • What is Prop Drilling? How to fix it?
  • What is the rule of Hooks, and why do we need them?
  • React JS Basic Optimisation: PureComponent, react.memo, useMemo, useCallback.
  • How do you Share Logic between multiple components? higher order component / renderProps / Custom Hooks?
  • How to cancel asynchronous API calls on unmount (useEffect cleanup)?
  • How to avoid memory leak errors in react?
  • What is the use of dependencies in useEffect?
  • What is the difference between useCallback and useMemo?
  • What is the use of refs?
  • How to pass refs to child components?
  • What is React strict mode?
  • React.memo vs useMemo.
  • How to replicate shouldComponentUpdate behavior in functional components?
  • What is CSR, and how is it different from SSR? (Client-side rendering vs. server-side rendering)
  • Is Hooks cover all use cases for classes?
  • What is the difference between useState and useRef hook?

Awesome, Wait for Part 2; I will share more questions and a few interesting coding problems, which are likely to be asked in your next interview.

Happy cracking.