Front end Developer

filter-iconFilter interviews by

800+ Front end Developer Interview Questions and Answers

Updated 3 Mar 2025

Popular Companies

search-icon
Q51. What is the typeof() operator in JavaScript?
Ans.

typeof() operator in JavaScript is used to determine the data type of a variable or expression.

  • typeof() returns a string indicating the type of the operand.

  • Example: typeof 42 will return 'number'.

  • Example: typeof 'hello' will return 'string'.

Q52. According to you what are the futuristic skills required for a frontend developer?

Ans.

Futuristic skills for a frontend developer include AI, VR/AR, PWAs, and accessibility.

  • Proficiency in AI and machine learning for creating intelligent interfaces

  • Knowledge of VR/AR for developing immersive experiences

  • Expertise in Progressive Web Apps (PWAs) for building fast and reliable web applications

  • Understanding of accessibility guidelines and techniques for creating inclusive designs

Q53. Can you explain the lifecycle of components in React?
Ans.

Components in React go through various stages like mounting, updating, and unmounting.

  • Components are created and inserted into the DOM during the mounting phase.

  • During the updating phase, components can re-render due to changes in props or state.

  • Components are removed from the DOM during the unmounting phase.

  • Lifecycle methods like componentDidMount, componentDidUpdate, and componentWillUnmount are used to perform actions at different stages.

Q54. What is prototype chaining in JavaScript?
Ans.

Prototype chaining in JavaScript is the mechanism by which objects inherit properties and methods from other objects.

  • In JavaScript, each object has a prototype property that points to another object. When a property or method is accessed on an object, JavaScript will look for it in the object itself first, and then in its prototype chain.

  • If the property or method is not found in the object, JavaScript will continue to look up the prototype chain until it finds the property or...read more

Are these interview questions helpful?
Q55. What are the features of HTML5?
Ans.

HTML5 is the latest version of the HTML standard with new features for web development.

  • Support for multimedia elements like <video> and <audio>

  • Canvas and SVG for graphics and animations

  • Improved form controls and validation

  • Offline storage with Local Storage and IndexedDB

  • Geolocation API for location-based services

Q56. What is the purpose of the 'this' operator in JavaScript?
Ans.

The 'this' operator in JavaScript refers to the current context or object.

  • Refers to the current object or context in which a function is being executed

  • Can be used to access properties and methods of the current object

  • The value of 'this' is determined by how a function is called

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
Q57. Can you explain the concept of data spooling in operating systems?
Ans.

Data spooling is a process where data is temporarily stored in a buffer before being sent to an output device.

  • Data spooling helps in managing the flow of data between different devices by storing it temporarily.

  • It allows for efficient processing of data by decoupling the input/output operations.

  • Examples of data spooling include print spooling, where print jobs are stored in a queue before being sent to the printer.

Q58. Do you know about React middlewares? why are they used?

Ans.

React middlewares are functions that intercept and modify requests and responses in a React application.

  • Middlewares are used to add additional functionality to an application without modifying the core code.

  • They can be used for authentication, logging, error handling, and more.

  • Examples of React middlewares include Redux Thunk, Redux Saga, and React Router.

  • They are typically implemented using higher-order functions.

  • Middlewares can be chained together to create a pipeline of fu...read more

Front end Developer Jobs

FrontEnd Developer (UI) 3-8 years
A.P. Moller Maersk
4.2
₹ 25 L/yr - ₹ 40 L/yr
Bangalore / Bengaluru
Frontend Developer 3-6 years
Jio
3.9
Bangalore / Bengaluru
Front End Developer 2-4 years
Siemens Energy
4.1
Gurgaon / Gurugram

Q59. what is filter method which is better to use filter method or foor loop

Ans.

The filter method is a built-in JavaScript method used to create a new array with all elements that pass a certain condition.

  • Filter method is more concise and readable compared to for loop

  • Filter method is more declarative and functional programming oriented

  • Example: const numbers = [1, 2, 3, 4, 5]; const evenNumbers = numbers.filter(num => num % 2 === 0);

  • Example: const words = ['hello', 'world', 'example']; const shortWords = words.filter(word => word.length < 6);

Q60. Can you explain hoisting in JavaScript?
Ans.

