Global tech
LogRocket India Frontend Engineer Interview: Rounds, Questions and Preparation
For Frontend Engineer roles at companies like LogRocket India
What the job involves
As a Frontend Engineer at a fast-growing global tech company, you will build and maintain user interfaces for web applications, often working with modern JavaScript frameworks like React. Day to day, you will collaborate with designers, backend engineers, and product managers to turn designs into responsive, accessible, and performant code. You will also debug issues, write tests, and optimize applications for speed and cross-browser compatibility.
Role and Technical Knowledge
- 1
What is the difference between let, const, and var in JavaScript, and when would you use each?
Explain block scoping with let and const, hoisting behavior, and why const is preferred for values that should not be reassigned. Mention that var is function-scoped and generally avoided in modern code.
- 2
How does the virtual DOM work in React, and why does it improve performance?
Describe how React creates a lightweight representation of the UI, diffs it with the previous version, and updates only the changed parts in the real DOM. Highlight that this minimizes expensive DOM operations.
- 3
Explain the CSS box model and how you would use Flexbox to center a div both horizontally and vertically.
Cover content, padding, border, and margin. For Flexbox, mention setting display: flex, justify-content: center, and align-items: center on the parent container.
- 4
What are some ways to improve the performance of a React application?
Discuss code splitting with React.lazy, memoization with React.memo and useMemo, avoiding unnecessary re-renders, using production builds, and optimizing images and bundle size.
Practical Scenarios
- 5
You need to fetch data from an API and display it in a list. How would you handle loading, error, and empty states?
Outline using useState for loading, error, and data, and useEffect for fetching. Show conditional rendering: a spinner while loading, an error message on failure, and a 'No items found' message when the list is empty.
- 6
A user reports that a form on your page submits twice when they click the button rapidly. How would you debug and fix this?
Suggest disabling the button after the first click, using a loading state, or debouncing the submit handler. Also mention checking for event bubbling or duplicate event listeners.
- 7
How would you make a web page accessible to screen reader users?
Mention semantic HTML, ARIA labels where needed, keyboard navigability, sufficient color contrast, and testing with tools like Lighthouse or screen readers.
- 8
You are asked to implement a dark mode toggle that persists across sessions. How would you approach it?
Explain using CSS variables or a class on the body, toggling via JavaScript, and storing the preference in localStorage. Also mention respecting the user's system preference with prefers-color-scheme.
Behavioural and HR
- 9
Tell me about a time you had to learn a new technology quickly for a project. How did you go about it?
Use the STAR method: describe the situation, the technology, your learning approach (docs, tutorials, small prototypes), and the outcome. Emphasize self-driven learning and applying it effectively.
- 10
Describe a situation where you disagreed with a teammate on a technical approach. How did you handle it?
Show that you listen, discuss pros and cons with data, and are open to compromise. Highlight that the goal is the best solution for the project, not winning the argument.
- 11
Why do you want to work as a Frontend Engineer at a fast-growing company like ours?
Connect your interest in building user-facing products with the company's focus on developer tools or similar. Mention eagerness to learn, impact, and working in a dynamic environment.
- 12
Where do you see yourself in the next two years as a frontend developer?
Show ambition to deepen technical skills, take ownership of features, and contribute to team processes. Avoid saying you want to move into management immediately unless that is your genuine goal.
Coding and Problem Solving
- 13
Write a function that takes an array of numbers and returns the sum of all even numbers.
Use filter and reduce or a simple loop. Explain your approach and consider edge cases like empty arrays or non-number inputs.
- 14
Given a string, write a function to check if it is a palindrome.
Normalize the string by removing non-alphanumeric characters and converting to lowercase, then compare with its reverse. Discuss time and space complexity.
- 15
Implement a debounce function in JavaScript.
Use closures and setTimeout to delay the execution until after a specified wait time has passed since the last call. Explain use cases like search input or window resize.
- 16
How would you find the first non-repeating character in a string?
Use a hash map to count occurrences, then iterate through the string to find the first character with count 1. Mention O(n) time complexity.
Coding round
Frontend Engineer interviews usually include a coding round. Practise planning the solution out loud, then review code the AI writes from your plan, in Python, Java, C++, C or JavaScript.
Ready to try it for real?
Take a timed test or talk through a mock interview for this role, then see your scores.
This is practice material for Frontend Engineer roles, written with AI. It is not a list of questions LogRocket India or any other company has asked.