3 Common Frontend Interview Questions and How to Ace Them
Hey everyone, this is Eric. I write about frontend engineering and its career growth. Many people feel lost in the frontend world and do not know how to advance, and I hope this newsletter will be helpful to you.
With summer approaching and many students graduating soon, there's an influx of people either looking for jobs or seeking referrals. If you are one of the chosen ones, you will get a phone call and should start preparing for interviews. Most interviews for software engineers include two or more rounds of coding interviews. Having been on both sides of the interview process for many years, here are some of the most common patterns I have seen in coding interviews for frontend engineers.
Leetcode
People often ask, Do we still need to Leetcode? I would say yes, but I don't mean you need to finish 500 questions before going to any interviews. Leetcode trains your brain to think in certain ways that help you solve your questions. Even if the questions are about building UI, practicing Leetcode can often help you define your states in a more optimal way. I suggest going through the Blind 75 list. It's a curated list that covers a wide range of topics.
From my personal experience, you should be familiar with Map and Array and not afraid of using recursion to solve problems. Most problems that you can solve using loops or an iterative approach can be solved using recursion with better results. Also, understand what Big O notation is to explain the complexity of your functions.
Build a UI
As a frontend engineer, you will at some point fetch data and build components to render on the screen. You will usually be given a design mockup and try to use a framework of your choice to build it. You might also just get a problem statement, and it’s your responsibility to ask questions and clarify requirements before you start building. Some sample questions I have been asked before:
Build a list of stock trading transactions and use different colors to indicate the gains and losses.
Fetch APIs to render a list of movies with pagination.
Given an array of data, build a carousel.
You will be asked to explain how you are handling states and how to optimize rendering performance.
Take-Home Assignment
Some companies may choose to give candidates take-home assignments instead of dedicating an interview session. Some companies even have business models built around conducting these types of interviews. The main differences between this and an interview session are that you don’t have someone watching you while coding, and these assignments tend to be closer to what you would work on at your job. I know some people don’t prefer this and might even cancel the interviews if given these assignments. I personally prefer this way of testing my skills since I feel I can demonstrate my abilities more accurately. Some sample questions I have been asked include:
Make a React project that includes a form and can submit the data.
With the given sample code, finish the tic-tac-toe game.
Make a real-time chat function.
Some companies may ask you to treat this as a real-life project, so ensure you have included or at least planned to have tests, some architecture, component separation, etc. Imagine this is a more complicated project, and you need to ship it to production. What would you do in this project? However, make sure you complete the main requirements then start expanding into other bonus criteria.