Navigating coding challenges is a crucial part of the interview process, particularly for aspiring React developers lacking professional experience.
Unfortunately, these coding assignments can be daunting for entry-level devs with limited job opportunities, making a failed test disheartening and even humiliating.
To help you prepare for code challenges, this article offers:
Before diving in, it's recommended to read the entire article. However, let's kick off with the most exciting part: coding challenges you might encounter during a job interview or in your daily work as a developer.
These challenges stem from the codebase and designs of the React Job Simulator (source code on GitHub). They vary in difficulty and assess a range of skills.
Now, let's begin with an easy task.
This simple UI challenge involves creating a header component for the app's landing page using Figma designs.
Current website state | Design:
Skills tested: CSS
Difficulty: Easy
Tasks:
/
, /products
, /documentation
, and /pricing
.Hints:
.tsx
if preferred.The solution for this task is not the cleanest, but it's sufficient for this challenge without separating the header into a new component file, using TypeScript, or writing tests.
You can get a more elaborate refactoring of above solution by providing your email below.
This challenge is more dynamic, requiring you to create a modal that opens when users click the contact button.
Current website state | Designs:
Skills tested: CSS, simple state management, React APIs
Difficulty: Easy - Medium
Tasks:
Hints:
For a tougher challenge:
These tasks are beyond the scope of this post. For more, check out React Job Simulator.
This more advanced challenge involves connecting the website to a Content Management System (CMS) like Contentful or Strapi. Marketers can use a CMS to easily create content without developer assistance.
In this challenge, you'll create a content element controlled by API data.
Skills tested: Working with API data, CSS
Difficulty: Medium
Tasks:
[https://prolog-api.profy.dev/content-page/home](https://prolog-api.profy.dev/content-page/home)
, where home
is a "slug" identifying the page.Hints:
pages/index.jsx
.For a tougher challenge:
These tasks are beyond this post's scope. For more, check out React Job Simulator.
This challenge focuses on debugging, a crucial skill for developers. A bug from the React Job Simulator is provided for this exercise.
On the application's issue page, either the "Events" or "Users" column displays incorrect data.
Skills tested: Debugging an existing codebase
Difficulty: Medium
Tasks:
Hints:
Practicing coding challenges is essential, but understanding what interviewers are looking for is equally important.
Employers want proof of a candidate's skills to minimize risks associated with hiring and training. Coding challenges are one way to assess these skills, testing both technical and soft skills.
While technical skills are crucial, don't overlook the importance of soft skills. Coding challenges can demonstrate your communication and problem-solving abilities, allowing interviewers to follow your thought process and observe your attitude towards critique.
This is particularly true for live coding challenges or when discussing your take-home assignment in a follow-up interview. Be prepared for questions on both technical and soft skills.
Coding challenges can be stressful, especially live assignments with the interviewer.
Here are some tips on how to approach them:
One common mistake, particularly among juniors, is diving straight into the task without fully understanding the requirements. Instead, take time to re-read the assignment and ask for clarification if something is unclear.
Asking clarifying questions is not a weakness. It demonstrates a clear mind and a structured approach, which employers value. On the job, building a solution without fully understanding the problem can lead to wasted time and effort.
Live coding challenges can be intimidating but offer a unique opportunity to showcase your thought process. Talking out loud while writing code allows interviewers to see your problem-solving and communication skills in action.
However, thinking and talking simultaneously isn't easy for everyone. To improve, practice techniques like rubber duck debugging, where you explain your plans as you work on a task. The coding challenges mentioned earlier are excellent opportunities for practicing this skill.
Many inexperienced developers overlook the importance of clean code formatting. Inconsistencies in indentation, semicolons, or variable naming can be easily noticed by senior developers or interviewers.
To avoid these issues, use a code formatter like Prettier for your (take-home) coding assignments. This helps maintain consistency and demonstrates your attention to detail.
Experienced developers value the reliability provided by TypeScript and automated tests. If you're comfortable with it, use types in your code and add tests. The choice of tool doesn't matter – you can use Jest, React Testing Library, or Cypress. Even one or two tests can be enough to demonstrate your professionalism and commitment to code quality.
Your interviewers may not run your code on their local machine, but if they do, you want to avoid confusion.
Include clear instructions on how to install and run your code, and double-check that it's working. If you have extra time, consider adding additional information to the README, such as:
Adding the information mentioned above to your README not only helps your interviewer understand your thought process, but it also prepares you for the next step: discussing your code.
If you have the opportunity (e.g., with a take-home test), let the code rest for a bit after submission. If you're invited to a follow-up interview, review your code closely:
Reevaluating your code can help you prepare for the next stage of the interview process, as it's likely you'll face questions about your code assignment.