Hoisting in JavaScript is a behavior where variable and function declarations are moved to the top of their containing scope during the compilation phase.

  • Variable declarations are hoisted to the top of their scope, but not their assignments.

  • Function declarations are fully hoisted, meaning they can be called before they are declared.

  • Hoisting can lead to unexpected behavior if not understood properly.

Q61. What are the different types of data binding in Angular?
Ans.

Types of data binding in Angular include interpolation, property binding, event binding, two-way binding.

  • Interpolation: {{ data }}

  • Property binding: [property]="data"

  • Event binding: (event)="function()"

  • Two-way binding: [(ngModel)]="data"

Q62. Can you explain promises and their three states?
Ans.

Promises are objects representing the eventual completion or failure of an asynchronous operation.

  • Promises have three states: pending, fulfilled, and rejected.

  • Pending: initial state, neither fulfilled nor rejected.

  • Fulfilled: operation completed successfully.

  • Rejected: operation failed.

  • Promises can be chained using .then() to handle success and failure.

  • Example: const promise = new Promise((resolve, reject) => { ... });

Q63. What are performance optimization techniques used in react?

Ans.

Performance optimization techniques in React improve rendering speed and user experience.

  • Code splitting to load only necessary components

  • Memoization to prevent unnecessary re-renders

  • Virtualization for long lists to improve rendering performance

  • Using shouldComponentUpdate or React.memo for functional components

  • Minimizing unnecessary re-renders by using PureComponent or React.PureComponent

Q64. Is JavaScript single-threaded or multi-threaded?
Ans.

JavaScript is single-threaded.

  • JavaScript is single-threaded, meaning it can only execute one piece of code at a time.

  • This is because JavaScript runs in the browser's main thread, which is responsible for handling user interactions, rendering, and running JavaScript code.

  • Asynchronous operations in JavaScript, such as AJAX requests and setTimeout, allow for non-blocking code execution without the need for multi-threading.

  • Web Workers can be used to run JavaScript code in the bac...read more

Q65. What is "this" operator?

Ans.

The 'this' operator refers to the object that is currently executing the code.

  • The value of 'this' depends on how a function is called.

  • In a method, 'this' refers to the object that owns the method.

  • In a regular function, 'this' refers to the global object (window in a browser).

  • In an event handler, 'this' refers to the element that received the event.

  • The value of 'this' can be explicitly set using call(), apply(), or bind() methods.

Q66. What is Promises ? Write a Polyfill of Promise.all()

Ans.

Promises are objects representing the eventual completion or failure of an asynchronous operation.

  • Promises are used to handle asynchronous operations in JavaScript.

  • Promise.all() takes an array of promises and returns a single promise that resolves when all of the input promises have resolved.

  • A polyfill for Promise.all() can be implemented using a combination of Promise and Array.prototype.reduce().

Q67. Can you explain the CSS Box Model?
Ans.

