Full Stack Developer

100+ Full Stack Developer Interview Questions and Answers for Freshers

Updated 9 Feb 2025
search-icon

Q1. 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

Q2. 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.

Q3. 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

Q4. 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.

Are these interview questions helpful?

Q5. 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.

Q6. 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.

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. 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

Q8. 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.

Full Stack Developer Jobs

Full Stack Developer - Cloud 6-8 years
SAP Labs India Pvt. Ltd.
4.2
Bangalore / Bengaluru
Full Stack Developer: Java, React/Angular/Node 4-7 years
SAP India Pvt.Ltd
4.2
Bangalore / Bengaluru
Fullstack Developer 5-8 years
Schneider Electric
4.1
Bangalore / Bengaluru

Q9. 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.

Q10. 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.

Q11. ...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.

Q12. Rotational Equivalence of Strings Problem Statement

Given two strings 'P' and 'Q' of equal length, determine if string 'P' can be transformed into string 'Q' by cyclically rotating it to the right any number of...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.

Q13. 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.

Q14. 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

Q15. LRU Cache Design Question

Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:

1. get(key) - Return the value of the key if it exists in the cache; otherwise, re...read more

Ans.

Design a Least Recently Used (LRU) cache data structure that supports get and put operations with a given capacity.

  • Implement a doubly linked list to keep track of the order of keys based on their recent usage.

  • Use a hashmap to store key-value pairs for quick access and updates.

  • When capacity is reached, evict the least recently used item before inserting a new item.

  • Update the position of a key in the linked list whenever it is accessed or updated.

Frequently asked in,

Q16. Ways To Make Coin Change

Given an infinite supply of coins of varying denominations, determine the total number of ways to make change for a specified value using these coins. If it's not possible to make the c...read more

Ans.

The task is to find the total number of ways to make change for a specified value using given denominations.

  • Use dynamic programming to solve this problem efficiently.

  • Create a 2D array to store the number of ways to make change for each value up to the specified value.

  • Iterate through the denominations and update the array based on the current denomination.

  • Return the value at the last cell of the array as the final result.

Frequently asked in,

Q17. Maximum Consecutive Ones Problem Statement

Given a binary array 'ARR' of size 'N', your task is to determine the maximum length of a sequence consisting solely of 1’s that can be obtained by converting at most ...read more

Ans.

Find the maximum length of a sequence of 1's by converting at most K zeroes into ones in a binary array.

  • Iterate through the array and keep track of the current window of 1's and zeroes.

  • Use a sliding window approach to find the maximum length of the sequence.

  • Update the window by flipping zeroes to ones within the limit of K flips.

  • Return the maximum length of the sequence obtained.

Q18. Minimum Jumps Problem Statement

Bob and his wife are in the famous 'Arcade' mall in the city of Berland. This mall has a unique way of moving between shops using trampolines. Each shop is laid out in a straight...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

Q19. Topological Sort Problem Statement

Given a Directed Acyclic Graph (DAG) consisting of V vertices and E edges, your task is to find any topological sorting of this DAG. You need to return an array of size V repr...read more

Ans.

Topological sort of a Directed Acyclic Graph (DAG) is finding an ordering of vertices where for every directed edge u -> v, u comes before v.

  • Use Depth First Search (DFS) to find the topological ordering of vertices in a DAG.

  • Start by visiting a vertex and recursively visit its neighbors, adding the vertex to the result after visiting all neighbors.

  • Maintain a visited array to keep track of visited vertices and a stack to store the topological ordering.

  • Once all vertices are visi...read more

Q20. Anagram Pairs Verification Problem

Your task is to determine if two given strings are anagrams of each other. Two strings are considered anagrams if you can rearrange the letters of one string to form the other...read more

Ans.

Determine if two strings are anagrams of each other by checking if they contain the same characters.

  • Create character frequency maps for both strings

  • Compare the frequency of characters in both maps to check if they are anagrams

  • Return True if the strings are anagrams, False otherwise

Q21. Next Greater Element Problem Statement

Given a list of integers of size N, your task is to determine the Next Greater Element (NGE) for every element. The Next Greater Element for an element X is the first elem...read more

Ans.

The task is to find the Next Greater Element for each element in a list of integers.

  • Iterate through the list of integers from right to left.

  • Use a stack to keep track of elements whose NGE is yet to be found.

  • Pop elements from the stack until a greater element is found or the stack is empty.

  • Assign the NGE as the top element of the stack or -1 if the stack is empty.

Q22. Optimize Memory Usage Problem Statement

Alex wants to maximize the use of 'K' memory spaces on his computer. He has 'N' different document downloads, each with unique memory usage, and 'M' computer games, each ...read more

Ans.

Maximize memory usage by pairing downloads and games within memory limit 'K'.

  • Sort the downloads and games in descending order.

  • Iterate through the downloads and games to find the pairs within memory limit 'K'.

  • Return the pairs that maximize memory usage.

Q23. Merge Sort Problem Statement

You are given a sequence of numbers, ARR. Your task is to return a sorted sequence of ARR in non-descending order using the Merge Sort algorithm.

Explanation:

The Merge Sort algorit...read more

Ans.

Implement Merge Sort algorithm to sort a sequence of numbers in non-descending order.

  • Understand the Merge Sort algorithm which involves dividing the array into two halves, sorting each half, and then merging them back together.

  • Recursively apply the Merge Sort algorithm until the size of each array is 1.

  • Merge the sorted halves to produce the final sorted array.

  • Ensure to handle the input constraints such as the number of test cases, elements in the array, and the range of eleme...read more

Q24. Cycle Detection in Undirected Graph Problem Statement

You are provided with an undirected graph containing 'N' vertices and 'M' edges. The vertices are numbered from 1 to 'N'. Your objective is to determine whe...read more

Ans.

Detect if an undirected graph contains a cycle by exploring all possible paths.

  • Use Depth First Search (DFS) to traverse the graph and detect cycles.

  • Maintain a visited set to keep track of visited vertices and a parent pointer to avoid revisiting the same vertex.

  • If a visited vertex is encountered that is not the parent of the current vertex, a cycle is present.

  • Check for cycles in each connected component of the graph.

  • Example: For input N=3, Edges=[[1, 2], [2, 3], [1, 3]], the ...read more

Q25. Queue Using Stacks Implementation

Design a queue data structure following the FIFO (First In First Out) principle using only stack instances.

Explanation:

Your task is to complete predefined functions to suppor...read more

Ans.

Implement a queue using stacks following FIFO principle.

  • Use two stacks to simulate a queue - one for enqueue and one for dequeue operations.

  • For enQueue operation, push elements onto the enqueue stack.

  • For deQueue operation, if the dequeue stack is empty, pop all elements from enqueue stack to dequeue stack.

  • For peek operation, return the top element of the dequeue stack.

  • For isEmpty operation, check if both stacks are empty.

  • Example: enQueue(5), enQueue(10), peek() -> 5, deQueue(...read more

Q26. Shortest Path in a Binary Matrix Problem Statement

Given a binary matrix of size N * M where each element is either 0 or 1, find the shortest path from a source cell to a destination cell, consisting only of 1s...read more

Ans.

Find the shortest path in a binary matrix from a source cell to a destination cell consisting only of 1s.

  • Use Breadth First Search (BFS) algorithm to find the shortest path.

  • Keep track of visited cells to avoid revisiting them.

  • Calculate the path length by counting the number of 1s in the path.

  • Handle edge cases such as invalid inputs and unreachable destination.

Q27. Factorial of a Number Problem Statement

You are provided with an integer 'N'. Your task is to calculate and print the factorial of 'N'. The factorial of a number 'N', denoted as N!, is the product of all positi...read more

Ans.

Calculate and print the factorial of a given integer 'N'.

  • Iterate from 1 to N and multiply each number to calculate factorial

  • Handle edge cases like N=0 or N=1 separately

  • Use recursion to calculate factorial efficiently

Q28. Maximum Sum of Products for Array Rotations

You are given an array ARR consisting of N elements. Your task is to determine the maximum value of the summation of i * ARR[i] among all possible rotations of ARR. R...read more

Ans.

Find the maximum sum of products for array rotations.

  • Iterate through all possible rotations of the array and calculate the sum of products for each rotation.

  • Keep track of the maximum sum of products found so far.

  • Return the maximum sum of products obtained.

Q29. Word Ladder Problem Statement

Given two strings, BEGIN and END, along with an array of strings DICT, determine the length of the shortest transformation sequence from BEGIN to END. Each transformation involves ...read more

Ans.

The Word Ladder problem involves finding the shortest transformation sequence from one word to another by changing one letter at a time.

  • Use breadth-first search to find the shortest transformation sequence.

  • Create a graph where each word is a node and words that can be transformed into each other are connected.

  • Keep track of visited words to avoid cycles and optimize the search process.

  • Return -1 if no transformation sequence is possible.

  • Example: For input 'hit', 'cog', and dict...read more

Q30. Build Max Heap Problem Statement

Given an integer array with N elements, the task is to transform this array into a max binary heap structure.

Explanation:

A max-heap is a complete binary tree where each intern...read more

Ans.

The task is to transform an integer array into a max binary heap structure.

  • Create a max heap from the given array by rearranging elements

  • Ensure each internal node has a value greater than or equal to its children

  • Check if the transformed array represents a max-heap and output 1 if true, 0 if false

Q31. Character Counting Challenge

Create a program that counts and prints the total number of specific character types from user input. Specifically, you need to count lowercase English alphabets, numeric digits (0-...read more

Ans.

Create a program that counts lowercase alphabets, digits, and white spaces from user input until '$' is encountered.

  • Read characters from input stream until '$' is encountered

  • Count lowercase alphabets, digits, and white spaces separately

  • Print the counts of each character type as three integers separated by spaces

Q32. Maximum Subarray Sum Problem Statement

Given an array ARR consisting of N integers, your goal is to determine the maximum possible sum of a non-empty contiguous subarray within this array.

Example of Subarrays:...read more

Ans.

Find the maximum sum of a contiguous subarray within an array of integers.

  • Iterate through the array and keep track of the maximum sum of subarrays seen so far.

  • Use Kadane's algorithm to efficiently find the maximum subarray sum.

  • Consider edge cases like all negative numbers in the array.

  • Example: For input [-2, 1, -3, 4, -1], the maximum subarray sum is 4.

Q33. Minimum Number of Swaps to Sort an Array

Find the minimum number of swaps required to sort a given array of distinct elements in ascending order.

Input:

T (number of test cases)
For each test case:
N (size of the...read more
Ans.

The minimum number of swaps required to sort a given array of distinct elements in ascending order.

  • Use a hashmap to store the original indices of the elements in the array.

  • Iterate through the array and swap elements to their correct positions.

  • Count the number of swaps needed to sort the array.

Q34. Buy and Sell Stock Problem Statement

Imagine you are Harshad Mehta's friend, and you have been given the stock prices of a particular company for the next 'N' days. You can perform up to two buy-and-sell transa...read more

Ans.

The task is to determine the maximum profit that can be achieved by performing up to two buy-and-sell transactions on a given set of stock prices.

  • Iterate through the array of stock prices to find the maximum profit that can be achieved by buying and selling stocks at different points.

  • Keep track of the maximum profit that can be achieved by considering all possible combinations of buy and sell transactions.

  • Ensure that you sell the stock before buying again to adhere to the con...read more

Frequently asked in,

Q35. Count Pairs with Given Sum

Given an integer array/list arr and an integer 'Sum', determine the total number of unique pairs in the array whose elements sum up to the given 'Sum'.

Input:

The first line contains ...read more
Ans.

Count the total number of unique pairs in an array whose elements sum up to a given value.

  • Use a hashmap to store the frequency of each element in the array.

  • Iterate through the array and for each element, check if (Sum - current element) exists in the hashmap.

  • Increment the count of pairs if the complement exists in the hashmap.

  • Divide the count by 2 to avoid counting duplicates like (arr[i], arr[j]) and (arr[j], arr[i]) separately.

Q36. Find the Row with the Maximum Number of 1's

You are given a non-empty grid MAT with 'N' rows and 'M' columns, where each element is either 0 or 1. All rows are sorted in ascending order.

Your task is to determi...read more

Ans.

Find the row with the maximum number of 1's in a grid of 0's and 1's, returning the index of the row with the most 1's.

  • Iterate through each row of the grid and count the number of 1's in each row

  • Keep track of the row index with the maximum number of 1's seen so far

  • Return the index of the row with the maximum number of 1's

Q37. Longest Duplicate Substring Problem Statement

You are provided with a string 'S'. The task is to determine the length of the longest duplicate substring within this string. Note that duplicate substrings can ov...read more

Ans.

Find the length of the longest duplicate substring in a given string.

  • Iterate through all possible substrings of the input string.

  • Use a rolling hash function to efficiently compare substrings.

  • Store the lengths of duplicate substrings and return the maximum length.

Q38. Smallest Number with Given Digit Product

Given a positive integer 'N', find and return the smallest number 'M', such that the product of all the digits in 'M' is equal to 'N'. If such an 'M' is not possible or ...read more

Ans.

Find the smallest number whose digits multiply to a given number N.

  • Iterate through possible digits to form the smallest number with product equal to N

  • Use a priority queue to keep track of the smallest possible number

  • Check constraints to ensure the number fits in a 32-bit signed integer

Q39. The Skyline Problem

Compute the skyline of given rectangular buildings in a 2D city, eliminating hidden lines and forming the outer contour of the silhouette when viewed from a distance. Each building is descri...read more

Ans.

Compute the skyline of given rectangular buildings in a 2D city, eliminating hidden lines and forming the outer contour of the silhouette.

  • Iterate through the buildings to find the critical points (start and end) of each building.

  • Sort the critical points based on x-coordinate and process them to find the skyline.

  • Merge consecutive horizontal segments of equal height in the output to ensure no duplicates.

Q40. Validate Binary Search Tree (BST)

You are given a binary tree with 'N' integer nodes. Your task is to determine whether this binary tree is a Binary Search Tree (BST).

BST Definition:

A Binary Search Tree (BST)...read more

Ans.

Validate if a given binary tree is a Binary Search Tree (BST) or not.

  • Check if the left subtree of a node contains only nodes with data less than the node's data.

  • Check if the right subtree of a node contains only nodes with data greater than the node's data.

  • Ensure that both the left and right subtrees are also binary search trees.

  • Traverse the tree in an inorder manner and check if the elements are in sorted order.

  • Recursively check each node's value against the range of values ...read more

Q41. Middle of a Linked List

You are given the head node of a singly linked list. Your task is to return a pointer pointing to the middle of the linked list.

If there is an odd number of elements, return the middle ...read more

Ans.

Return the middle element of a singly linked list, or the one farther from the head if there are even elements.

  • Traverse the linked list with two pointers, one moving twice as fast as the other

  • When the fast pointer reaches the end, the slow pointer will be at the middle

  • If there are even elements, return the one pointed by the slow pointer

Q42. Sort Array of Strings Problem Statement

Given an array of strings ARRSTR[] of size N, and a character C, your task is to sort the ARRSTR[] array according to a new alphabetical order that starts with the given ...read more

Ans.

Sort an array of strings based on a new alphabetical order starting with a given character.

  • Iterate through the array of strings and compare each string based on the new alphabetical order starting with the given character.

  • Use a custom comparator function to sort the strings according to the new alphabetical order.

  • Return the sorted array of strings.

Q43. Delete Node in Binary Search Tree Problem Statement

You are provided with a Binary Search Tree (BST) containing 'N' nodes with integer data. Your task is to remove a given node from this BST.

A BST is a binary ...read more

Ans.

Implement a function to delete a node from a Binary Search Tree and return the inorder traversal of the modified BST.

  • Understand the properties of a Binary Search Tree (BST) - left subtree contains nodes with data less than the node, right subtree contains nodes with data greater than the node.

  • Implement a function to delete the given node from the BST while maintaining the BST properties.

  • Perform inorder traversal of the modified BST to get the desired output.

  • Handle cases where...read more

Q44. Minimum Time Problem Statement

In a city with ‘N’ junctions and ‘M’ bi-directional roads, each junction is connected to other junctions with specified travel times. No road connects a junction to itself, and on...read more

Ans.

The problem involves finding the minimum time to travel from a source junction to a destination junction in a city with specified travel times and green light periods.

  • Input consists of the number of test cases, number of junctions and roads, green light periods, road connections with travel times, and source/destination junctions.

  • Output should be the minimum time needed from source to destination, or -1 if destination is unreachable.

  • Constraints include limits on test cases, j...read more

Q45. Pair Sum Problem Statement

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

Note:

Each pa...read more

Ans.

Given an array of integers and a target sum, find all pairs of elements that add up to the target sum.

  • Use a hashmap to store the difference between the target sum and each element as keys and their indices as values.

  • Iterate through the array and check if the current element's complement exists in the hashmap.

  • Return the pairs of elements that add up to the target sum in sorted order.

Q46. 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
Ans.

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.

Q47. 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

Ans.

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.

Q48. 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

Ans.

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.

Q49. 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

Ans.

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.

Frequently asked in,
Q50. Can you describe the use case of Account Statements Transcription as a full stack application, which involves converting an uploaded Excel sheet document into an SQL table, fetching data as per user needs in th...read more
Ans.

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

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

Interview experiences of popular companies

3.7
 • 10.4k Interviews
3.8
 • 8.1k Interviews
3.7
 • 5.6k Interviews
3.8
 • 5.6k Interviews
3.7
 • 4.7k Interviews
3.5
 • 3.8k Interviews
4.0
 • 2.3k Interviews
3.9
 • 261 Interviews
4.0
 • 42 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

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