Front end Developer
100+ Front end Developer Interview Questions and Answers for Freshers
Q51. How Document Object Model works ?
The Document Object Model (DOM) is a programming interface for web documents. It represents the structure of a document as a tree of objects.
DOM is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document.
It provides a structured representation of the document as a tree of objects, where each node represents a part of the document.
DOM allows developers to manipulate the document...read more
Q52. Difference between let and var in javascript
let is block scoped while var is function scoped in JavaScript.
let is block scoped, meaning it is only accessible within the block it is declared in.
var is function scoped, meaning it is accessible throughout the function it is declared in.
Using let can help prevent variable hoisting issues.
let allows you to redeclare a variable in the same scope, while var does not.
Q53. Explain the difference between Es 5 and Es 6?
ES5 is the fifth version of ECMAScript, while ES6 is the sixth version. ES6 introduced new features and syntax improvements.
ES5 is widely supported by all major browsers, while ES6 support is gradually increasing.
ES6 introduced let and const for variable declarations, arrow functions, classes, and modules.
ES6 also added new built-in methods like map, filter, and reduce for arrays.
ES6 introduced template literals, destructuring assignment, and default function parameters.
Q54. Difference between javascript and java
JavaScript is a scripting language used for web development, while Java is a general-purpose programming language.
JavaScript is primarily used for client-side scripting and web development.
Java is a compiled language used for building applications that can run on any platform.
JavaScript is dynamically typed, while Java is statically typed.
JavaScript has a prototype-based object-oriented programming model, while Java has a class-based model.
JavaScript is often embedded within ...read more
Q55. How to add background image
To add a background image, use CSS background-image property.
Create a CSS class or ID for the element you want to add the background image to.
Use the background-image property to specify the URL of the image.
Set the background-size property to cover or contain the element.
Example: .container { background-image: url('image.jpg'); background-size: cover; }
Q56. Async await in Javascript
Async/await is a syntax for writing asynchronous code in a synchronous way.
Async/await is built on top of Promises.
Async functions always return a Promise.
Await can only be used inside an async function.
Async/await makes code easier to read and write compared to using callbacks or Promises.
Share interview questions and help millions of jobseekers 🌟
Q57. Difference between== and===.
The == operator checks for equality, while the === operator checks for both equality and type.
The == operator performs type coercion, meaning it converts the operands to a common type before comparison.
The === operator does not perform type coercion and requires both the value and type to be the same for equality.
For example, 1 == '1' returns true because the operands are coerced to the same type, but 1 === '1' returns false.
Q58. What is Redux? Why it is used ?
Redux is a predictable state container for JavaScript apps. It helps manage the state of an application in a single immutable state tree.
Redux is commonly used with React to manage the state of the application.
It provides a centralized store for all the state in an application.
Actions are dispatched to update the state in Redux.
Reducers specify how the state changes in response to actions.
Redux helps in maintaining a predictable state flow in the application.
It simplifies the...read more
Front end Developer Jobs
Q59. what is the web?
The web is a system of interconnected documents and resources accessed via the internet.
The web is made up of websites, web pages, and web applications.
It allows users to access information, communicate, and interact with others online.
The web relies on protocols like HTTP and HTML to function.
Examples include websites like Google, Facebook, and Wikipedia.
Q60. What is React JS What is JSX What is prop drilling
React JS is a JavaScript library for building user interfaces.
React JS allows developers to create reusable UI components
JSX is a syntax extension for JavaScript that allows developers to write HTML-like code in their JavaScript files
Prop drilling is the process of passing props down through multiple levels of nested components in order to access them in a lower-level component
Q61. What is virtual dom and advantages of it
Virtual DOM is a lightweight copy of the actual DOM, used to improve performance and reduce unnecessary re-rendering of web pages.
Virtual DOM updates only the necessary parts of the page, reducing the need for full page reloads.
It allows for faster rendering and improved user experience.
React is a popular library that uses Virtual DOM to manage updates efficiently.
Q62. How to build websites with mern stack
MERN stack is a combination of MongoDB, Express.js, React.js, and Node.js used to build full-stack web applications.
Start by setting up the backend with Node.js and Express.js
Use MongoDB as the database to store and retrieve data
Build the frontend using React.js to create interactive user interfaces
Connect the frontend and backend using APIs
Deploy the application on a hosting platform like Heroku or AWS
Q63. Psuedo classes in css?
Pseudo classes in CSS are used to select and style elements based on their state or position in the document.
Pseudo classes start with a colon (:) followed by the name of the pseudo class
Common pseudo classes include :hover, :active, :focus, :first-child, :last-child
Pseudo classes can be used to style links, form elements, and other interactive elements
Pseudo classes can also be combined with other selectors to create more specific styles
Q64. Find second largest number in the array
Find the second largest number in an array of strings.
Convert the array of strings to an array of numbers.
Sort the array in descending order.
Return the second element in the sorted array.
Q65. Difference between let and var.
let is block-scoped while var is function-scoped.
let variables are only accessible within the block they are declared in
var variables are accessible within the entire function they are declared in
let variables can be reassigned but not redeclared
var variables can be both reassigned and redeclared
let variables are a safer option for avoiding variable hoisting issues
Q66. Explain about async await promise with example
async/await is a syntax for handling asynchronous operations in JavaScript using promises.
async/await is built on top of promises and provides a more readable and synchronous-like code structure.
The 'async' keyword is used to define an asynchronous function.
The 'await' keyword is used to pause the execution of an async function until a promise is resolved or rejected.
Async functions always return a promise.
Async/await can be used to handle multiple asynchronous operations in ...read more
Q67. Pass data from parent compnent to child component.
Data can be passed from parent component to child component in React using props.
Parent component can pass data to child component by including it as a prop in the child component's JSX.
The data can be accessed in the child component using the props object.
Props are read-only and cannot be modified by the child component.
Example:
Q68. Which are the hooks used in react
Some common hooks used in React are useState, useEffect, useContext, and useRef.
useState - used to add state to functional components
useEffect - used to perform side effects in functional components
useContext - used to access context in functional components
useRef - used to create mutable object references in functional components
Q69. Difference between flex and grid
Flex is one-dimensional layout while Grid is two-dimensional layout.
Flex is used for creating flexible and responsive layouts.
Grid is used for creating complex and structured layouts.
Flex is best suited for small-scale layouts while Grid is best suited for large-scale layouts.
Flex is easier to learn and implement while Grid requires more advanced knowledge.
Flex is supported by older browsers while Grid has limited support in older browsers.
Q70. Find the vowels count in a given string
Count the number of vowels in a given string
Iterate through each character in the string and check if it is a vowel (a, e, i, o, u)
Keep a count of the vowels encountered
Return the total count of vowels in the string
Q71. What is constructor in java
Constructor in Java is a special type of method that is used to initialize objects.
Constructor has the same name as the class it belongs to
It does not have a return type
It is called when an object of a class is created
Constructors can be overloaded
Q72. What is a SQL
SQL stands for Structured Query Language. It is a programming language used for managing and manipulating relational databases.
SQL is used to communicate with databases and perform various operations like querying, inserting, updating, and deleting data.
It provides a standardized way to interact with databases, making it easier to work with data.
SQL is not a programming language in the traditional sense, but rather a language for managing and manipulating data within database...read more
Q73. What is front end development
Front end development is the creation of the user interface and user experience of a website or application.
Involves HTML, CSS, and JavaScript
Focuses on the visual and interactive aspects of a website or application
Requires knowledge of design principles and user behavior
Examples include creating responsive layouts, implementing animations, and optimizing performance
Q74. Difference between position and relative
Position sets an element's position relative to its parent, while relative sets an element's position relative to its normal position.
Position: sets an element's position relative to its parent container
Relative: sets an element's position relative to its normal position
Positioned elements are taken out of the normal flow of the document
Relative elements are still in the normal flow of the document
Positioned elements can be moved outside of their parent container
Relative elem...read more
Q75. For Loop in python
A for loop is used to iterate over a sequence (such as a list, tuple, or string) and perform a set of actions for each item.
The for loop syntax in Python is: for item in sequence:
The 'item' variable represents the current item in the sequence.
The 'sequence' can be any iterable object, like a list or a string.
Indentation is important in Python, as it defines the block of code to be executed for each iteration.
The range() function can be used to generate a sequence of numbers t...read more
Q76. tell me some Html tags
HTML tags are used to structure content on a web page.
<h1> - Heading tag
<p> - Paragraph tag
<a> - Anchor tag for links
<img> - Image tag
<ul> - Unordered list tag
Q77. what is use context in react
Context provides a way to pass data through the component tree without having to pass props down manually at every level.
Context is primarily used when data needs to be accessed by many components at different nesting levels.
It helps in avoiding prop drilling, where props are passed through multiple levels of components.
Context is created using React.createContext() and accessed using useContext() hook or Consumer component.
Q78. Types of variable in JavaScript
Types of variables in JavaScript include var, let, and const.
var: globally scoped or function scoped
let: block scoped, can be reassigned
const: block scoped, cannot be reassigned
Q79. What is javascript?
JavaScript is a high-level, interpreted programming language that is used to make web pages interactive and dynamic.
JavaScript is commonly used for client-side web development.
It can be used to create interactive features like forms, animations, and dynamic content.
JavaScript can also be used for server-side development with Node.js.
Q80. What is directive in angular
Directives in Angular are markers on a DOM element that tell Angular to attach a specified behavior to that DOM element or transform the DOM element and its children.
Directives are used to create reusable components or add behavior to existing components.
There are three types of directives in Angular: Component, Structural, and Attribute directives.
Examples of directives include ngIf, ngFor, ngStyle, and ngClass.
Q81. what is anyonmous functions
Anonymous functions are functions that are declared without a name.
Anonymous functions are often used as arguments to other functions.
They are commonly used in event handling, callbacks, and closures.
Example: const add = function(a, b) { return a + b; }
Q82. Selectors in css?
Selectors in CSS are patterns used to select and style HTML elements.
Selectors are used to target specific elements in an HTML document
There are different types of selectors like element selectors, class selectors, ID selectors, etc.
Selectors can be combined to create complex selectors
Examples: 'h1' selects all h1 elements, '.class' selects elements with a specific class, '#id' selects elements with a specific ID
Q83. Purposes of navigation.
Navigation serves the purpose of helping users move around a website or application.
Allows users to easily access different sections of the website
Helps users understand the structure and hierarchy of the website
Improves user experience by providing clear and concise directions
Can include various types of navigation such as menus, breadcrumbs, and search bars
Q84. different b/w promise and callback
Promises are objects representing the eventual completion (or failure) of an asynchronous operation, while callbacks are functions passed as arguments to be executed after a task is completed.
Promises provide a more structured way to handle asynchronous operations compared to callbacks.
Promises can be chained together to handle multiple asynchronous tasks in a more readable manner.
Callbacks can lead to callback hell, where multiple nested callbacks make the code hard to read ...read more
Q85. How to achieve Lazy loading
Lazy loading is a technique used to defer loading of non-essential resources until they are needed.
Lazy loading can be achieved by using JavaScript to load resources only when they are in the viewport.
Implementing lazy loading can improve page load times and overall performance.
Popular libraries like Intersection Observer can be used to implement lazy loading in web applications.
Q86. While loop in python
A while loop is a control flow statement that allows code to be executed repeatedly based on a condition.
The loop continues until the condition becomes false
The condition is checked before each iteration
The loop body must include a way to modify the condition to avoid an infinite loop
Q87. what is html , css
HTML and CSS are essential languages used for creating and styling web pages.
HTML (Hypertext Markup Language) is used for structuring content on a web page.
CSS (Cascading Style Sheets) is used for styling the visual presentation of a web page.
HTML uses tags to define elements like headings, paragraphs, images, and links.
CSS controls the layout, colors, fonts, and other visual aspects of a web page.
Both HTML and CSS are fundamental skills for front end developers.
Q88. what is middleware in react
Middleware in React is a function that intercepts actions before they reach the reducer.
Middleware allows you to write code that has access to the action that was dispatched and can modify it before it reaches the reducer.
Commonly used middleware in React includes Redux Thunk and Redux Saga.
Middleware can be used for logging, crash reporting, asynchronous API calls, and more.
Q89. What is callback hell
Callback hell is a situation in asynchronous programming where multiple nested callbacks make the code difficult to read and maintain.
Callback hell occurs when there are multiple levels of nested callbacks in asynchronous code.
It makes the code difficult to understand, debug, and maintain.
Promises and async/await are solutions to avoid callback hell.
Example: nested callbacks in JavaScript AJAX requests.
Q90. Create a simple drop down menu
Create a simple drop down menu using HTML and CSS
Use element to define the options in the menu
Style the drop down menu using CSS to customize its appearance
Q91. Implementation of denouncing in react
Debouncing is a technique used to limit the number of times a function is called.
Debouncing is useful when dealing with events that trigger frequently, such as scrolling or resizing.
In React, you can implement debouncing using the useEffect hook and a timer.
Here's an example of debouncing a search input: https://codesandbox.io/s/react-debounce-search-input-4z0jv
Q92. Intercepter vs class
Intercepter and class are both used in JavaScript, but serve different purposes.
Intercepter is used to intercept and modify HTTP requests and responses.
Class is used to create objects with properties and methods.
Intercepter is commonly used in frameworks like Angular and React.
Class is a fundamental concept in object-oriented programming.
Intercepter can be used to add authentication headers to requests.
Class can be used to create multiple instances of an object with different...read more
Q93. make react counter application
A React counter application that increments and decrements a number.
Create a state variable to hold the number
Use the useState hook to update the state
Render the number and buttons to increment and decrement it
Add onClick handlers to the buttons to update the state
Q94. Reason for IT field.
IT field offers endless opportunities for innovation and growth.
IT is a constantly evolving field with new technologies and trends emerging regularly.
IT provides opportunities to work on exciting projects and solve complex problems.
IT offers a wide range of career paths, from development to design to project management.
IT is a field that is in high demand, with many job opportunities and competitive salaries.
IT has the potential to make a significant impact on society and imp...read more
Q95. What is react redyx
React Redux is a state management library for React applications.
React Redux is used to manage the state of a React application.
It provides a predictable state container and allows components to access and update the state.
Redux follows a unidirectional data flow pattern.
Actions are dispatched to modify the state, and reducers handle these actions to update the state.
React Redux provides the 'connect' function to connect components to the Redux store.
Selectors can be used to ...read more
Q96. Explain promise in javascript
Promises in JavaScript are objects representing the eventual completion or failure of an asynchronous operation.
Promises are used to handle asynchronous operations in JavaScript.
They can be in one of three states: pending, fulfilled, or rejected.
Promises can be chained using .then() to handle success and .catch() to handle errors.
Example: new Promise((resolve, reject) => { ... }).then(result => { ... }).catch(error => { ... });
Q97. Let and var difference
let is block scoped, var is function scoped
let is block scoped, var is function scoped
let can't be re-declared in the same scope, var can be
let variables are not hoisted, var variables are hoisted
Q98. Different technology awarness
I am aware of various front end technologies such as HTML, CSS, JavaScript, React, Angular, and Vue.
HTML
CSS
JavaScript
React
Angular
Vue
Q99. Expertise in technology
I have expertise in HTML, CSS, JavaScript, and various front-end frameworks like React and Angular.
Proficient in HTML, CSS, and JavaScript
Experience with front-end frameworks like React and Angular
Knowledge of responsive design and cross-browser compatibility
Q100. implment timer in react
To implement a timer in React, you can use the useState hook to manage the timer state and useEffect hook to update the timer.
Use useState hook to initialize timer state
Use useEffect hook to update timer every second
Display the timer value in the component's render method
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