The CSS Box Model is a fundamental concept in CSS that defines the layout and spacing of elements on a webpage.

  • The Box Model consists of content, padding, border, and margin.

  • Content: The actual content or text of the element.

  • Padding: Space between the content and the border.

  • Border: The border surrounding the padding and content.

  • Margin: Space outside the border, separating the element from other elements.

  • Example: div { width: 200px; padding: 20px; border: 1px solid black; marg...read more

Q68. When to use functional components and when to use class components (other than state management)

Ans.

Functional components are simpler and easier to test, while class components offer more features and lifecycle methods.

  • Use functional components for simple UI components

  • Use class components for more complex UI components

  • Functional components are easier to read and maintain

  • Class components offer more lifecycle methods and state management options

Q69. What is Scss/sass and what is the use of it

Ans.

Scss/Sass is a CSS preprocessor that adds features like variables, nesting, and mixins to make writing CSS easier and more efficient.

  • Scss/Sass stands for Syntactically Awesome Style Sheets

  • It is a CSS preprocessor that compiles into regular CSS

  • It adds features like variables, nesting, and mixins to make writing CSS easier and more efficient

  • It also allows for more advanced features like functions and loops

  • Example: $primary-color: #007bff; .button { background-color: $primary-co...read more

Q70. What is react.js? Ans: React.js is javascript library used for building the UI components.

Ans.

React.js is a JavaScript library used for building user interfaces by creating reusable UI components.

  • React.js allows developers to create interactive user interfaces efficiently.

  • It uses a virtual DOM for optimal performance by updating only the necessary components.

  • React components can be reused across different parts of an application.

  • It follows a unidirectional data flow, making it easier to manage state and data.

  • React.js is maintained by Facebook and a community of develo...read more

Q71. What is controlled component vs uncontrolled component?

Ans.

Controlled components are React components whose value is controlled by React, while uncontrolled components are not.

  • Controlled components are typically used for forms and inputs

  • Uncontrolled components are typically used for simple inputs like text fields

  • Controlled components use the 'value' prop to set the value of the component

  • Uncontrolled components use the 'defaultValue' prop to set the initial value of the component

  • Controlled components allow for more control and validat...read more

Q72. What is life cycle method What hooks you have used What is map filter and reduce How to make JavaScript asynchronous What is the difference between redux thunk and redux saga What is the benefit of arrow functi...

read more
Ans.

Life cycle methods are methods that are automatically called at different stages of a component's life cycle in React.

  • ComponentDidMount is called after the component has been rendered to the DOM.

  • ComponentDidUpdate is called after the component's state or props have been updated.

  • ComponentWillUnmount is called before the component is removed from the DOM.

Q73. what is the diffrent between position absolute, relative and other

Ans.

Position absolute is positioned relative to its closest positioned ancestor, while position relative is positioned relative to its normal position in the document flow.

  • Position absolute elements are taken out of the normal document flow.

  • Position relative elements are still in the normal document flow but can be moved from their original position using top, bottom, left, and right properties.

  • Position fixed elements are positioned relative to the viewport and do not move when t...read more

Q74. How to centre 3 div vertically and horizontally using css

Ans.

To center 3 divs vertically and horizontally, use flexbox and align-items/justify-content properties.

  • Wrap the 3 divs in a parent container

  • Set the parent container's display property to flex

  • Set the parent container's align-items and justify-content properties to center

Q75. What is the difference between Server-Side Rendering and Client-Side Rendering

Ans.

Server-Side Rendering is rendering the web page on the server and sending the fully rendered page to the client, while Client-Side Rendering is rendering the web page on the client's browser using JavaScript.

  • Server-Side Rendering generates the HTML on the server and sends it to the client, resulting in faster initial page load.

  • Client-Side Rendering loads a basic HTML page first and then uses JavaScript to render the content on the client's browser, which can result in slower ...read more

Q76. What is css felxbox and attributes

Ans.

CSS Flexbox is a layout module that helps in creating flexible and responsive layouts.

  • Flexbox is used to align and distribute space among items in a container.

  • It has properties like display, flex-direction, justify-content, align-items, and flex-wrap.

  • Flexbox is widely used in modern web development for creating responsive designs.

  • Example: display: flex; flex-direction: row; justify-content: center; align-items: center;

Q77. What is dependency injection in Angular?
Ans.

Dependency injection in Angular is a design pattern where components are given their dependencies rather than creating them themselves.

  • In Angular, dependency injection is achieved by declaring the dependencies in the constructor of a component or service.

  • It helps in making components more modular, reusable, and easier to test.

  • For example, if a component needs a service to fetch data from an API, instead of creating an instance of the service within the component, the service ...read more

Q78. What challenge have you faced in modernizing legacy systems, and how do you handle the integration of new technologies within an established global infrastructure?

Ans.

Modernizing legacy systems and integrating new technologies in a global infrastructure.

  • Identify key pain points in the legacy system that need modernization

  • Develop a clear roadmap for integration of new technologies while minimizing disruption

  • Collaborate with stakeholders to ensure alignment with business goals

  • Implement gradual changes and conduct thorough testing to mitigate risks

  • Provide training and support for users to adapt to the new technologies

Q79. How you will Design the db for a chat app

Ans.

A chat app db should have tables for users, conversations, messages, and attachments.

  • Create a table for users with their unique ID, username, and password.

  • Create a table for conversations with their unique ID, name, and participants.

  • Create a table for messages with their unique ID, conversation ID, sender ID, and message content.

  • Create a table for attachments with their unique ID, message ID, and attachment URL.

Q80. implement event bubbling on three divs, one into another i.e grandparent, parent,child

Ans.

Event bubbling can be implemented by attaching event listeners to the child, parent, and grandparent divs.

  • Add event listeners to the child, parent, and grandparent divs

  • Use the event.stopPropagation() method to stop the event from bubbling up to the parent and grandparent divs

  • Handle the event in each div's event listener function

Q81. What are media elements in HTML?
Ans.

Media elements in HTML are used to embed audio and video content on a webpage.

  • Media elements include <audio> and <video> tags in HTML.

  • They allow for the playback of audio and video files directly on a webpage.

  • Attributes like src, controls, autoplay, and loop can be used to customize the behavior of media elements.

  • Example: <video src='video.mp4' controls></video>

Q82. What is the difference between display none and visibility hidden

Ans.

display none removes element from layout, visibility hidden hides element but still takes up space

  • display none removes the element from the layout completely

  • visibility hidden hides the element but still takes up space

  • display none will not render the element, while visibility hidden will render the element but make it invisible

Q83. What is the difference between session storage and local storage

Ans.

Session storage is temporary and data is cleared when the browser is closed, while local storage persists even after the browser is closed.

  • Session storage is temporary and data is cleared when the browser is closed

  • Local storage persists even after the browser is closed

  • Session storage is limited to the current tab or window, while local storage is shared across tabs and windows of the same origin

Q84. what are React lifecycle Method

Ans.

React lifecycle methods are functions that are called at different stages of a component's life.

  • Mounting: constructor(), render(), componentDidMount()

  • Updating: render(), componentDidUpdate()

  • Unmounting: componentWillUnmount()

  • Error Handling: componentDidCatch()

Q85. How are observables different from promises?
Ans.

Observables are streams that can emit multiple values over time, while promises can only emit a single value.

  • Observables can emit multiple values over time, while promises can only emit a single value.

  • Observables are cancellable, while promises are not.

  • Observables support operators like map, filter, and reduce for transforming data streams, while promises do not.

  • Observables are lazy, meaning they do not run until they are subscribed to, while promises start executing as soon ...read more

Q86. What are lifecycle hooks in Angular?
Ans.

Lifecycle hooks in Angular are methods that allow you to tap into specific points in a component's lifecycle.

  • Lifecycle hooks include ngOnInit, ngOnChanges, ngDoCheck, ngOnDestroy, etc.

  • ngOnInit is used for initialization logic, ngOnChanges for reacting to input changes, ngDoCheck for custom change detection, ngOnDestroy for cleanup tasks, etc.

Q87. Give a list of numbers and a target. You need to find the pair of numbers, whose value will be equal to target when we subtract

Ans.

Find a pair of numbers in a list that subtract to a target value

  • Iterate through the list of numbers and store each number in a hashmap along with its index

  • For each number, check if the difference between the target and the number exists in the hashmap

  • Return the pair of numbers if found, otherwise return an empty array

Q88. count the number of words in given strings of array using higher order function?

Ans.

Count the number of words in given strings of array using higher order function.

  • Use the map function to transform each string into an array of words

  • Use the reduce function to count the total number of words in all strings

  • Handle edge cases such as empty strings or strings with leading/trailing spaces

Q89. How do you ensure scalability and performance optimization when managing large volumes of data across multiple platforms in a global organization?

Ans.

Ensuring scalability and performance optimization involves utilizing efficient data management techniques and leveraging appropriate technologies.

  • Utilize database indexing and caching to improve data retrieval speed

  • Implement data sharding to distribute data across multiple servers for better performance

  • Use content delivery networks (CDNs) to reduce latency for global users

  • Optimize front end code by minimizing HTTP requests and using lazy loading for large datasets

  • Regularly mo...read more

Q90. C 3.What is Data Types What is keyword C++ 3. What is c++ What is keyword How many operator in c++ Python 1. What is python 2. Data type in python

Ans.

Answers to questions related to programming languages and concepts.

  • Data types in programming languages define the type of data that can be stored and manipulated.

  • Keywords are reserved words in programming languages that have a specific meaning and cannot be used as variable names.

  • C++ is a high-level programming language that is used for developing software applications.

  • Python is a popular programming language that is known for its simplicity and ease of use.

  • Operators in C++ a...read more

Q91. How much you know about flutter ?

Ans.

Flutter is a UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase.

  • Flutter is developed by Google and uses the Dart programming language.

  • It allows for fast and efficient development of cross-platform applications.

  • Flutter provides a rich set of pre-designed widgets and allows for customization.

  • Hot reload feature in Flutter enables quick code changes and updates in real-time.

  • Flutter has a strong community support and a growin...read more

Q92. What are closures in JavaScript?
Ans.

Closures in JavaScript are functions that have access to variables from their outer scope even after the outer function has finished executing.

  • Closures allow for maintaining state in JavaScript functions.

  • They are created whenever a function is defined within another function.

  • Closures can access variables from their outer scope, even after the outer function has finished executing.

Q93. What is react virtual dom, and how it works?

Ans.

React virtual DOM is a lightweight copy of the actual DOM, used for efficient rendering of UI components.

  • Virtual DOM is a concept where a lightweight copy of the actual DOM is created and updated by React.

  • When changes are made to the UI, React compares the virtual DOM with the actual DOM to determine the minimal number of updates needed.

  • This process helps in optimizing performance by reducing the number of DOM manipulations required.

  • Example: When a user interacts with a React...read more

Q94. what is salary expection per annum? Ans: upto 600000

Ans.

My salary expectation is up to 600,000 per annum based on my experience and skills.

  • Consider factors such as experience, skills, industry standards, and location when determining salary expectations.

  • Research average salaries for front end developers in your area to ensure your expectations are realistic.

  • Be prepared to negotiate and discuss other benefits in addition to salary.

Q95. Can you discuss the assignment you have built?
Ans.

I built a responsive web application for managing tasks and deadlines.

  • Used HTML, CSS, and JavaScript to create the frontend

  • Implemented drag and drop functionality for task organization

  • Integrated a calendar API for deadline tracking

Q96. Is it optimal to use redux for single state

Ans.

No, it is not optimal to use redux for single state

  • Redux is typically used for managing complex state across multiple components

  • Using redux for a single state can add unnecessary complexity to the codebase

  • Consider using React's built-in state management for simpler cases

Q97. What is Websocket i.o, why it is being used

Ans.

Websocket i.o is a JavaScript library that enables real-time, bidirectional and event-based communication between the browser and the server.

  • Allows for real-time communication between client and server

  • Enables bidirectional data transfer

  • Supports event-based communication

  • Used for applications requiring real-time updates like chat applications, online gaming, live tracking, etc.

Q98. What is Firebase and how to use it

Ans.

Firebase is a Backend-as-a-Service platform that provides tools and infrastructure for building web and mobile applications.

  • Firebase is owned by Google and offers a suite of cloud-based services.

  • It provides features like real-time database, authentication, hosting, storage, and more.

  • Firebase can be used to develop and deploy web and mobile applications quickly and easily.

  • It offers SDKs for various platforms and integrates well with other Google services.

  • Firebase allows develo...read more

Q99. There are three divs, grandparent,parent, child. Center all three divs one into another in middle

Ans.

Use CSS flexbox to center three divs inside each other

  • Use display: flex; justify-content: center; align-items: center; on the grandparent div

  • Set width and height on each div to see the effect clearly

  • Example: .grandparent { display: flex; justify-content: center; align-items: center; }

Q100. What are JavaScript closures, the temporal dead zone (TDZ), hoisting, and the JavaScript engine?

Ans.

JavaScript closures, TDZ, hoisting, and the JavaScript engine are key concepts in understanding how JavaScript works.

  • JavaScript closures are functions that have access to variables from their outer scope even after the outer function has finished executing.

  • Temporal Dead Zone (TDZ) is the period between entering a scope and the variable being declared where accessing the variable results in a ReferenceError.

  • Hoisting is the JavaScript behavior where variable and function declar...read more

Previous
1
2
3
4
5
6
7
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10.4k Interviews
3.8
 • 8.1k Interviews
3.6
 • 7.5k Interviews
3.7
 • 5.6k Interviews
3.7
 • 5.6k Interviews
3.7
 • 4.8k Interviews
3.5
 • 3.8k Interviews
4.0
 • 2.3k Interviews
2.4
 • 13 Interviews
View all

Calculate your in-hand salary

Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary

Recently Viewed
DESIGNATION
LIST OF COMPANIES
Online Instruments
Overview
INTERVIEWS
Osource Global
No Interviews
DESIGNATION
INTERVIEWS
IIGM
No Interviews
INTERVIEWS
Abk Imports
No Interviews
INTERVIEWS
Perficient
No Interviews
DESIGNATION
INTERVIEWS
Hy-Vee
No Interviews
JOBS
Browse jobs
Discover jobs you love
Front end Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter