Front end Developer
800+ Front end Developer Interview Questions and Answers
Popular Companies
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?
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
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.
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
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
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 🌟
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?
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
Q59. what is filter method which is better to use filter method or foor loop
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);
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.
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"
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?
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
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?
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()
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().
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)
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
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.
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?
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 moreLife 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
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
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
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
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;
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?
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
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
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
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
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
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
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()
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
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
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?
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?
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
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 ?
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
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?
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
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.
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
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
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
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
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?
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
Interview Questions of Similar Designations
Top Interview Questions for Front end Developer Related Skills
Interview experiences of popular companies
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
Reviews
Interviews
Salaries
Users/Month