7 Common Frontend Interview Questions

They are not all about white-board coding

CaffeinatedDev
Level Up Coding
Published in
5 min readDec 22, 2020

--

Photo by ThisIsEngineering from Pexels

When preparing for a software engineering interview, we often jump right into behavioral, white-board coding, and system design questions.

But there are other questions, although technical, that are not algorithmic or data structure related. Companies ask them because they want to know your potential in this field and if you know the stacks in more depth. Companies don’t want to hire someone who can “only” code.

In this article, I want to share some of the “rapid-fire” questions I encountered many times in front-end interviews. Hopefully, they can help you to prepare as well.

1. What is the use of “key” in React/Vue?

Key is a unique attribute that React/Vue associates to a single item inside a list to give them a stable identity. This can be helpful when updating only part of the list.

React and Vue won’t completely re-render every item in a list if only some of them were updated. Using a key will help the libraries to identify exactly which item has been modified.

This is a common interview question especially if the job requires some front-end framework/libraries. The official Vue and React documentation explains this concept in more detail with examples.

2. Difference between throttle and debounce

Debounce and throttle are techniques that limit the number of function calls when a user repetitively fires an event.

When an event handler function is debounced by a certain amount of time, it will only be called after the user stops firing the event for that specified amount of time.

It’s usually used with search boxes, where the user will repetitively input characters. We only want to search the string when they are finished with entering to reduce API calls.

When an event handler is throttled by some time, it will only be executed once for that given amount of time. For example, throttling can be used in infinite scrollable web pages. When the user scrolls down the page, it triggers many scrolling events. We can throttle the handler with a 1-second delay…

--

--