Full Stack Developer

100+ Full Stack Developer Interview Questions and Answers for Freshers

Updated 12 Nov 2024

Popular Companies

search-icon
Q1. Query And Matrix

You are given a binary matrix with ‘M’ rows and ‘N’ columns initially consisting of all 0s. 'Q' queries follow. The queries can be of 4 types:

Query 1: 1 R index Query 2: 1 C index Query 3: 2 R ...read more
Q2. SQL Questions

You are given the details of retail outlet. Your task is to analyze the data from the provided relations and write an SQL query to display the names and number of distinct locations where the retai...read more

Q3. Most Frequent Word

You are given a paragraph that may have letters both in lowercase and uppercase, spaces, and punctuation. You have also given a list of banned words. Now your task is to find the most frequent...read more

Q4. Count with K different characters

You are given a string ‘STR’ of lowercase alphabets and an integer K. Your task is to count all the possible substrings that are not necessarily distinct but should have exactly...read more

Are these interview questions helpful?
Q5. LCA Of Binary Tree

You have been given a Binary Tree of distinct integers and two nodes ‘X’ and ‘Y’. You are supposed to return the LCA (Lowest Common Ancestor) of ‘X’ and ‘Y’.

The LCA of ‘X’ and ‘Y’ in the bina...read more

Q6. Count Set Bits

You are given a positive integer ‘N’. Your task is to find the total number of ‘1’ in the binary representation of all the numbers from 1 to N.

Since the count of ‘1’ can be huge, you are required...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
Q7. Reach the destination

Given a source point (sx, sy) and a destination point (dx, dy), the task is to check if it is possible to reach the destination point using the following valid moves:

(a, b) -> (a + b, b) (...read more
Q8. Ways To Make Coin Change

You are given an infinite supply of coins of each of denominations D = {D0, D1, D2, D3, ...... Dn-1}. You need to figure out the total number of ways W, in which you can make a change fo...read more

Frequently asked in,

Full Stack Developer Jobs

IT SAP Full Stack Developer 6-10 years
SAP India Pvt.Ltd
4.2
Bangalore / Bengaluru
Full Stack Developer - 3-6 years 3-6 years
SAP India Pvt.Ltd
4.2
Bangalore / Bengaluru
Full Stack Developer 2-6 years
IBM India Pvt. Limited
4.1
Noida
Q9. Find a Node in Linked List

You have been given a singly linked list of integers. Write a function that returns the index/position of integer data denoted by 'N' (if it exists). Return -1 otherwise.

Note :
Assume...read more
Q10. Maximum Distance

You have been given an array 'A' of N integers. You need to find the maximum value of j - i subjected to the constraint of A[i] <= A[j], where ‘i’ and ‘j’ are the indices of the array.

For examp...read more
Q11. Add two number as linked lists

You have been given two singly Linked Lists, where each of them represents a positive number without any leading zeros.

Your task is to add these two numbers and print the summatio...read more

Q12. Count Inversions

For a given integer array/list 'ARR' of size 'N', find the total number of 'Inversions' that may exist.

An inversion is defined for a pair of integers in the array/list when the following two co...read more

Q13. Factorial of a Number

You are given an integer ‘N’. You have to print the value of Factorial of ‘N’. The Factorial of a number ‘N’ is defined as the product of all numbers from 1 to ‘N’.

For Example:
Consider if...read more
Q14. Find Indices For Local Minimas and Maximas

Given an array “arr” of “N” integers. Your task is to find and return all the indices of local minima and local maxima in the given array. You need to return the indice...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.

Q15. LRU Cache Implementation

Design and implement a data structure for Least Recently Used (LRU) cache to support the following operations:

1. get(key) - Return the value of the key if the key exists in the cache, o...read more
Frequently asked in,
Q16. Anagram Pairs

Pre-requisites: Anagrams are defined as words or names that can be formed by rearranging letters of another word. Such as "spar" can be formed by rearranging letters of "rasp". Hence, "spar" and "r...read more

Q17. Maximum Consecutive Ones

Given a binary array 'ARR' of size 'N', your task is to find the longest sequence of continuous 1’s that can be formed by replacing at-most 'K' zeroes by ones. Return the length of this ...read more

Q18. Check If One String Is A Rotation Of Another String

You are given two Strings 'P' and 'Q' of equal length. Your task is to check whether String 'P' can be converted into String 'Q' by cyclically rotating it to t...read more

Ans.

The task is to check if one string can be converted into another string by cyclically rotating it to the right any number of times.

  • Check if the lengths of the two strings are equal. If not, return 0.

  • Concatenate the first string with itself and check if the second string is a substring of the concatenated string.

  • If the second string is a substring, return 1. Otherwise, return 0.

Q19. Print array Sum

Given an array of length N, you need to find and print the sum of all elements of the array.

Input Format :
Line 1 : An Integer N i.e. size of array Line 2 : N integers which are elements of the ...read more
Q20. Smallest number whose digits multiplication is ‘N’

You are given a positive integer ‘N’. The task is to find and return the smallest number, ‘M’, such that the multiplication of all the digits in ‘M’ is equal to...read more

Q21. Collect Maximum Coins in Matrix

You are given a matrix of ‘M’ rows and ‘N’ columns. The cells of the matrix contain either a coin or are empty.

You are allowed to visit every boundary cell that has a coin in it ...read more

Q22. Cycle Detection In Undirected Graph

You have been given an undirected graph with 'N' vertices and 'M' edges. The vertices are labelled from 1 to 'N'.

Your task is to find if the graph contains a cycle or not.

A ...read more

Q23. Left View Of a Binary Tree

You have been given a binary tree of integers. You are supposed to find the left view of the binary tree. The left view of a binary tree is the set of all nodes that are visible when t...read more

Q24. Queue Using Stack

Implement a queue data structure which follows FIFO(First In First Out) property, using only the instances of the stack data structure.

Note:
1. To implement means you need to complete some pre...read more
Q25. Buy and Sell Stock

You are Harshad Mehta’s friend. He told you the price of a particular stock for the next ‘N’ days. You can either buy or sell a stock. Also, you can only complete at most 2-transactions. Find ...read more

Frequently asked in,
Q26. Topological Sort

A Directed Acyclic Graph (DAG) is a directed graph that contains no cycles.

Topological Sorting of DAG is a linear ordering of vertices such that for every directed edge from vertex ‘u’ to verte...read more

Q27. Next Greater Element

For a given array/list of integers of size N, print the Next Greater Element(NGE) for every element. The Next Greater Element for an element X is the first element on the right side of X in ...read more

Q28. Optimize Memory Usage

Alex has a computer with ‘K’ memory spaces. He has a list of ‘N’ different document downloads that he would like to do, each of which consumes some unique memory usage. He also has ‘M’ comp...read more

Q29. Merge Sort

Given a sequence of numbers ‘ARR’. Your task is to return a sorted sequence of ‘ARR’ in non-descending order with help of the merge sort algorithm.

Example :

Merge Sort Algorithm - Merge sort is a Div...read more
Q30. Pair Sum

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.

Note:

Each pair shou...read more
Q31. Permutation In String

You are given two strings named str1 and str2 of length N and M respectively. Find whether string str2 contains one of the permutations of string str1 as its substring. In other words, whet...read more

Q32. Word Ladder

You are given two strings BEGIN and END and an array of strings DICT. Your task is to find the length of the shortest transformation sequence from BEGIN to END such that in every transformation you c...read more

Q33. Maximum Subarray Sum

You are given an array/list ARR consisting of N integers. Your task is to find the maximum possible sum of a non-empty subarray(contagious) of this array.

Note: An array C is a subarray of a...read more

Q34. Minimum number of swaps required to sort an array

You have been given an array 'ARR' of 'N' distinct elements.

Your task is to find the minimum no. of swaps required to sort the array.

For example:
For the given...read more
Q35. Validate BST

You have been given a binary tree of integers with N number of nodes. Your task is to check if that input tree is a BST (Binary Search Tree) or not.

A binary search tree (BST) is a binary tree data ...read more

Q36. Count characters

Write a program to count and print the total number of characters (lowercase english alphabets only), digits (0 to 9) and white spaces (single space, tab i.e. '\t' and newline i.e. '\n') entered...read more

Q37. Minimum Jumps

Bob lives with his wife in a city named Berland. Bob is a good husband, so he goes out with his wife every Friday to ‘Arcade’ mall.

‘Arcade’ is a very famous mall in Berland. It has a very unique t...read more

Ans.

This question asks for the minimum number of trampoline jumps a person needs to make in order to reach the last shop in a mall.

  • The shops in the mall are laid out in a straight line and each shop has a constant value representing the maximum distance it can be jumped to.

  • The person starts at shop 0 and wants to reach the last shop, shop N-1.

  • If it is impossible to reach the last shop, the function should return -1.

  • The function should take the number of test cases, the number of ...read more

Q38. Number Of Pairs With Given Sum

You have been given an integer array/list(arr) and a number 'Sum'. Find and return the total number of pairs in the array/list which when added, results equal to the 'Sum'.

Note:
G...read more
Q39. Row with Maximum 1's

You have been given a non-empty grid ‘MAT’ with 'N' rows and 'M' columns consisting of only 0s and 1s. All the rows are sorted in ascending order.

Your task is to find the index of the row t...read more

Q40. Shortest Path in a Binary Matrix

You have been given a binary matrix of size 'N' * 'M' where each element is either 0 or 1. You are also given a source and a destination cell, both of them lie within the matrix....read more

Q41. Maximum Sum Of (i * ARR[i]) Among All Possible Rotations Of An Array

You are given an array 'ARR' consisting of 'N' elements, and you need to find the maximum value of sum(i * ARR[i]) among all possible rotation...read more

Q42. String Palindrome

Given a string, determine if it is a palindrome, considering only alphanumeric characters.

Palindrome
A palindrome is a word, number, phrase, or other sequences of characters which read the sam...read more
Q43. Circular Move

You have a robot currently standing at the origin (0, 0) of a two-dimensional grid and facing north direction. You are given a sequence of moves for the robot in the form of a string of size 'N'. Y...read more

Q44. The Skyline Problem

You are given 'N' rectangular buildings in a 2-dimensional city. Your task is to compute the skyline of these buildings, eliminating hidden lines return the skyline formed by these buildings ...read more

Q45. Tiling Problem

You have been given a board where there are '2' rows and 'N' columns. You have an infinite supply of 2x1 tiles, and you can place a tile in the following ways:

1. Horizontally as 1x2 tile 2. Verti...read more
Q46. Middle Of Linked List

Given the head node of the singly linked list, return a pointer pointing to the middle of the linked list.

If there are an odd number of elements, return the middle element if there are eve...read more

Q47. Build Heap

You are given an integer array with N elements. Your task is to build a max binary heap from the array.

A max-heap is a complete binary tree in which the value of each internal node is greater than or...read more

Q48. Delete Node In BST

You have been given a Binary Search Tree of integers with ‘N’ nodes. You are also given data of a node of this tree. Your task is to delete the given node from the BST.

A binary search tree (B...read more

Q49. Minimum time

There are ‘N’ junctions connected by ‘M’ bi-directional roads. At most, one road is present between any pair of junctions. There is no road connecting a junction to itself. The travel time for a roa...read more

Q50. Alien dictionary

You have been given a sorted (lexical order) dictionary of an alien language. Write a function that finds the order of characters in the alien language. This dictionary will be given to you in t...read more

1
2
3
4
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10k Interviews
3.9
 • 7.8k Interviews
3.8
 • 5.4k Interviews
3.8
 • 4.7k Interviews
3.6
 • 2.3k Interviews
4.1
 • 2.3k Interviews
3.3
 • 737 Interviews
4.0
 • 248 Interviews
4.0
 • 41 Interviews
View all

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
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter