7 challenges to do before a React interview
Most interviews nowadays have some sort of coding challenge - either a live test or a take home assignment. It's common to blow these up if you don't "warm up" before hand.
Here are 7 challenges perfect to prepare for an interview! Set aside about 1h for each (though you'll probably finish them sooner!).
Show top 10 articles from Hacker News
This is great to recap data fetching, error handling and general React concepts. Might seem trivial, but it's actually great to check your abilities to figure out the API docs, to merge data from multiple endpoints and to handle loading states.
Build a memory game
This is a rather simple challenge, as it doesn't involve any data fetching or such, but it's great to check the fundamental knowledge of using state, rendering lists and structuring components.
Create a timer that can be started and stopped
This is great to check your knowledge of working with intervals in React. It can be surprisingly tricky and trips up a lot of people.
Add persistence to local storage for an existing app
Many times the interview challenge will be about adding a feature to an existing app. This challenge can help you practice that and it's also a good review of using useEffect
and , optionally, custom hooks:
Create a Contact Book app
Another area commonly checked in interviews: working with forms! This challenge is about adding CRUD for a list of persons, and checks your knowledge of forms and editing items in a collection.
Build a Typewriter effect component
This is another challenge that tests your knowledge of working with intervals in React, but since it also has forms and the timer is started on page load, it's actually a bit trickier than the "countdown timer". Give it a shot!
Build a drag and drop to-do list
A spin off of the typical todo list app, this is great to check your knowledge of structuring components, sharing the state and just overall React fundamentals. To keep things simple, the challenge uses a 3rd party library for the actual drag and drop functionality.
How did you find the challenges?
What exercises did you receive in your React interviews?
Share your thoughts in the comments below!
Member discussion