Top Frontend Developer Interview Q&A
Top Frontend Developer Interview Q&A
Search...
Frontend development is an important part of web applications, and it is used to build dynamic and user-friendly web applications with an interactive user
interface (UI). Many companies are hiring skilled Frontend developers with expertise in HTML, CSS, JavaScript, and modern frameworks and libraries like
React, [Link], and Angular, offering handsome salaries to them.
Here, we’ve compiled the Top 100+ Frontend Developer interview questions and answers 2025, covering essential concepts. Whether you're a beginner or
a professional with 2-10 years of experience, these questions will help you confidently ace the Frontend Developer Interview.
Table of Content
Frontend Developer Interview Questions - Beginners
Frontend Developer Interview Questions - Intermediate
Frontend Developer Interview Questions - Advanced
Topic-Wise Frontend Developer Interview Questions
Front-end development, also known as client-side development, focuses on building the user interface (UI) and user experience (UX) of a website or web
application. It involves designing and implementing interactive elements that users interact with directly. The core technologies used in front-end
development are HTML for structure, CSS for styling, and JavaScript for interactivity.
Apart from that, we use different CSS frameworks (like Bootstrap, Tailwind CSS) and JavaScript frameworks (like React, Angular, [Link]) to enhance
development efficiency and improve user experience.
1. What is HTML?
HTML stands for Hyper Text Markup Language. It is a markup language that consists of different tags. It is used to define the structure of the web pages.
HTML is the basic building block of the web page, which is used to display text, images, and other content.
The semantic elements in HTML are the elements that contain the meaning of the content and the structure of the HTML document. These elements contain
content that is related to their names or reflects their names. These are some of the semantic HTML elements listed below:
Header
Main
Section
Article
Aside
Footer etc.
Takes up only as much width as necessary Takes up the full width available
Cannot contain block elements Can contain both inline and block elements
Height and width are usually not adjustable Height and width can be set freely
Example: <span>, <a>, <strong>, <em> etc Example: <div>, <p>, <h1> etc
4. What is a list in HTML? Explain the different types of lists available in HTML.
In HTML, lists are used to represent a collection of different items. There are three types of lists available in HTML, as listed below:
1. Unordered List: It is defined using the <ul> and <li> tags. By default, it represents the items with a bulleted dot.
<ul>
<li>List Item 1</li>
<li>List Item 3</li>
<li>List Item 3</li>
</ul>
2. Ordered List: It is defined using the <ol> and <li> tags. By default, it represents the list of items with numeric digits.
<ol>
[Link] 1/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
<li>List Item 1</li>
<li>List Item 3</li>
<li>List Item 3</li>
</ol>
3. Definition List: It is a special kind of list that is used to list the terms with their definitions in a structured way. It can be defined using the <dl>(definition
list), <dt>(definition term), and <dd>(definition description) tags.
<dl>
<dt>First term</dt>
<dd>Definition 1</dd>
<dt>Second term</dt>
<dd>Definition 2</dd>
<dt>Third term</dt>
<dd>Definition 3</dd>
</dl>
The table below will show the differences between the div and span tags in HTML:
It can be used to group and structure the It is mainly used to interact with and style a
content of the web page. particular part of the web page.
It represents a bigger section of the web It is used to target small parts of the web
page. page.
In HTML, the DOCTYPE declaration is also known as the document type declaration. It defines the document type and tells the browser in which version of
HTML the document is written.
The <iframe> tag is used to embed external documents or web pages inside the current document by specifying their link inside it. It is mainly used to embed
external videos, maps, and other external content.
The <b> and <strong> tags are both used for making the text bold. The <b> is used when we want to highlight only the text. The <strong> is used when we
want to indicate the importance of the text.
In HTML, meta tags are used to define the metadata about the HTML document, including character set, description, keywords, author, and viewport settings.
Placed within the <head> element.
The HTML tags are used to define the elements on the web page. They are the keywords that are enclosed inside the angle brackets(<>). The examples of
HTML tags are <div>, <p>, <a>, <span>, <img> etc.
CSS stands for Cascading Style Sheets. It helps us to design and style the web page to make it attractive for users. It is used to describe how the elements
should be displayed on the screen. CSS provides us with a lot of selectors to select the HTML elements and style them according to the requirements. Some
of the CSS selectors are Element Selectors, Class Selectors, and ID Selectors.
In CSS, selectors are used to select elements and style them element by providing CSS properties to them. Below is the list of some common CSS selectors:
[Link] 2/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
Attribute Selector: Select the elements based on the attribute values. Eg: input[type="text"]{}
Direct Child Selector: Select an element using any of the above selectors and use > followed by a direct child selector. Eg: parent > child{}
Pseudo Selectors: These are selectors like :hover, :nth-child(), ::after, ::before etc.
13. What is the difference between visibility: hidden and display: none properties in CSS?
The visibility: hidden property only hides the content of the element on which it is used. It does not remove the element from the document and keeps the
space as it is, so that no other element can replace it on the UI.
The display: none property not only hides the element but removes it from the document, and the space acquired by the element is now free to be acquired
by the other elements.
Controls both rows and columns Controls either row or column, not both
Suitable for complex, structured layouts Ideal for simple, linear layouts
Allows item placement anywhere in the grid Items follow the document/source order
Can define both rows and columns together Defines layout in a single direction
The float property allows you to set the child elements of a container either on the left side of it or on the right side of it. The possible values for this property
are left, right, initial, inherit, and none.
JavaScript is a high-level scripting language. It is a dynamically typed language. JavaScript is used to add dynamic elements and styles to the HTML
document to make the web page more interactive and attractive. JavaScript is used in both the frontend as well as backend.
Hoisted but initialized as undefined Hoisted but not initialized Hoisted but not initialized
No TDZ (accessible before declaration) Has TDZ (not accessible before declaration) Has TDZ (not accessible before declaration)
Reassigning and redeclaring within the Reassigning is allowed, but redeclaration in the Neither reassigning nor redeclaring is allowed; it is a constant and
same scope is allowed. same scope is not allowed. cannot be reassigned or redeclared.
The == operator is known as the double-equal operator in JavaScript. The == operator checks only for the values of the operands and returns true if the
values are the same.
The === operator is known as the triple-equal the operator. It not only checks for the values of the operands but also the types of the operands. It returns
true only if the values and the type of the operands are the same.
let num = 5;
let str = '5';
[Link](num == str);
[Link](num === str);
Output
true
false
DOM stands for the Document Object Model. In JavaScript, the DOM is used to represent the structure of the web page. It allows us to manipulate the
elements, attributes, and content of a web page using JavaScript. It is a tree-like representation of a web page's HTML structure.
[Link] 3/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
Undefined Value:
The undefined is the default value that is assigned to a variable that is declared but not initialized.
It is also the default return value of a function.
When you try to access some value or property that is not the part of an object, it returns undefined.
Null Value:
[Link](a);
[Link](b);
Output
undefined
null
false
React is an open-source front-end JavaScript library created by Facebook that is used for building user interfaces(UI) based on components. There are various
features that are provided by React.
Component-Based Architecture
Virtual DOM (DOM)
JSX (JavaScript XML)
One-Way Data Binding
Single Page Application (SPA)
State Management
DOM refers to the Document Object Model. Virtual DOM is a virtually created DOM. It is exactly like DOM and it has all the properties that DOM has. But the
main difference is Whenever a code runs JavaScript Framework updates the whole DOM at once which gives a slow performance. Whereas virtual DOM
updates only the modified part of the DOM.
JSX stands for the JavaScript XML. It is the syntax extension for JavaScript. JSX allows us to write the HTML code inside the JavaScript, then React compiles
this code into pure JavaScript that can be rendered by the browser.
In this example, the JSX code inside the App function returns an <h1> element with the text "Hello, React!" which will be displayed in the browser when the
component is rendered.
A Component is one of the core building blocks of React. In other words, we can say that every application we develop in React will be made up of pieces
called components.
Functional Component: They are the simple JavaScript functions that accept the props as the input and return the JSX as output. Functional components
can manage the state and the lifecycle with the help of the React Hooks.
Class Component: The class components are a little more complex than the functional components. The functional components are not aware of the other
components in your program whereas the class components can work with each other. We can pass data from one class component to another class
[Link] 4/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
component.
Angular is an open-source framework that is used for building web applications using TypeScript. Angular is used for building single-page applications
(SPAs). It was developed by Google.
Two-way data binding: Synchronizes data between the model and the view automatically.
Dependency injection: Manages and injects dependencies efficiently to enhance modularity.
Modularization: Break down the application into smaller, reusable modules.
Templating: Uses templates to define the view, providing dynamic and efficient UI updates.
RESTful API handling: Simplifies interaction with RESTful services and APIs.
AngularJS, developed by Google, has been important in web development since its inception in 2009. AngularJS excels at building SPAs. AngularJS,
developed by Google, has been important in web development since its inception in 2009. AngularJS excels at building SPAs.
Unlike Angular, which is TypeScript-based, AngularJS relies on JavaScript and has limited mobile optimization. As AngularJS is now deprecated, developers
are encouraged to migrate to Angular for better performance and maintainability.
Components are the building blocks of Angular. It consists of a TypeScript class, an HTML template, and optional CSS styles.
@Component({
selector: 'app-header',
templateUrl: './[Link]',
styleUrls: ['./[Link]']
})
export class HeaderComponent {
@Input() title: string;
@Input() links: { name: string, url: string }[];
constructor() { }
}
Angular supports two-way data binding, which allows the automatic synchronization of data between the view and the component. If any changes are made
in the component will be reflected in the view, and if any changes are made in the view, they will be reflected in the component. This is known as the two-
way data binding.
In Angular, Lazy Loading is a technique that is used to load the modules on demand instead of loading all the modules at the start. Due to this, the
performance of the application is improved, and the initial load time of the application is also reduced.
Angular Pipes are used to transform the displayed data in the template. They apply the transformation on the input values and return the transformed value.
Due to this, we can directly manipulate the data in the HTML templates.
Syntax
{{ value | pipeName }}
[Link] is the framework of JavaScript, that is used for building single-page applications(SPAs) and user interfaces (UI) for websites. It stands out for its
simplicity, seamless integration with other libraries, and reactive data binding.
A component in VueJS is a reusable piece of code that signifies a part of the user interface. Components make it simpler to handle complex applications by
breaking them down into minor, controllable pieces.
Props in VueJS are custom attributes that permit parent components to pass data to child components. They empower component reusability by making it
possible to handle child components from their parent component. They are specified in the child component and received as arguments from the parent.
Syntax
[Link] 5/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
[Link]('child-component', {
props: ['propName'],
// define component
});
Routing in VueJs is used to navigate the Vue application, permitting the formation of single-page applications with multiple views. Vue Router helps link
between the browser’s URL/History and Vue’s components empowering certain paths to render whatever view is linked with it. A Vue router is utilized in
making single-page applications.
Git is an open-source version control system that helps developers to store, track, and manage code. Git was created by Linus Torvalds in 2005 for Linux
kernel development. The latest version of git is 2.48.1.
Version Control: Git helps in tracking and managing the changes in the code.
Secure: It uses cryptographic hashing to secure the codebase.
Easy to use: It is easy to use because we need to manage the less commands.
Collaboration: Many developers can work together on the same project.
Git GitHub
Git is a distributed version control system (VCS) that helps track changes in source GitHub is a cloud-based platform for hosting Git repositories and facilitating
code. collaboration.
Used to manage source code locally and track changes. Provides a remote hosting service for Git repositories with collaboration features.
Does not provide cloud hosting for repositories. Offers cloud hosting for repositories with features like private/public repositories.
Helps developers track, commit, and merge code changes. Provides features like issue tracking, pull requests, and code review.
Other Git hosting services: GitLab, Bitbucket, etc. GitHub is a Git hosting service with additional features for teamwork.
In Git, the repository is the location in which all the files and the versions of projects are stored, which allows the developers to track the changes made in the
code. There are two types of repository.
localStorage is a client-side web storage mechanism that allows web applications to store key-value pairs persistently in a user’s web browser. It provides a
simple interface for storing data locally.
sessionStorage is a web storage API provided by web browsers to store data in a similar way as stored in the localStorage in the form of key-value pairs. The
data stored in the sessionStorage will only be accessible for one session, such that if the user closes the window or tab, the stored data will be lost.
In HTML, tables are created using the <table> element. Each table consists of rows <tr> and cells <td> for data, and <th> for headers.
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
<th>Country</th>
</tr>
<tr>
<td>GFG</td>
<td>12</td>
<td>India</td>
[Link] 6/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
</tr>
<tr>
<td>Riya</td>
<td>24</td>
<td>India</td>
</tr>
</table>
43. Difference between the GET and the POST methods in HTML forms.
All the form data parameters are visible in None of the parameters are visible
the URL. anywhere.
It has a URL length limit that varies for It has a bigger URL length limit as
different browsers. compared to the limit of the GET method.
Results are cached by the browser by Does not cache the responses in the
default. browser by default.
Users can bookmark the form submission. Responses can be bookmarked easily.
The HTML attributes are used to define the behavior of the HTML element. The attributes are used along with the HTML tags.
Example: div class="container", <p title="This is a GFG">. Here, class and title are the attributes that are used along with the HTML tags to define the HTML
element.
In HTML, void elements are also known as empty elements. Void elements are the elements that do not have a closing tag, they only have the opening tag.
Example: <img>, <meta>, <link>, <br>.
The z-index property is used to control the stacking order of the elements that are positioned using the position property in CSS.
The CSS Box Model defines how elements are sized, positioned, and rendered on a webpage. When a browser loads an HTML document, it creates a DOM
tree and assigns a box to each element. This box calculates the element’s dimensions and position relative to its parent or the root <html> element, ensuring
accurate layout and spacing.
In CSS, Flexbox is the one-dimensional layouts, that align the items either in a single row or column and distribute the space between them due to the
elements can flex or grow and shrink to fit the available space within a container.
1. Inline CSS
Inline CSS is added directly to the HTML element using the style attribute.
[Link] 7/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
2. External CSS
External CSS is written in a separate .css file and linked to the HTML document using the <link> tag.
p {
color: red;
font-size: 16px;
}
3. Internal CSS
Internal CSS is written inside a <style> tag within the <head> section of the HTML file.
<style>
p {
color: green;
font-size: 18px;
}
</style>
</head>
<body>
<p>This paragraph is styled using internal CSS.</p>
</body>
We can import an external CSS file inside another CSS file using @import.
HTML CSS
CSS Preprocessor is a scripting language that generates the Cascading Style Sheets (CSS) from its own syntax.
React Course React Tutorial React Exercise React Basic Concepts React Components React Props React Hooks React Router React Advanced React Examples React Interview Questions React P
The most used CSS preprocessors are SASS and LESS.
SASS is based on the Ruby language, while LESS is based on JavaScript, Initially, it was also based on Ruby but now shifted to JavaScript. They provide
some extra features like creating variables, mixins, code nesting, and some other features to enhance code maintainability.
In JavaScript, Hoisting is the behavior in which during the compilation phase, the variables and the functions declarations are moved to the top of their
respective scopes.
a = 10
var a
[Link](a)
Output
10
a = 10
let a
[Link](a);
Automatically converts data types during operations. Manually converts data types using built-in functions.
Converts string → number, boolean → number, etc., based on context. Uses methods like Number(), String(), Boolean(), parseInt(), etc.
[Link] 8/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
[Link]("5" - 3); // 2 (string converted to number) [Link](String(5) + " is a number"); // "5 is a number"
In JavaScript, the implicit type conversion or coercion conversion can be defined as the automatic conversion of the data type of the variables from one type to
another type. Implicit type conversion mostly occurs when we are performing the arithmetic or the logical operations.
A closure is a function that has access to its scope, the outer function’s variables, and global variables, even after the outer function has finished executing.
This enables functions to “remember” their environment.
function outer() {
let outerVar = "I'm in the outer scope!";
function inner() {
[Link](outerVar);
}
return inner;
}
const closure = outer();
closure();
Output
In this example
The this eyword in JavaScript is an identifier that based on the scope of the function or variable from which it is invoked. The scoping behavior of this
keyword changes based on the scope where it is used.
const person = {
name: "GFG",
greet: function() {
[Link]("Hello, " + [Link]);
}
};
[Link]();
Output
Hello, GFG
In this example
Browsers are not capable of reading JSX they can only read pure JavaScript. The web browsers read JSX with the help of a transpiler. Transpilers are used to
convert JSX into JavaScript. The transpiler used is called Babel.
React Router is a standard library for routing in React. It enables the navigation among views of various components in a React Application, allows changing
the browser URL, and keeps the UI in sync with the URL.
npm i react-router-dom
[Link] 9/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
React hooks was introduced in React 16.8, with the help of the React hooks we can use the state and lifecycle features in the functional components without
using the class components.
Custom Hooks are user-defined functions that encapsulate reusable logic. They enhance code reusability and readability by sharing behavior between
components.
Lifecycle methods in the React are the special methods in class component that allow us to run the code at different stages of a component lifecycle.
Mounting: When the component is created and inserted into the DOM.
Updating: When the component’s state or props change.
Unmounting: When the component is removed from the DOM.
Two-way data binding: Synchronizes data between the model and the view automatically.
Dependency injection: Manages and injects dependencies efficiently to enhance modularity.
Modularization: Break down the application into smaller, reusable modules.
Templating: Uses templates to define the view, providing dynamic and efficient UI updates.
RESTful API handling: Simplifies interaction with RESTful services and APIs.
Angular CLI is a command-line interface tool that helps automate the development workflow, including creating, building, testing, and deploying Angular
applications.
A module is a container for a cohesive group of components, directives, pipes, and services. It is defined using the @NgModule decorator.
A directive in Angular is a special instruction that extends HTML functionality by attaching custom behaviors to elements in the DOM. Directives help
manipulate the structure, appearance, and behavior of elements dynamically.
Component Directives: These are directives with a template, and they form the building blocks of Angular applications (e.g., @Component).
Structural Directives: These alter the layout by adding or removing elements from the DOM (e.g., *ngIf, *ngFor, *ngSwitch).
Attribute Directives: These change the appearance or behavior of an element (e.g., ngClass, ngStyle, custom directives).
Apart from that, Angular allows us to create custom directives to add reusable functionalities and enhance HTML elements based on specific project needs.
Scope: Scope in AngularJS is the binding part of HTML view and JavaScript controller. When you add properties into the scope object in the JavaScript
controller, only then the HTML view gets access to those properties.
Data Binding: Angular provides a function Data Binding which helps us to have an almost real-time reflection of the input given by the user i.e. it creates a
connection between Model and View.
VueJS instance is the root of all Vue application. It is JavaScript object formed by the 'Vue' constructor function and assists as the initiating point for building a
Vue application.
[Link] 10/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
67. What is the watcher in VueJS?
A watcher in [Link] is a mechanism designed to monitor changes in data properties within a component. It allows developers to execute specific functions in
response to those changes, making it useful for handling complex logic when reactive properties are updated.
In VueJS, the Virtual DOM (VDOM) is an approach used to upgrade execution when updating web pages. It works like a blueprint of the real web page's
structure, kept in memory.
When a Vue component changes, Vue first update VDOM instead of directly editing the real DOM.
Then, it matches the improved VDOM with the earlier one to figure out the smallest number of changes vital in the real DOM.
Hooks are a new feature introduced in VueJS 3. Hooks are functions that permit adding reusable logic to components. They permit managing state, lifecycle
events, and side effects within functional components.
'onMounted' : The 'onMounted' hook enacts directly after the component is mounted onto the DOM. It is best for executing tasks like DOM manipulations
or fetching data, assuring these operations happen at the right moment while the component's lifecycle.
'onUnmounted' : The 'onUnmounted' hook initiates just before the component is eliminated from the DOM. It is impeccable for doing cleanup tasks,
assuring that any vital operations are done before the component is no longer active in the application.
Vue CLI (Command Line Interface) is a tool for fast support VueJS projects. This is a command-line utility that permits you to choose from a range of build
tools. With Vue CLI, developers can rapidly set up a new project with best practices and modern build tools like Webpack or Vite.
The <a> tag (anchor tag) in HTML is used to create a hyperlink on the webpage. This hyperlink is used to link the webpage to other web pages. It’s either
used to provide an absolute reference or a relative reference as its “href” value. Click Here to know more in detail.
Syntax
This task can be achieved through <marquee> tag in HTML that helps to create scrolling text or image on a webpage. It scrolls either from horizontally left to
right or right to left, or vertically from top to bottom or bottom to top.
Syntax: The marquee element comes in pairs. It means that the tag has an opening and closing elements.
<marquee>
<--- contents --->
</marquee>
Scripts can be placed inside the body, the head section of an HTML page, inside both head and body, or can be added externally.
JavaScript in head: A JavaScript function is placed inside the head section of an HTML page and the function is invoked when a button is clicked.
JavaScript in the body: A JavaScript function is placed inside the body section of an HTML page and the function is invoked when a button is clicked.
External JavaScript: JavaScript can also be used as external files. JavaScript files have file extension .js . To use an external script put the name of the
script file in the src attribute of a script tag.
74. How you can merge the rows and columns of a HTML table?
We can use the colspan and the rowspan attributes with the <td> element and specify the number of rows and columns to be merged by passing a numerical
value to the defined attributes. The colspan attribute can be used to merge columns while the rowspan to merge the rows.
75. What is the purpose of using <figure> and <figcaption> elements in HTML5?
The <figure> element is used to display the media content on the web page like audios, videos etc. While, the <figcaption> element is used to give a caption
or legend to the content shown by the <figure> element.
The pseudo classes and pseudo elements are different entities in CSS. They are combinely known as pseudo selectors in CSS. Below is the explanation for
them:
pseudo classes: These are the classes that selects the elements based on their state and the position. Some pseudo classes are :hover, :focus, :nth-child
etc.
[Link] 11/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
pseudo elements: These are the virtual elements that are mainly defined to style a particular part of an element in the HTML document. Some pseudo
elements are :before and :after.
Media queries are the block of CSS code defined for a particular width or range of the width. These can be defined using the @media keyword with screen to
specify styles for a particular width or range of width. They are used very commonly to create responsive designs.
There are some key concepts available in CSS that can help you in creating responsive designs as listed below
79. How you can optimize the loading of CSS files in browser?
There are multiple techniques available to optimize loading of CSS files as listed below
Cascading represents the specificity order in applying styles. These styles can be defined by the user, author or they can be the default browser styles. The
specificity order for the styles is user styles > author styles > default browser styles.
Redux is the state management library for React applications. Redux simply helps to manage the state of your application or in other words, it is used to
manage the data of the application. It is used with a library like React.
Context API in React is used to share data between the components without passing the props(prop drilling) manually through every level. It allows to create
global state of data providing global access to all the components.
Built-in React feature for prop drilling prevention and state sharing across components. A state management library for complex global state handling.
Works best for lightweight state sharing (e.g., theme, language, auth state). Best for large-scale applications with complex data flow.
No extra installation needed (built into React). Requires installing Redux (npm install redux react-redux).
Every consumer component re-renders on state updates. Efficient updates using Redux's selective rendering (connect, useSelector).
Small to medium apps user authentication, language settings. Large-scale apps, Complex state like API caching, notifications, user sessions.
Prop drilling in React refers to the process of passing data (props) from a parent component down to deeply nested child components through multiple
intermediate components, even if those intermediate components do not directly use the data. This can lead to unnecessary complexity and reduced
maintainability.
[Link] 12/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
85. What is Debouncing in JavaScript?
In JavaScript, debouncing is commonly used to enhance browser performance by ensuring that expensive operations (like complex calculations, API calls, or
DOM updates) are executed only when necessary. JavaScript operates in a single-threaded environment, meaning it can only handle one operation at a time.
When certain actions are triggered too frequently, such as during continuous scrolling or typing, it can overload the browser and cause sluggish performance.
Java JavaScript
Compiled into bytecode (.class files) that runs on JVM Runs in the browser (Frontend) and also on servers ([Link])
Class-based OOP (Objects are created from classes) Prototype-based OOP (Objects inherit from other objects)
Faster for heavy computations (since it runs on JVM) Slower for CPU-intensive tasks (single-threaded)
Automatic Garbage Collection (JVM handles it) Automatic Garbage Collection (handled by the browser/[Link])
Template Literal in ES6 provides new features to create a string that gives more control over dynamic strings. Traditionally, String is created using single
quotes (‘) or double quotes (“) quotes. Template literal is created using the backtick (`) character.
Higher-order components or HOC is the advanced method of reusing the component functionality logic. It simply takes the original component and returns
the enhanced component.
The Temporal Dead Zone refers to the period between the entering of a scope and the actual declaration of a variable using let or const. During this period,
the variable is in an "uninitialized" state and accessing it will result in a ReferenceError.
Returns a new function with this value and arguments bound, but does not execute it
Calls a function immediately with a given this value and arguments.
immediately.
Executes the function immediately. Does not execute the function immediately, instead returns a new function.
Returns the result of the function execution. Returns a new function with this permanently bound.
js function greet() { [Link]([Link]); } let user = { name: "Sandeep" js function greet() { [Link]([Link]); } let user = { name: "Sandeep" }; let newGreet =
}; [Link](user); // Output: "Sandeep" [Link](user); newGreet(); // Output: "Sandeep"
There are four kinds of directives in AngularJS those are described below
Element directives
Attribute directives
CSS class directives
Comment directives
AngularJS Factory Method makes the development process of AngularJS application more robust.
A factory is a simple function that allows us to add some logic to a created object and return the created object.
The factory is also used to create/return a function in the form of reusable code which can be used anywhere within the application.
[Link] 13/16
7/7/25, 6:18 PM Frontend Developer Interview Questions and Answers - GeeksforGeeks
Whenever we create an object using a factory it always returns a new instance for that object.
The object returned by the factory can be integrated(injectible) with different components of the Angularjs framework such as controller, service, filter or
directive.
It is the most important part of the process of data binding in AngularJS. It basically compares the old and new versions of the scope model. The digest cycle
triggered automatically. If we want to trigger the digest cycle manually then we can use $apply().
The Angular router is a library that helps to manage navigation and routing in Angular applications, enabling single-page application (SPA) behavior.
Angular lifecycle hooks are methods that allow you to tap into key moments in a component’s lifecycle. Here are the main lifecycle hooks:
ngOnInit(): Called once after the component’s data-bound properties have been initialized.
ngOnChanges(changes: SimpleChanges): Called whenever one or more data-bound input properties change.
ngDoCheck(): Called during every change detection run, allowing you to implement your own change detection.
ngAfterContentInit(): Called once after Angular projects external content into the component’s view.
ngAfterContentChecked(): Called after every check of projected content.
ngAfterViewInit(): Called once after the component’s view (and child views) has been initialized.
ngAfterViewChecked(): Called after every check of the component’s view (and child views).
ngOnDestroy(): Called just before Angular destroys the component, allowing you to clean up resources.
Vue Loader is a webpack loader for VueJS that permits to write Vue components in '.vue' file format. It empowers VueJS applications to use Single File
Components (SFCs), which encapsulate HTML, CSS, and JavaScript into a single file. They compile these components into JavaScript modules that the
browser can grasp, easing component-based development in VueJS projects.
The 'v-cloak' directive in VueJS hides components until they are compiled, preventing the display of compiled Vue templates on page load. It assures an
effortless user experience by excluding the wavering outcome generated by delayed rendering, utilizing CSS to hide elements as far as Vue processing
completes.
Developers can form and add global level features to Vue via Vue plugin. This can be utilized to add globally available methods to an application. VueFire,
Vue plugin that adds Firebase specific methods and binding to the intact application, is an example of Vue plugin.
Netflix
Adobe
Facebook
Gitlab
Xiaomi
Alibaba
Using CDN: Include VueJS directly via a CDN link in your HTML file:
<script src="[Link]
Using npm: Install VueJS via npm (Node Package Manager) for more advanced projects:
Vue CLI Create Project: Create a new Vue project using Vue CLI:
[Link] 14/16