Full Stack Developer

1000+ Full Stack Developer Interview Questions and Answers

Updated 6 Jul 2025
search-icon

Asked in DBS Bank

2d ago

Q. Query and Matrix Problem Statement

You are given a binary matrix with 'M' rows and 'N' columns, initially consisting of all 0s. You will receive 'Q' queries, which can be of four types:

Query 1: 1 R index
Query ...read more
Ans.

Given a binary matrix, perform queries to flip elements in rows/columns and count zeros in rows/columns.

  • Iterate through each query and update the matrix accordingly

  • For type 1 queries, flip the elements in the specified row/column

  • For type 2 queries, count the number of zeros in the specified row/column

  • Return the count of zeros for type 2 queries

Asked in MakeMyTrip

3d ago

Q. Tower of Hanoi Problem Statement

You have three rods numbered from 1 to 3, and 'N' disks initially stacked on the first rod in increasing order of their sizes (largest disk at the bottom). Your task is to move ...read more

Ans.

Tower of Hanoi problem involves moving 'N' disks from one rod to another following specific rules in less than 2^N moves.

  • Implement a recursive function to move disks from one rod to another while following the rules.

  • Use the concept of recursion and backtracking to solve the Tower of Hanoi problem efficiently.

  • Maintain a count of moves and track the movement of disks in a 2-D array/list.

  • Ensure that larger disks are not placed on top of smaller disks during the movement.

  • The solu...read more

Full Stack Developer Interview Questions and Answers for Freshers

illustration image

Asked in PayPal

6d ago

Q. Maximum Difference Problem Statement

Given an array ARR of N elements, your task is to find the maximum difference between any two elements in ARR.

If the maximum difference is even, print EVEN; if it is odd, p...read more

Ans.

Find the maximum difference between any two elements in an array and determine if it is even or odd.

  • Iterate through the array to find the maximum and minimum elements

  • Calculate the difference between the maximum and minimum elements

  • Check if the difference is even or odd and return the result

Asked in Amazon

1d ago

Q. LCA of Binary Tree Problem Statement

You are given a binary tree consisting of distinct integers and two nodes, X and Y. Your task is to find and return the Lowest Common Ancestor (LCA) of these two nodes.

The ...read more

Ans.

Find the Lowest Common Ancestor of two nodes in a binary tree.

  • Traverse the binary tree to find the paths from the root to nodes X and Y.

  • Compare the paths to find the last common node, which is the Lowest Common Ancestor.

  • Implement a recursive function to find the LCA efficiently.

  • Handle edge cases such as when X or Y is the root node or when X or Y is not present in the tree.

Are these interview questions helpful?

Asked in Amazon

5d ago

Q. Count Set Bits Problem Statement

Given a positive integer N, compute the total number of '1's in the binary representation of all numbers from 1 to N. Return this count modulo 1e9+7 because the result can be ve...read more

Ans.

Count the total number of set bits in the binary representation of numbers from 1 to N modulo 1e9+7.

  • Iterate through numbers from 1 to N and count the set bits in their binary representation

  • Use bitwise operations to count the set bits efficiently

  • Return the count modulo 1e9+7 for each test case

Asked in greytHR

6d ago

Q. Most Frequent Non-Banned Word Problem Statement

Given a paragraph consisting of letters in both lowercase and uppercase, spaces, and punctuation, along with a list of banned words, your task is to find the most...read more

Ans.

Find the most frequent word in a paragraph that is not in a list of banned words.

  • Split the paragraph into words and convert them to uppercase for case-insensitivity.

  • Count the frequency of each word, excluding banned words.

  • Return the word with the highest frequency in uppercase.

Full Stack Developer Jobs

Siemens Healthcare logo
Full Stack Developer 2-5 years
Siemens Healthcare
4.1
Bangalore / Bengaluru
IBM India Pvt. Limited logo
Full Stack Developer 4-9 years
IBM India Pvt. Limited
4.0
Bangalore / Bengaluru
SAP India Pvt.Ltd logo
Senior Full stack Developer 10-15 years
SAP India Pvt.Ltd
4.2
Bangalore / Bengaluru

Asked in Lowe's

1d ago

Q. Excel Sheet Column Number Problem Statement

You are provided with a string STR representing a column title in an Excel Sheet. Your task is to determine the corresponding column number.

Example:

A typical exampl...read more

Ans.

Convert Excel sheet column title to corresponding column number.

  • Iterate through the characters in the string from right to left, starting with a result of 0.

  • For each character, calculate its value by subtracting 'A' and adding 1, then multiply by 26 raised to the power of its position from the right.

  • Add up all the calculated values to get the final column number.

  • Example: For input 'AB', A=1, B=2, so result = (1 * 26^1) + (2 * 26^0) = 28.

Asked in Infosys

1d ago

Q. Distinct Strings With Odd and Even Swapping Allowed Problem Statement

You are provided with an array of strings, and your objective is to determine the number of unique strings within it.

A string is deemed uni...read more

Ans.

Determine the number of unique strings in an array by applying swapping operations on odd and even indices.

  • Iterate through each string in the array and check if it can be transformed into another string by swapping characters at odd and even indices.

  • Keep track of unique strings by comparing them with all other strings in the array.

  • Return the count of unique strings found in the array.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in MakeMyTrip

6d ago

Q. Reach the Destination Problem Statement

You are given a source point (sx, sy) and a destination point (dx, dy). Determine if it is possible to reach the destination point using only the following valid moves:

    ...read more
Ans.

Determine if it is possible to reach the destination point from the source point using specified moves.

  • Use depth-first search (DFS) to explore all possible paths from source to destination.

  • Keep track of visited points to avoid infinite loops.

  • Check if the destination point is reachable by following the valid moves.

  • Return true if destination is reachable, false otherwise.

2d ago

Q. Matrix Rank Calculation

Given a matrix ARR of dimensions N * M, your task is to determine the rank of the matrix ARR.

Explanation:

The rank of a matrix is defined as:

(a) The maximum number of linearly independ...read more
Ans.

Calculate the rank of a matrix based on linearly independent column or row vectors.

  • Determine the number of linearly independent column vectors or row vectors in the matrix.

  • Use Gaussian elimination or row reduction to simplify the matrix and find the rank.

  • The rank of a matrix is the maximum number of linearly independent vectors it contains.

Asked in TCS

1d ago

Q. Find Duplicates in an Array

Given an array ARR of size 'N', where each integer is in the range from 0 to N - 1, identify all elements that appear more than once.

Return the duplicate elements in any order. If n...read more

Ans.

The task is to find all duplicate elements in an array of integers.

  • Iterate through the array and keep track of the count of each element using a hashmap.

  • Return all elements from the hashmap with count greater than 1 as the duplicate elements.

Asked in Amazon

5d ago

Q. Find All Pairs Adding Up to Target

Given an array of integers ARR of length N and an integer Target, your task is to return all pairs of elements such that they add up to the Target.

Input:

The first line conta...read more
Ans.

Find all pairs of elements in an array that add up to a given target.

  • Iterate through the array and store each element in a hashmap along with its index.

  • For each element, check if the target minus the element exists in the hashmap.

  • If found, print the pair of elements. If not found, print (-1, -1).

5d ago

Q. Find a Node in Linked List

Given a singly linked list of integers, your task is to implement a function that returns the index/position of an integer value 'N' if it exists in the linked list. Return -1 if the ...read more

Ans.

Implement a function to find the index of a given integer in a singly linked list.

  • Traverse the linked list while keeping track of the index of each element.

  • Compare each element with the target integer 'N'.

  • Return the index if the element is found, otherwise return -1.

  • Handle cases where the target integer is not found in the linked list.

Asked in MakeMyTrip

5d ago

Q. Minimum Operations Problem Statement

You are given an array 'ARR' of size 'N' consisting of positive integers. Your task is to determine the minimum number of operations required to make all elements in the arr...read more

Ans.

Minimum number of operations to make all elements in an array equal by performing addition, subtraction, multiplication, or division.

  • Iterate through the array to find the maximum and minimum elements.

  • Calculate the difference between the maximum and minimum elements.

  • The minimum number of operations needed is the difference between the maximum and minimum elements.

5d ago

Q. Alternating Largest Problem Statement

Given a list of numbers, rearrange them such that every second element is greater than its adjacent elements. Implement a function to achieve this rearrangement.

Input:

The...read more
Ans.

Rearrange a list of numbers such that every second element is greater than its adjacent elements.

  • Iterate through the array and swap elements if needed to satisfy the condition

  • Keep track of the current and next elements to compare and swap

  • Ensure that the swapped elements maintain the desired order

4d ago

Q. Factorial Calculation Problem Statement

Develop a program to compute the factorial of a given integer 'n'.

The factorial of a non-negative integer 'n', denoted as n!, is the product of all positive integers les...read more

Ans.

Program to compute factorial of a given integer 'n', with error handling for negative values.

  • Create a function to calculate factorial using a loop or recursion

  • Check if input is negative, return 'Error' if true

  • Handle edge cases like 0 and 1 separately

  • Return the calculated factorial value

Asked in Freshworks

4d ago

Q. Reverse Integer Problem Statement

Given a 32-bit signed integer N, your task is to return the reversed integer. If reversing the integer causes overflow, return -1.

Input:

The first line contains an integer 'T'...read more
Ans.

The task is to reverse a 32-bit signed integer and handle overflow cases.

  • Create a function that takes a 32-bit signed integer as input

  • Reverse the integer while handling overflow cases

  • Return the reversed integer or -1 if overflow occurs

Asked in Amazon

1d ago

Q. Add Two Numbers as Linked Lists

You are given two singly linked lists, where each list represents a positive number without any leading zeros.

Your task is to add these two numbers and return the sum as a linke...read more

Ans.

Add two numbers represented as linked lists and return the sum as a linked list.

  • Traverse both linked lists simultaneously while keeping track of carry from previous sum

  • Create a new linked list to store the sum of the two numbers

  • Handle cases where one linked list is longer than the other by padding with zeros

  • Update the current node with the sum of corresponding nodes from both lists and carry

Asked in MakeMyTrip

5d ago

Q. Maximum Distance Problem Statement

Given an integer array 'A' of size N, your task is to find the maximum value of j - i, with the restriction that A[i] <= A[j], where 'i' and 'j' are indices of the array.

Inpu...read more

Ans.

Find the maximum distance between two elements in an array where the element at the first index is less than or equal to the element at the second index.

  • Iterate through the array and keep track of the minimum element encountered so far along with its index.

  • Calculate the maximum distance by subtracting the current index from the index of the minimum element.

  • Update the maximum distance if a greater distance is found while iterating.

  • Return the maximum distance calculated.

3d ago

Q. Count Substrings with K Distinct Characters

Given a lowercase string 'STR' and an integer K, the task is to count all possible substrings that consist of exactly K distinct characters. These substrings are not ...read more

Ans.

Count substrings with exactly K distinct characters in a given lowercase string.

  • Iterate through all substrings of length K and count distinct characters.

  • Use a set to keep track of distinct characters in each substring.

  • Increment count if number of distinct characters equals K.

Asked in Nagarro

6d ago

Q. Count Ways to Reach the N-th Stair Problem Statement

You are provided with a number of stairs, and initially, you are located at the 0th stair. You need to reach the Nth stair, and you can climb one or two step...read more

Ans.

The task is to find the number of distinct ways to climb from the 0th step to the Nth step, where each time you can climb either one step or two steps.

  • Use dynamic programming to solve this problem

  • Create an array to store the number of ways to reach each step

  • Initialize the first two elements of the array as 1 and 2

  • For each subsequent step, the number of ways to reach that step is the sum of the number of ways to reach the previous two steps

  • Return the number of ways to reach th...read more

1d ago

Q. Find Indices for Local Minima and Maxima

Given an integer array arr of size N, your task is to determine all indices of local minima and local maxima within the array. Return these indices in a 2-D list, where ...read more

Ans.

The task is to find and return the indices of local minima and local maxima in the given array.

  • Iterate through the array and compare each element with its neighbors to determine if it is a local minima or maxima.

  • Consider corner elements separately by comparing them with only one neighbor.

  • Store the indices of local minima and maxima in separate lists.

  • If there are no local minima or maxima, return -1 as the only row element in the 2-D list.

Asked in MakeMyTrip

5d ago

