Frontend Developer Intern
100+ Frontend Developer Intern Interview Questions and Answers
We have a collection of 'N' stones, each stone has a positive integer weight.
On each turn, we choose the two heaviest stones and smash them together. Suppose the stones have weights 'x' and 'y...read more
This question is about finding the weight of the last stone after repeatedly smashing the two heaviest stones together.
Sort the array of stone weights in descending order.
Repeatedly smash the two heaviest stones until there is at most 1 stone left.
If there is 1 stone left, return its weight. Otherwise, return 0.
Given a singly linked list of integers. Your task is to return the head of the reversed linked list.
For example:
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked lis...read more
Frontend Developer Intern Interview Questions and Answers for Freshers
You have been given an array/list 'ARR' of integers. Your task is to find the second largest element present in the 'ARR'.
Note:
a) Duplicate elements may be present. b) If no...read more
Given a binary tree of N nodes and a node of this tree, you need to return a list containing the values of the cousins of the given node in the given binary tree sorted by no...read more
You are given an array/list 'ARR' consisting of N integers, which contains elements only in the range 0 to N - 1. Some of the elements may be repeated in 'ARR'. Your task is to find all ...read more
Implement Trie Data Structure to support these operations:
insert(word) - To insert a string "word" in Trie search(word) - To check if string "word" is present in Trie or not. startsWith(word) - T...read more
Share interview questions and help millions of jobseekers 🌟
Create a trivia game, having certain features like, fetch 5 questions from a given API and user show a single question with multiple options to answer from at a time user can press next or p...read more
You have been given a gold mine represented by a 2-d matrix of size ('N' * 'M') 'N' rows and 'M' columns. Each field/cell in this mine contains a positive integer, the amount of gold in kgs.
In...read more
Frontend Developer Intern Jobs
You are given a binary tree having 'N' nodes. Each node of the tree has an integer value. Your task is to find the maximum possible sum of a simple path between any two nodes (...read more
You are given a string 'STR' containing lowercase English letters from a to z inclusive. Your task is to find all non-empty possible subsequences of 'STR'.
A Subsequence of a string is the...read more
You are given a string 'STR'. The string contains [a-z] [A-Z] [0-9] [special characters]. You have to find the reverse of the string.
For example:
If the given string is: STR = "abcde". You h...read more
You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a squar...read more
You are given a string ‘str’ of size ‘N’. Your task is to remove consecutive duplicates from this string recursively.
For example:
If the input string is ‘str’ = ”aazbbby”, then you...read more
You are given an array/list ‘ARR’ consisting of ‘N’ distinct integers arranged in ascending order. You are also given an integer ‘TARGET’. Your task is to count all the distinct pairs in ‘ARR’ such that...read more
You need to implement the Stack data structure using a Singly Linked List.
Create a class named 'Stack' which supports the following operations(all in O(1) time):
getSize: Retur...read more
Hoisting
what are props and what is Context Api.
All hooks: useState, useEffect, useHistory, useReduce, etc
DOM vs Virtual DOM
callbacks vs Promises vs Async Await
Event Loop and how javascript wo...read more
Why you used object for storing the todo list rather than using an array?
Difference between inline, inline-block and block elements?
What is CDN?
What is the difference between localstorage, se...read more
Object is used for storing the todo list instead of an array because it allows for easier manipulation and organization of data.
Objects allow for key-value pairs, which can be useful for storing additional information about each todo item
Objects provide a more structured way to access and modify data
Objects can be easily sorted and filtered based on specific properties
Objects allow for more flexibility in terms of adding and removing properties dynamically
Q18. Create a responsive template using pure CSS(flex, grid, media query) without using any library or framework!
Creating a responsive template using pure CSS without any library or framework.
Start with a mobile-first approach
Use media queries to adjust layout for different screen sizes
Utilize flexbox and/or grid for layout and positioning
Test on multiple devices and browsers
Q19. Can we send the state from the child component to the parent component?
Yes, we can send the state from a child component to a parent component in React.
Use callback functions to pass data from child to parent
Parent component can pass a function as a prop to child component
Child component can call this function with the data to update parent's state
What is Divide and Conquer algorithm. Give examples where we use this algorithm.
Q21. Can we make a custom hook? How can we make custom hooks and what purpose?
Yes, custom hooks are reusable functions in React that allow you to extract component logic into separate functions.
Custom hooks are created by prefixing the function name with 'use' and can be used to share logic between components.
They can be used to manage state, side effects, and other features in functional components.
For example, a custom hook can be created to fetch data from an API and handle loading and error states.
Custom hooks can also be used to encapsulate comple...read more
Q22. What is React Query? Have you used it in any of your projects?
React Query is a library for managing server state in React applications.
React Query is used for fetching, caching, synchronizing and updating server state in React applications.
It provides hooks like useQuery and useMutation to interact with server data.
React Query helps in handling loading, error and stale data states efficiently.
Example: const { data, isLoading, isError } = useQuery('todos', fetchTodos)
What are higher order functions?
Higher order functions are functions that can take other functions as arguments or return functions as their results.
Higher order functions can be used to create more flexible and reusable code.
They enable functional programming paradigms.
Examples of higher order functions include map, filter, and reduce in JavaScript.
Design and develop and todo list type of application using localstorage.
A todo list application using localstorage.
Use HTML, CSS, and JavaScript to create the user interface.
Use the localstorage API to store and retrieve todo items.
Implement features like adding, editing, and deleting todo items.
Display the list of todo items and their status.
Allow users to mark todo items as completed or incomplete.
What is hoisting in javascript?
Hoisting is a JavaScript behavior where variable and function declarations are moved to the top of their containing scope.
Hoisting applies to both variable and function declarations.
Variable declarations are hoisted but not their initializations.
Function declarations are fully hoisted, including their definitions.
Hoisting can lead to unexpected behavior if not understood properly.
What is a singleton class? Write code for the same.
Q27. How did you implemented API in your code?
I have implemented APIs in my code using various methods such as AJAX, fetch, and axios.
Used AJAX to make asynchronous requests to the server and retrieve data
Used fetch API to make HTTP requests and handle responses
Used axios library to handle HTTP requests and responses
Implemented RESTful APIs to interact with the server
Used API documentation to understand the endpoints and parameters
What are promises in javascript?
Promises in JavaScript are objects that represent the eventual completion or failure of an asynchronous operation.
Promises are used to handle asynchronous operations such as fetching data from a server or reading a file.
They simplify the process of writing asynchronous code by providing a more structured approach.
Promises have three states: pending, fulfilled, or rejected.
They can be chained together using methods like .then() and .catch().
Promises help avoid callback hell an...read more
Design a given signin page using HTML and CSS only.
A signin page designed using HTML and CSS only.
Create a form element to contain the signin inputs
Use appropriate input types for email and password fields
Apply CSS styles to align and format the signin page
Add a submit button to trigger the signin action
What is memoization in js?
Memoization is a technique in JavaScript to cache the results of expensive function calls for future use.
Memoization improves performance by avoiding redundant calculations
It is commonly used in recursive functions or functions with expensive computations
The cached results are stored in a data structure like an object or a map
Memoization can be implemented manually or using libraries like Lodash or Memoizee
What is Temporal Dead Zone?
Temporal Dead Zone is a behavior in JavaScript where variables are not accessible before they are declared.
Temporal Dead Zone occurs when accessing variables before they are declared
Variables in the Temporal Dead Zone cannot be accessed or assigned
The Temporal Dead Zone is a result of JavaScript's hoisting behavior
Example: accessing a variable before it is declared will throw a ReferenceError
What are arrow functions?
Arrow functions are a concise way to write functions in JavaScript.
Arrow functions have a shorter syntax compared to regular functions.
They do not have their own 'this' value.
They do not have the 'arguments' object.
They cannot be used as constructors with the 'new' keyword.
They are commonly used in functional programming and with array methods like 'map' and 'filter'.
Q33. How to change CSS through JavaScript code?
CSS can be changed through JavaScript by accessing the style property of an element and modifying its CSS properties.
Access the element using document.querySelector() or document.getElementById()
Use element.style.propertyName to modify the CSS property
Alternatively, add or remove CSS classes using element.classList.add() and element.classList.remove()
Use CSS variables to dynamically change multiple properties at once
What is a process in OS?
Q35. What are the Features of React JS?
React JS is a popular JavaScript library for building user interfaces.
Component-based architecture
Virtual DOM for efficient updates
JSX syntax for writing components
One-way data binding
Reusable components
React Native for mobile app development
Q36. What Is UseEffect and UseState Hooks?
UseEffect and UseState are React hooks used for managing state and side effects in functional components.
UseEffect is used to perform side effects in functional components, similar to componentDidMount and componentDidUpdate in class components.
UseState is used to manage state in functional components, allowing for re-rendering when the state changes.
Example: const [count, setCount] = useState(0); useEffect(() => { document.title = `You clicked ${count} times`; });
Q37. What are the different data types present in javascript?
JavaScript has 7 different data types including number, string, boolean, null, undefined, object, and symbol.
Number: represents numeric values
String: represents textual values
Boolean: represents true/false values
Null: represents intentional absence of any object value
Undefined: represents an uninitialized value
Object: represents a collection of properties
Symbol: represents a unique identifier
Q38. There is a sorted array find first and last occurrence of given number in the array
Find the first and last occurrence of a given number in a sorted array.
Use binary search to find the first occurrence of the number.
Use binary search again to find the last occurrence of the number.
Return the indices of the first and last occurrence.
Q39. What is CSS Grid and why it is being used?
CSS Grid is a layout system that allows for easy creation of complex and responsive web designs.
CSS Grid allows for the creation of complex layouts with rows and columns
It provides a more flexible and efficient way to design web layouts compared to traditional methods
It allows for responsive design without the need for media queries
It can be used in combination with other CSS layout systems like Flexbox
Example: Using CSS Grid to create a responsive image gallery
What is virtual DOM?
Virtual DOM is a lightweight copy of the actual DOM that allows efficient updates and rendering in JavaScript frameworks.
Virtual DOM is a concept used in JavaScript frameworks like React.
It is a lightweight copy of the actual DOM tree.
Changes made to the virtual DOM are compared with the actual DOM to determine the minimal updates needed.
This helps in efficient rendering and improves performance.
Virtual DOM allows developers to write code as if the entire page is rendered on ...read more
Q41. What is map, reduce and filter?
map, reduce, and filter are higher-order functions in JavaScript used to manipulate arrays.
map: creates a new array by applying a function to each element of the original array
reduce: applies a function to an accumulator and each element in the array, reducing it to a single value
filter: creates a new array with all elements that pass a test implemented by a provided function
Q42. what can be done if access is to be defined in redux
Access in Redux can be defined by creating actions and reducers to manage state changes.
Define action types to represent different types of access (e.g. READ, WRITE, DELETE)
Create action creators to dispatch actions for defining access
Write reducers to update the state based on the dispatched actions
Use selectors to access the defined access in components
Q43. What about the hybrid mode. and working in early stage startups?
Hybrid mode refers to a combination of remote and in-office work, common in early stage startups.
Hybrid mode allows for flexibility in work location, combining the benefits of remote work with in-person collaboration.
Working in early stage startups can be exciting and fast-paced, with opportunities to take on diverse responsibilities and make a significant impact.
It is important to be adaptable and willing to wear multiple hats in a startup environment.
Communication skills ar...read more
Q44. What small features can we add in website to make it look more professional
Adding small features like responsive design, clear navigation, consistent branding, and interactive elements can make a website look more professional.
Implement responsive design to ensure the website looks good on all devices
Ensure clear and intuitive navigation for easy user experience
Maintain consistent branding elements such as colors, fonts, and logos
Incorporate interactive elements like animations, hover effects, or microinteractions
What is IIFE?
IIFE stands for Immediately Invoked Function Expression. It is a JavaScript function that is executed as soon as it is defined.
IIFE is a way to create a function expression and immediately invoke it.
It helps in creating a private scope for variables and functions.
It is commonly used to avoid polluting the global namespace.
IIFE can be written using different syntaxes like using parentheses, function declaration, or arrow functions.
What is JSX?
JSX is a syntax extension for JavaScript that allows you to write HTML-like code in your JavaScript files.
JSX stands for JavaScript XML
It is commonly used with React to define the structure and appearance of components
JSX elements are transpiled into regular JavaScript function calls
It allows you to write HTML-like code with JavaScript expressions embedded within curly braces
Example:
Hello, {name}!
Q47. What is the purpose of FLEX property in CSS Flexbox?
The purpose of the FLEX property in CSS Flexbox is to define how a flex item will grow or shrink to fit the available space.
The FLEX property is used to set the initial size of a flex item.
It can be used to specify how much a flex item can grow or shrink relative to the other flex items.
The FLEX property is a shorthand for the FLEX-GROW, FLEX-SHRINK, and FLEX-BASIS properties.
Q48. Simple case study on how to design a restaurant website
Design a restaurant website with menu, reservation system, and location map.
Include high-quality images of the restaurant, food, and ambiance
Create a user-friendly navigation menu for easy access to different sections
Implement a reservation system with date, time, and party size options
Integrate a location map with directions and contact information
Ensure mobile responsiveness for easy access on different devices
Q49. Describe doc type used in HTML programming language
Doc type declaration specifies the version of HTML used in a document.
Doc type declaration is the first line of an HTML document
It starts with followed by the version of HTML used
It helps the browser to render the page correctly
Example: for HTML5
Q50. What is the difference between ==and === in JavaScript?
Interview Questions of Similar Designations
Top Interview Questions for Frontend Developer Intern 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