Full Stack Developer
700+ Full Stack Developer Interview Questions and Answers
Popular Companies
Q101. Trapping Rain Water Problem Statement
You are given a long type array/list ARR
of size N
, representing an elevation map. The value ARR[i]
denotes the elevation of the ith
bar. Your task is to determine the tota...read more
Calculate the total amount of rainwater that can be trapped between given elevations in an array.
Iterate through the array and calculate the maximum height on the left and right of each bar.
Calculate the amount of water that can be trapped at each bar by taking the minimum of the maximum heights on the left and right.
Sum up the trapped water at each bar to get the total trapped water for the entire array.
Q102. Triplets with Given Sum Problem
Given an array or list ARR
consisting of N
integers, your task is to identify all distinct triplets within the array that sum up to a specified number K
.
Explanation:
A triplet i...read more
Identify all distinct triplets within an array that sum up to a specified number.
Iterate through the array and use nested loops to find all possible triplets.
Check if the sum of the triplet equals the specified number.
Print the valid triplets or return -1 if no triplet exists.
Q103. String Palindrome Verification
Given a string, your task is to determine if it is a palindrome considering only alphanumeric characters.
Input:
The input is a single string without any leading or trailing space...read more
Check if a given string is a palindrome considering only alphanumeric characters.
Remove non-alphanumeric characters from the input string.
Compare the string with its reverse to check for palindrome.
Handle edge cases like empty string or single character input.
To maximize the number of balloons burst with an arrow, target the balloons with the most adjacent balloons.
Identify clusters of balloons that are adjacent to each other.
Target the balloons in the clusters with the most adjacent balloons to burst the maximum number.
Consider the position and size of the clusters to strategically burst the balloons.
Q105. Bridge in Graph Problem Statement
Given an undirected graph with V vertices and E edges, your task is to find all the bridges in this graph. A bridge is an edge that, when removed, increases the number of conne...read more
Find all the bridges in an undirected graph by identifying edges that, when removed, increase the number of connected components.
Use Tarjan's algorithm to find bridges in the graph.
Keep track of the discovery time and low time of each vertex during DFS traversal.
An edge (u, v) is a bridge if low[v] > disc[u].
Handle multiple test cases efficiently to find bridges in each graph.
Ensure the output contains the count of bridges and the vertices defining each bridge.
Q106. Circular Move Problem Statement
You have a robot currently positioned at the origin (0, 0) on a two-dimensional grid, facing the north direction. You are given a sequence of moves in the form of a string of len...read more
Determine if a robot's movement path is circular on a 2D grid based on a given sequence of moves.
Iterate through the sequence of moves and keep track of the robot's position and direction.
Check if the robot returns to the starting position after completing the moves.
Use a counter-clockwise rotation (L) and clockwise rotation (R) to update the direction of the robot.
Use 'G' to move the robot one unit in the current direction.
Share interview questions and help millions of jobseekers 🌟
Q107. First Missing Positive Problem Statement
You are provided with an integer array ARR
of length 'N'. Your objective is to determine the first missing positive integer using linear time and constant space. This me...read more
Find the smallest positive integer missing from an array of integers.
Iterate through the array and mark positive integers as visited by changing the sign of the corresponding index.
After marking, iterate again to find the first positive index which is not marked.
Return the index + 1 as the smallest missing positive integer.
Q108. Permutation In String Problem Statement
Given two strings, str1
and str2
, determine whether str2
contains any permutation of str1
as a substring.
Input:
str1 = “ab”
str2 = “aoba”
Output:
True
Example:
Explanatio...read more
Check if a string contains any permutation of another string as a substring.
Iterate through str2 with a sliding window of length str1, check if any permutation of str1 is present.
Use a hashmap to store the frequency of characters in str1 and str2 for comparison.
If the frequencies of characters in the sliding window match the frequencies of characters in str1, return True.
Full Stack Developer Jobs
Q109. Rat in a Maze Problem Statement
You need to determine all possible paths for a rat starting at position (0, 0) in a square maze to reach its destination at (N-1, N-1). The maze is represented as an N*N matrix w...read more
Find all possible paths for a rat in a maze from start to finish, moving in 'U', 'D', 'L', 'R' directions.
Use backtracking to explore all possible paths in the maze.
Keep track of visited cells to avoid loops.
Recursively try moving in all directions and backtrack when reaching dead ends.
Return the valid paths in alphabetical order as an array of strings.
Account Statements Transcription is a full stack application for converting Excel sheets to SQL tables, fetching data in UI, and allowing downloads in various formats.
Create a front-end interface for users to upload Excel sheets
Develop a back-end system to convert Excel data into SQL tables
Implement a query system to fetch data based on user needs in the UI
Provide options for users to download data in Excel or Word formats
Q111. Alien Dictionary Problem Statement
You are provided with a sorted dictionary (by lexical order) in an alien language. Your task is to determine the character order of the alien language from this dictionary. Th...read more
Given a sorted alien dictionary in an array of strings, determine the character order of the alien language.
Iterate through the words in the dictionary to build a graph of character dependencies.
Perform a topological sort on the graph to determine the character order.
Return the character array representing the order of characters in the alien language.
Q112. Buy and Sell Stock - III Problem Statement
Given an array prices
where the ith element represents the price of a stock on the ith day, your task is to determine the maximum profit that can be achieved at the en...read more
Determine the maximum profit that can be achieved by selling stocks with at most two transactions.
Iterate through the array and calculate the maximum profit that can be achieved by selling stocks at each day.
Keep track of the maximum profit after the first transaction and the maximum profit after the second transaction.
Return the maximum profit that can be achieved overall.
Q113. Determine the Left View of a Binary Tree
You are given a binary tree of integers. Your task is to determine the left view of the binary tree. The left view consists of nodes that are visible when the tree is vi...read more
The task is to determine the left view of a binary tree, which consists of nodes visible when viewed from the left side.
Traverse the binary tree level by level from left to right, keeping track of the first node encountered at each level.
Use a queue to perform level order traversal and keep track of the level number for each node.
Store the first node encountered at each level in a result array to get the left view of the binary tree.
Q114. Selection Sort Problem Statement
Implement the Selection Sort algorithm to sort an unsorted array of non-negative integers in non-decreasing order. The algorithm should repeatedly find the minimum element from ...read more
Implement Selection Sort algorithm to sort an array of non-negative integers in non-decreasing order.
Iterate through the array and find the minimum element in the unsorted part.
Swap the minimum element with the first element of the unsorted part.
Repeat the process for the remaining unsorted part until the array is sorted.
Q115. Smallest Window Problem Statement
Given two strings, S
and X
, your task is to find the smallest substring in S
that contains all the characters present in X
.
Example:
Input:
S = "abdd", X = "bd"
Output:
"bd"
Ex...read more
Find the smallest substring in a given string that contains all characters present in another string.
Use a sliding window approach to find the smallest window in S that contains all characters in X
Keep track of the characters in X using a hashmap
Move the window by adjusting the start and end pointers
Return the smallest window found
Q116. Group Anagrams Problem Statement
Given an array or list of strings called inputStr
, your task is to return the strings grouped as anagrams. Each group should contain strings that are anagrams of one another.
An...read more
Group anagrams in an array of strings based on their characters.
Iterate through each string in the input array
Sort the characters of each string and use the sorted string as a key in a hashmap to group anagrams
Return the values of the hashmap as the grouped anagrams
Q117. Problem: Ninja's Robot
The Ninja has a robot which navigates an infinite number line starting at position 0 with an initial speed of +1. The robot follows a set of instructions which includes ‘A’ (Accelerate) a...read more
Determine the minimum length of instruction sequence for a robot to reach a given target on an infinite number line.
Start at position 0 with speed +1, update position and speed based on 'A' and 'R' instructions
For each test case, find the shortest sequence of instructions to reach the target
Consider both positive and negative positions for the robot
Return the minimum length of instruction sequence for each test case
Q118. Sum Tree Conversion
Convert a given binary tree into its sum tree. In a sum tree, every node's value is replaced with the sum of its immediate children's values. Leaf nodes are set to 0. Finally, return the pre...read more
Convert a binary tree into a sum tree by replacing each node's value with the sum of its children's values. Return the preorder traversal of the sum tree.
Traverse the tree in a bottom-up manner to calculate the sum of children for each node.
Set leaf nodes to 0 and update non-leaf nodes with the sum of their children.
Return the preorder traversal of the modified tree.
Q119. How will you separate your business logic, presentation logic, and service logic in angular?
Business logic, presentation logic, and service logic can be separated using Angular's component architecture.
Create separate components for each logic layer
Use services to handle business logic
Use pipes for presentation logic
Keep components simple and focused on one task
Use dependency injection to share services between components
Q120. how would you make sure a computer network is secure?
To ensure computer network security, implement firewalls, use strong passwords, regularly update software, and conduct security audits.
Install and configure firewalls to monitor and control incoming and outgoing network traffic.
Use strong passwords and two-factor authentication to prevent unauthorized access.
Regularly update software and operating systems to patch vulnerabilities.
Conduct regular security audits to identify and address potential security threats.
Implement netw...read more
Q121. Minimum Time in Wormhole Network
Determine the minimum time required to travel from a starting point to a destination point in a two-dimensional coordinate system, considering both direct movement and the use o...read more
Calculate minimum time to travel from source to destination using direct movement and wormholes.
Calculate the time to move directly from source to destination using |dx - sx| + |dy - sy| formula.
Check if using any wormhole reduces the total travel time.
Consider all possible combinations of direct movement and wormhole usage to find the minimum time.
Q122. Remove Character from String Problem Statement
Given a string str
and a character 'X', develop a function to eliminate all instances of 'X' from str
and return the resulting string.
Input:
The first line contai...read more
Develop a function to remove all instances of a given character from a string.
Create a function that takes the input string and character to be removed as parameters.
Iterate through each character in the input string and only add characters that are not equal to the given character to a new string.
Return the new string as the output.
Handle edge cases such as empty input string or character.
Example: Input string 'hello world' and character 'o' should return 'hell wrld'.
Clustered index determines the physical order of data in a table, while non-clustered index has a separate structure.
Clustered index determines the physical order of data in a table
Non-clustered index has a separate structure that includes a copy of the indexed columns and a pointer to the actual data
A table can have only one clustered index, but multiple non-clustered indexes
Clustered index is faster for retrieving large ranges of data, while non-clustered index is faster fo...read more
Git pull combines git fetch and git merge, while git fetch only downloads new data from a remote repository.
Git pull is used to update the local branch with the latest changes from the remote repository.
Git fetch only downloads new data from the remote repository, but does not integrate it into the local branch.
Git pull is a combination of git fetch and git merge commands.
Git fetch is useful to see what changes have been made in the remote repository before merging them into ...read more
Q125. Valid Parentheses Problem Statement
Given a string 'STR' consisting solely of the characters “{”, “}”, “(”, “)”, “[” and “]”, determine if the parentheses are balanced.
Input:
The first line contains an integer...read more
The task is to determine if a given string of parentheses is balanced or not.
Iterate through each character in the string and use a stack to keep track of opening parentheses
If a closing parenthesis is encountered, check if it matches the top of the stack. If not, the string is not balanced
If all parentheses are matched correctly and the stack is empty at the end, the string is balanced
Different methods of session management in Servlet
Cookies
URL Rewriting
Hidden Form Fields
Session Tracking API
HTTP Session
Q127. Tiling Problem Statement
Given a board with 2 rows and N columns, and an infinite supply of 2x1 tiles, determine the number of distinct ways to completely cover the board using these tiles.
You can place each t...read more
The problem involves finding the number of ways to tile a 2xN board using 2x1 tiles.
Use dynamic programming to solve the problem efficiently.
Consider the base cases for N=1 and N=2 to build up the solution for larger N.
Implement a recursive function with memoization to avoid redundant calculations.
Keep track of the number of ways modulo 10^9 + 7 to handle large values of N.
Test the solution with different values of N to ensure correctness.
Optimize website assets loading by minimizing file sizes, leveraging caching, and using asynchronous loading.
Minimize file sizes by compressing images, minifying CSS and JavaScript files
Leverage caching by setting appropriate cache headers and using a content delivery network (CDN)
Use asynchronous loading techniques such as lazy loading, deferred loading, and async/defer attributes
Combine and bundle multiple files to reduce the number of requests
Optimize the order of loading ...read more
New tags in Media Elements in HTML5 include <audio> and <video>.
<audio> tag for audio content
<video> tag for video content
Attributes like controls, autoplay, loop, etc. can be used with these tags
Multithreading allows multiple threads to run concurrently, while semaphores are used to control access to shared resources in a synchronized manner.
Multithreading involves running multiple threads within a single process, allowing for parallel execution of tasks.
Semaphores are used to control access to shared resources by allowing only a certain number of threads to access the resource at a time.
Semaphores can be binary (mutex) or counting, with binary semaphores used for mu...read more
Prisoners must devise a strategy to guess the color of their own hat based on the hats of others.
Prisoners can agree on a strategy before the hats are assigned.
One strategy is for each prisoner to count the number of hats of a certain color and use that information to guess their own hat color.
Another strategy involves using parity to determine the color of their own hat.
Prisoners can also use a signaling system to convey information about their hat color to others.
Spring Boot is a framework that simplifies the development of Java applications by providing default configurations and dependencies.
Spring Boot eliminates the need for manual configuration by providing sensible defaults.
It uses an embedded server, such as Tomcat or Jetty, to run the application.
Spring Boot automatically configures the application based on the dependencies added to the project.
It promotes convention over configuration, reducing boilerplate code.
Spring Boot su...read more
Web services offer advantages such as interoperability, scalability, reusability, and platform independence.
Interoperability: Web services allow different applications to communicate and share data regardless of the programming languages or platforms they are built on.
Scalability: Web services can handle a large number of requests and can be easily scaled up or down to meet changing demands.
Reusability: Web services promote code reuse as they can be accessed by multiple appli...read more
CORS in MVC is Cross-Origin Resource Sharing, a mechanism that allows restricted resources on a web page to be requested from another domain.
CORS is a security feature implemented in web browsers to prevent cross-origin requests by default.
It works by adding specific HTTP headers to the server's response, indicating which origins are allowed to access the resources.
In MVC, CORS can be configured using the 'EnableCors' attribute on controllers or by configuring it in the 'Web....read more
Q135. What is your weakness ans strength?
My strength is problem-solving and my weakness is public speaking.
Strength: Proficient in identifying and solving complex problems
Weakness: Nervousness while speaking in front of large audiences
Strength: Ability to learn and adapt to new technologies quickly
Weakness: Difficulty in delegating tasks to others
Strength: Attention to detail and ability to work under pressure
Weakness: Tendency to overthink and second-guess decisions
Q136. What is package.json what are the different segments?
package.json is a file used in Node.js projects to manage dependencies and scripts.
Contains metadata about the project
Lists dependencies and devDependencies
Scripts for running tasks
Version of Node.js required
Author and license information
I was asked to solve MongoDB queries and determine the best way to execute them.
I was asked to write queries to retrieve specific data from MongoDB collections.
I used aggregation pipelines to perform complex queries involving multiple stages.
I optimized queries by creating indexes on frequently accessed fields.
I utilized MongoDB's query optimizer to analyze and improve query performance.
I used explain() method to understand query execution plans and make necessary adjustments...read more
Q138. what do you do when you cant solve an issue?
I research, ask for help, and try different approaches until I find a solution.
I start by researching the issue thoroughly, looking for similar problems and solutions online.
If that doesn't work, I ask for help from colleagues or online communities.
I also try different approaches and solutions until I find one that works.
If all else fails, I escalate the issue to a higher authority or seek additional resources.
I document the issue and solution for future reference.
Q139. 2. What's OOPs and how do we implement it in Fuctional Programming vs Traditional Programming?
OOPs is Object-Oriented Programming. It is implemented differently in Functional Programming and Traditional Programming.
OOPs is a programming paradigm that focuses on objects and their interactions.
In Traditional Programming, OOPs is implemented using classes, objects, and inheritance.
In Functional Programming, OOPs is implemented using higher-order functions and immutable data.
Functional Programming emphasizes pure functions and avoids mutable state.
In Traditional Programmi...read more
Q140. Python is interpreted then why .pyc files are there?
Python compiles source code to bytecode for faster execution, stored in .pyc files.
Python interpreter compiles source code to bytecode before execution
Bytecode is platform-independent and faster to execute than source code
Compiled bytecode is stored in .pyc files for future use and faster startup time
If source code is modified, .pyc files are automatically recompiled
A Java 8 program to iterate a Stream using the forEach method.
Create a Stream object from a collection or array
Use the forEach method to perform an action on each element of the Stream
The action can be a lambda expression or a method reference
Dependency Injection is a design pattern where the dependencies of a class are provided externally rather than being created within the class itself.
Dependency Injection helps in achieving loose coupling between classes.
It allows for easier testing and maintenance of code.
In Spring Boot, dependencies are injected using annotations like @Autowired.
Example: In a Spring Boot application, if a class requires a database connection, the connection object can be injected into the cl...read more
Mutex and Semaphore are synchronization mechanisms used in operating systems to control access to shared resources.
Mutex is used to provide mutual exclusion, allowing only one thread to access a resource at a time.
Semaphore is used to control access to a resource by multiple threads, with a specified number of permits available.
Mutex is binary in nature (locked or unlocked), while Semaphore can have a count greater than 1.
Example: Mutex can be used to protect critical section...read more
Java 8 streams are a sequence of elements that can be processed in parallel or sequentially.
Streams provide a functional programming approach to process collections in Java.
They allow for concise and expressive code.
Streams can be used to filter, map, reduce, and perform other operations on data.
Example: List
numbers = Arrays.asList(1, 2, 3, 4, 5); numbers.stream().filter(n -> n % 2 == 0).forEach(System.out::println); This example filters even numbers from the list and prints ...read more
SQL injection is a web security vulnerability that allows an attacker to manipulate a database query to execute unauthorized actions.
SQL injection occurs when user-supplied data is not properly validated or sanitized before being used in an SQL query.
Attackers can exploit this vulnerability to bypass authentication, retrieve sensitive data, modify or delete data, or even execute arbitrary commands.
To prevent SQL injection, use parameterized queries or prepared statements, inp...read more
Q146. what is meant by one-on-one round?
One-on-one round refers to a meeting or interview between two individuals.
It is a private conversation between two people.
It is usually conducted to discuss a specific topic or issue.
It can be a part of a larger group interview process.
Examples include job interviews, performance evaluations, and coaching sessions.
Q147. What are the classes needed to create a GET REST API?
Classes needed to create a GET REST API
Controller class to handle the request
Service class to perform business logic
Repository class to interact with database
Model class to define data structure
RequestMapping annotation to map the URL
Q148. How you'll get data from backend and how you'll pass the data to the view?
Data can be fetched using APIs and passed to the view using templating engines or front-end frameworks.
Use AJAX calls to fetch data from the backend APIs
Parse the data received in JSON format
Use templating engines like Handlebars or front-end frameworks like React to pass the data to the view
Render the data dynamically on the view
Various MongoDB queries were asked based on the scraped data.
Filtering documents based on specific criteria
Sorting documents in ascending or descending order
Performing aggregation operations like grouping and counting
MVC components include Model, View, and Controller. Model represents data and business logic, View displays the data, and Controller handles user input and updates the Model and View.
Model: Represents data and business logic
View: Displays the data to the user
Controller: Handles user input and updates the Model and View
Interview Questions of Similar Designations
Top Interview Questions for Full Stack 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