Tous les articles

Front-End

Using ChatGPT to practice for frontend live coding interviews

Par Sarah Lancaster3 min de lecture

There is no standard format for technical interviews, but a common one is a coding challenge done on the spot. For a front end developer this will either be an algorithms and data structures challenge, or a small react app. In this article I will explain how to prepare for one of these interviews using ChatGPT.

For the environment I would recommend using CodePen. Often the businesses will prepare a sandbox in advance (either CodePen or CodeSandbox) but they may not, so it’s good to get familiar with an online editor and especially how to get a React app working from scratch.

For a React interview challenge:

Create a CodePen account and create a new pen:

Open the settings and change the JS preprocessor to TypeScript (or Babel) to process the JSX:

Scroll down in the JS settings and add React and ReactDOM:

This will add them to your pen.

Next you need to create the html element that your react app will mount to, the React app itself and call the render function with ReactDOM:

Here is a minimum working example of a react app to fork or copy, but I would recommend memorizing this setup.

Next sign into ChatGPT and ask it the following:

I am interviewing for a javascript react developer position. Give me a live coding problem

ChatGPT then gave me a list of acceptance criteria for a counter app. This is very realistic for a coding interview:

Syntax highlighting and code completion is very different/minimal when compared with an IDE like VSCode which is why it’s worth getting used to the debugging experience in a sandbox before the interview. The button to display the console is on the toolbar at the bottom.

Keep asking ChatGPT for more by asking “Give me another” and get more specific with the prompts if you want to practice specific areas.

For example, I asked it:

Give me another, with side effects

It gave me the prompt to fetch a random quote and display it.

For a test API to connect to I recommend JSONPlaceholder

It has a few endpoints which you can query and even post and delete.

For my challenge I used the album endpoint to achieve a similar result without a real quote API.


For algorithms challenges, the setup on CodePen is simpler. You only need to call your function in a console log. No need for any special settings.

In ChatGPT you can ask:

I am interviewing for a JavaScript React developer position. Give me a live coding algorithms problem

It is good practice in the interview to also comment the expected result next to the statement, as if it were a unit test.

You can ask ChatGPT to give you an ideal answer to compare your function to at the end of the challenge.

Good luck!

  • Lors d'une mission récente j'ai récemment dû implémenter un chatbot. C'était une première et je me dis que c'est l'occasion parfaite pour vous partager mon expérience et des conseils si vous aussi passez par là. Objectif Usage Avoir un chatbot facilement utilisable sur n'importe quelle page, léger, performant et personnalisable, selon les besoins du client. En terme d'usage voici ce que je visais : <body> <chatbot toggle-button-text="Fragrance advisor" chatbot-header-t
  • Il est 9h15 et Hubert arrive au bureau. Après un bonjour à ses collègues, il s’assoit à son poste, une tasse de café dans la main et la souris dans l’autre. Comme à son habitude, il commence sa journée par scroller les news et faire un peu de veille. * “Everybody is now a programmer” d’après le PDG de Nvidia * “Comment j’ai créé mon SaaS en 3h avec v0 et Supabase” * “Ce vibe-coder a vu son business disparaître du jour au lendemain après qu’un LLM ait supprimé sa BDD de prod dans Replit” Tan
  • A11Y Paris - Conférence sur l'accessibilité numérique
    Edit : découvrez notre nouveau site dédié à l'accessibilité : Frontguys A11Y L’équipe Frontguys avait le plaisir d’être une nouvelle fois présente à A11Y Paris le 25 juin dernier, l’évènement incontournable de l’accessibilité en France. Cette 6ème édition était d’autant plus attendue qu’elle coïncidait à quelques jours près avec l’entrée en application de la Directive Européenne sur l'accessibilité produits et services. Retour sur une nouvelle journée riche en enseignements. Voul