DEV Community

Epic Lee
Epic Lee

Posted on • Updated on

Practical JS Interview Questions

Let's face it, algorithms are a useless test of a candidate's experience as a frontend developer. Someone who can construct a binary tree from preorder and inorder traversal doesn't mean they can create an amazing UI with an awesome user experience. It means they got lucky you asked them a question they've seen before.

What I like to give are mini-projects the candidate can solve in a 30–45 minute timeframe. They can use any framework they like such as React, Angular, or even vanilla JavaScript! Since my firm focuses more on functionality than UI, I tend not to not be so picky about CSS. But adjust as needed.

1. Create a stopwatch

Ask them to create a simple stopwatch. It should have buttons to start, pause, and stop the timer. I created a simple example.
Gotchas:
Click the 'Start' button multiple times and see if multiple intervals are created. Most candidates make this mistake.
Ensure 'Pause' button is hidden when the stopwatch hasn't started.

Bonus questions:
style the stopwatch
show milliseconds, minutes and hours

2. Create a todo list

Enough said, so many tutorials out there about this. Tweak the problem however you like.
Bonus questions:
add pagination
make a todo editable

3. Create a simple upvote tool

This is a simple polling tool, similar to Slido, that let's users ask questions and upvote the questions so the most popular ones are shown on top. See example.
Gotchas:
Questions should be sorted by upvotes
When a question is upvoted past another question, the one with the highest upvotes should move to the top
Handle duplicate questions

Bonus questions:
Make questions editable
Add delete button next to each question
Style the app

If the user finishes ahead of time, I will usually ask them some JavaScript related questions. You can find a good list of them here.
Hope this helped!

Top comments (0)