Q. Sub Sort Problem Statement

You are given an integer array ARR. Determine the length of the shortest contiguous subarray which, when sorted in ascending order, results in the entire array being sorted in ascendi...read more

Ans.

Determine the length of the shortest contiguous subarray that needs to be sorted to make the entire array sorted in ascending order.

  • Iterate from left to right to find the first element out of order.

  • Iterate from right to left to find the last element out of order.

  • Calculate the length of the subarray between the two out of order elements.

2d ago
Q. ...read more

Array Sum Calculation

Calculate the sum of all elements in an array of length N.

Input:

Line 1: An integer N indicating the size of the array.
Line 2: N integers, the elements of the array, separated by spaces.
Ans.

Calculate the sum of all elements in an array of length N.

  • Read the size of the array N and then read N integers as elements of the array.

  • Iterate through the array and add each element to a running total to calculate the sum.

  • Return the final sum as the output.

Asked in MakeMyTrip

4d ago

Q. Make Array Elements Equal Problem Statement

Given an integer array, your objective is to change all elements to the same value, minimizing the cost. The cost of changing an element from x to y is defined as |x ...read more

Ans.

Find the minimum cost to make all elements of an array equal by changing them to the same value.

  • Calculate the median of the array and find the sum of absolute differences between each element and the median.

  • Sort the array and find the median element, then calculate the sum of absolute differences between each element and the median.

  • If the array has an even number of elements, consider the average of the two middle elements as the median.

Asked in Samsung

5d ago

Q. Reverse Linked List Problem Statement

Given a singly linked list of integers, return the head of the reversed linked list.

Example:

Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Ans.

Reverse a singly linked list of integers and return the head of the reversed linked list.

  • Iterate through the linked list and reverse the pointers to point to the previous node instead of the next node.

  • Use three pointers to keep track of the current, previous, and next nodes while reversing the linked list.

  • Update the head of the reversed linked list as the last node encountered during the reversal process.

Asked in HARMAN

3d ago

Q. What steps do you take to ensure accurate project estimates?

Ans.

To ensure accurate project estimates, I follow a structured approach that includes analyzing requirements, breaking down tasks, and considering potential risks.

  • Analyze project requirements thoroughly

  • Break down tasks into smaller, manageable chunks

  • Consider potential risks and challenges

  • Use historical data to inform estimates

  • Collaborate with team members to validate estimates

Asked in Amazon

2d ago

Q. Count Inversions Problem Statement

Given an integer array ARR of size N, your task is to find the total number of inversions that exist in the array.

An inversion is defined for a pair of integers in the array ...read more

Ans.

Count the total number of inversions in an integer array.

  • Iterate through the array and for each pair of elements, check if the inversion condition is met.

  • Use a nested loop to compare each pair of elements efficiently.

  • Keep a count of the inversions found and return the total count at the end.

Asked in Flipkart

4d ago

Q. Ceil Value from BST Problem Statement

Given a Binary Search Tree (BST) and an integer, write a function to return the ceil value of a particular key in the BST.

The ceil of an integer is defined as the smallest...read more

Ans.

Ceil value of a key in a Binary Search Tree (BST) is the smallest integer greater than or equal to the given number.

  • Traverse the BST to find the closest integer greater than or equal to the given key.

  • Compare the key with the current node value and update the ceil value accordingly.

  • Recursively traverse left or right subtree based on the key value to find the ceil value.

  • Return the ceil value once found for each test case.

Asked in CommVault

1d ago

Q. Collect Maximum Coins from Matrix

You are provided with a matrix consisting of 'M' rows and 'N' columns. Each cell in this matrix either contains a coin or is empty.

Your task is to collect the maximum number o...read more

Ans.

Given a matrix with coins and empty cells, collect maximum coins from boundary cells and adjacent cells.

  • Iterate through the boundary cells and collect coins from them and their adjacent cells

  • Keep track of visited cells to avoid collecting the same coin multiple times

  • Use depth-first search or breadth-first search to explore adjacent cells

1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Accenture Logo
3.7
 • 8.7k Interviews
Wipro Logo
3.7
 • 6.1k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
Capgemini Logo
3.7
 • 5.1k Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

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

Full Stack Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits