Add office photos
Engaged Employer

Paytm

3.3
based on 7k Reviews
Filter interviews by

400+ Interview Questions and Answers

Updated 19 Nov 2024
Popular Designations

Q1. Puzzle : 100 people are standing in a circle .each one is allowed to shoot a person infront of him and he hands the gun to the next to next person for e.g 1st person kills 2nd and hands gun to 3rd .This continu...

read more
Ans.

A puzzle where 100 people shoot the person in front of them until only one person remains.

  • Each person shoots the person in front of them and hands the gun to the next to next person.

  • This continues until only one person remains.

  • The last person standing is the one who was not shot by anyone.

View 17 more answers
Q2. Binary strings with no consecutive 1s.

You have been given an integer K.

Your task is to generate all binary strings of length K such that there are no consecutive 1s in the string. This means that the binary st...read more

View 2 more answers
Q3. Reverse Linked List

Given a singly linked list of integers. Your task is to return the head of the reversed linked list.

For example:
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked lis...read more
View 6 more answers
Q4. Longest Consecutive Sequence

You are given an unsorted array/list 'ARR' of 'N' integers. Your task is to return the length of the longest consecutive sequence.

The consecutive sequence is in the form ['NUM', 'NU...read more

View 5 more answers
Discover null interview dos and don'ts from real experiences
Q5. Design a stack that supports getMin() in O(1) time and O(1) extra space

Implement a SpecialStack Data Structure that supports getMin() in O(1) time and O(1) extra space along with push(), pop(), top(), isEmpty(...read more

View 4 more answers
Q6. Find Minimum Number Of Coins

Dora, the explorer, visits India and decides to try the famous Indian food. However, the restaurant accepts only Indian currency i.e. [1, 2, 5, 10, 20, 50, 100, 500, 1000] valued coi...read more

View 3 more answers
Are these interview questions helpful?
Q7. Is SubSequence

You have been given two strings ‘STR1’ and ‘STR2’.

Your task is to find if ‘STR1’ is a subsequence of ‘STR2’.

A subsequence of a string is a new string that can be derived from the original string...read more

View 4 more answers
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

View 5 more answers
Share interview questions and help millions of jobseekers 🌟
Q9. Kth Smallest Element

You are given an array of integers 'ARR' of size 'N' and another integer 'K'. Your task is to find and return 'K'th smallest value present in the array.

Note: All the elements in the array a...read more

View 4 more answers
Q10. Permutations

A permutation is a mathematical technique that determines the number of possible arrangements in a set when the order of the arrangements matters. A string of length 'N' has 'N'! permutations.

Given...read more

View 4 more answers
Q11. String Transformation

Given a string (STR) of length N, you have to create a new string by performing the following operation:

Take the smallest character from the first 'K' characters of STR, remove it from STR...read more

View 3 more answers
Q12. Number of GP sequence

You are given an array containing ‘N’ integers. You need to find the number of subsequences of length 3 which are in Geometric progression with common ratio ‘R’.

A geometric progression (G...read more

View 3 more answers
Q13. 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

View 3 more answers
Q14. Partition a set into two subsets such that the difference of subset sums is minimum.

You are given an array containing N non-negative integers. Your task is to partition this array into two subsets such that th...read more

View 3 more answers
Q15. Search In Rotated Sorted Array

Aahad and Harshit always have fun by solving problems. Harshit took a sorted array consisting of distinct integers and rotated it clockwise by an unknown amount. For example, he to...read more

View 3 more answers
Q16. Sum Of Squares Of First N Natural Numbers

You are given an integer 'N'. You need to find the sum of squares of the first 'N' natural numbers.

For example:
If 'N' = 4. You need to return 1^2 + 2^2 + 3^2 + 4^2 = 3...read more
Ans.

The task is to find the sum of squares of the first 'N' natural numbers.

  • Iterate from 1 to N and calculate the square of each number

  • Add all the squares together to get the final sum

  • Return the sum as the result

View 3 more answers
Q17. Maximum Subarray Sum

Given an array of numbers, find the maximum sum of any contiguous subarray of the array.

For example, given the array [34, -50, 42, 14, -5, 86], the maximum sum would be 137, since we would ...read more

View 4 more answers
Q18. Detect and Remove Loop

Given a singly linked list, you have to detect the loop and remove the loop from the linked list, if present. You have to make changes in the given linked list itself and return the update...read more

View 4 more answers
Q19. Sort an array in wave form

You have been given an unsorted array ‘ARR’.

Your task is to sort the array in such a way that the array looks like a wave array.

Example:
If the given sequence ‘ARR’ has ‘N’ elements ...read more
View 3 more answers
Q20. Print all the nodes at distance from the target node

Given a binary tree, a target node in the binary tree, and an integer ‘K’. You need to find all the nodes that are at a distance ‘K’ from the given target nod...read more

View 2 more answers
Q21. Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

1. Push(num): Push the given number in the stack. 2. Pop: Remove and return the top element from the st...read more
View 2 more answers
Q22. Rotting Oranges

You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:

  • Value 0 - representing an empty cell.
  • Value 1 - representing a fresh orange.
  • ...read more
  • View 2 more answers
    Q23. Minimum falling path sum

    You have been given a square array 'VEC' of integers of size 'N' rows and 'N' columns. Your task is to find the minimum sum of a falling path through the square array. The number of rows...read more

    View 2 more answers
    Q24. Group Anagrams

    You have been given an array/list of strings 'inputStr'. You are supposed to return the strings as groups of anagrams such that strings belonging to a particular group are anagrams of one another....read more

    View 2 more answers
    Q25. Segregate Even And Odd Nodes In a Linked List

    You are given the head node of a singly linked list ‘head’. Your task is to modify the linked list in such a way that all the even valued nodes appear before the all...read more

    Add your answer
    Q26. Delete a Node from Linked List

    You have been given a linked list of integers. Your task is to write a function that deletes a node from a given position, 'POS'.

    Note :
    Assume that the Indexing for the linked lis...read more
    View 3 more answers
    Q27. Generate subsets of string

    Given an array arr of N integers that may contain duplicate integers. The task is to return the count of subsets of the given array such that each subset contains only distinct element...read more

    View 2 more answers
    Q28. Reverse a linked list
    Input Format :
    The first line of input contains a single integer T, ...read more
    View 2 more answers
    Q29. NINJA TECHNIQUE

    Ninja has its own technique of making a decision to do something or not. This technique is known as the ninja technique. In this technique, Ninja generates a random string containing only digits,...read more

    Add your answer
    Q30. Reverse Alternate K nodes

    You are given a Singly Linked List of integers and a positive integer 'K'. Modify the linked list by reversing every alternate 'K' nodes of the linked list.

    A singly linked list is a ty...read more
    View 3 more answers
    Q31. Quick Sort

    You are given an array of integers. You need to sort the array in ascending order using quick sort.

    Quick sort is a divide and conquer algorithm in which we choose a pivot point and partition the arr...read more

    View 4 more answers
    Q32. Clone Linked List with Random Pointer

    Given a linked list having two pointers in each node. The first one points to the next node of the list, however, the other pointer is random and can point to any node of th...read more

    View 4 more answers
    Q33. Replace 0s

    Given a matrix where every element is either 1 or 0(zero), replace 0 with 1 if surrounded by 1. A 0 (or a set of 0s) is considered to be surrounded by 1 if there are 1 at locations just below, just ab...read more

    View 2 more answers
    Q34. Number In AP

    You’re given three integers X, C, and Y, where X denotes the first term of an arithmetic sequence whose common difference is C. Your task is to determine whether Y belongs to this arithmetic sequenc...read more

    Add your answer
    Q35. Distributing Coins

    You are given the ‘ROOT’ of a binary tree with ‘N’ nodes where each node in the tree has some coins, and there are ‘N’ coins total. In one move, we may choose two adjacent nodes and move one c...read more

    Add your answer
    Q36. Decode String

    You have been given an encoded string. Your task is to decode it back to the original string.

    - An encoded string will be of the form [encoded_string], where the 'encoded_string' inside the square ...read more
    Add your answer
    Q37. Minimum insertions to make a string palindrome

    A palindrome string is one that reads the same backward as well as forward. Given a string 'STR', you need to tell the minimum number of characters needed to insert...read more

    View 4 more answers
    Q38. zig zag traversal

    You have been given a Binary Tree of 'N' nodes, where the nodes have integer values. Your task is to print the zigzag traversal of the given tree.

    Note:
    In zigzag order, level 1 is printed from...read more
    View 5 more answers
    Q39. Spiral Order Traversal of a Binary Tree

    You have been given a binary tree of 'N' nodes. Print the Spiral Order traversal of this binary tree.

    For example
    For the given binary tree [1, 2, 3, -1, -1, 4, 5, -1, -1,...read more
    View 3 more answers
    Q40. Sort An Array of 0s, 1s and 2s

    You have been given an array/list ARR consisting of ‘N’ elements. Each element in the array is either 0, 1 or 2.

    Now, your task is to sort this array/list in increasing order. For ...read more

    Ans.

    The task is to sort an array of 0s, 1s, and 2s in increasing order.

    • Use a three-pointer approach to partition the array into three sections: 0s, 1s, and 2s.

    • Initialize three pointers: low, mid, and high. low points to the start of the array, mid points to the current element being processed, and high points to the end of the array.

    • While mid <= high, if ARR[mid] is 0, swap ARR[low] and ARR[mid], increment low and mid. If ARR[mid] is 1, increment mid. If ARR[mid] is 2, swap ARR[m...read more

    View 4 more answers
    Q41. Sub Sort

    You are given an integer array ‘ARR’. You have to find the length of the shortest contiguous subarray such that, if you sort this subarray in ascending order, then the whole array will be sorted in asce...read more

    View 4 more answers
    Q42. Longest Common Subsequence

    You have been given two Strings “STR1” and “STR2” of characters. Your task is to find the length of the longest common subsequence.

    A String ‘a’ is a subsequence of a String ‘b’ if ‘a’...read more

    View 4 more answers
    Q43. Minimum Fountains

    There is a one-dimensional garden of length 'N'. On each of the positions from 0 to 'N', there is a fountain, and this fountain’s water can reach up to a certain range as explained further. In ...read more

    View 2 more answers
    Q44. 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

    Ans.

    The task is to find the maximum possible sum of a non-empty subarray of an array.

    • Iterate through the array and keep track of the maximum sum encountered so far

    • If the current element is greater than the sum so far, start a new subarray

    • If the current element plus the sum so far is greater than the maximum sum, update the maximum sum

    • Return the maximum sum

    View 4 more answers
    Q45. Coding Problem

    We were given a number system where 0 was mapped to 9, 1 to 8, 2 to 7, 3 to 6 and so on.We were given an positive integer as an input and we had to convert it into an integer in the new number sys...read more

    Add your answer
    Q46. Delete Node In A Linked List

    You are given a Singly Linked List of integers and a reference to the node to be deleted. Every node of the Linked List has a unique value written on it. Your task is to delete that ...read more

    View 2 more answers
    Q47. Group Anagrams Together

    You have been given an array/list of strings 'STR_LIST'. You are supposed to return the strings as groups of anagrams such that strings belonging to a particular group are anagrams of one...read more

    View 3 more answers
    Q48. Inorder Sucessor

    You have been given an arbitrary binary tree and a node of this tree. You need to find the inorder successor of this node in the tree.

    The inorder successor of a node in a binary tree is that no...read more

    View 4 more answers
    Q49. Maze obstacles

    Given a ‘N’ * ’M’ maze with obstacles, count and return the number of paths to reach the right-bottom cell from the top-left cell. A cell in the given maze has a value -1 if it is a blockage or de...read more

    View 3 more answers
    Q50. 0-1 knapsack.

    A thief is robbing a store and can carry a maximal weight of W into his knapsack. There are N items and the ith item weighs wi and is of value vi. Considering the constraints of the maximum weight ...read more

    Add your answer
    Q51. Parth And His OCD

    Parth is a nerd programmer. He has started learning array/list programming. Parth has received an array/list ‘ARR’ of ‘N’ positive integers as a gift. Parth’s OCD gets triggered every time he s...read more

    View 4 more answers
    Q52. Connect N Ropes With Minimum Cost

    You have been given 'N' ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. We need to con...read more

    Ans.

    The task is to connect N ropes into one rope with minimum cost.

    • Sort the array of rope lengths in ascending order.

    • Initialize a variable to keep track of the total cost.

    • While there are more than one rope, take the two shortest ropes and connect them.

    • Add the cost of connecting the two ropes to the total cost.

    • Replace the two shortest ropes with the connected rope.

    • Repeat the above steps until only one rope remains.

    • Return the total cost.

    View 3 more answers
    Q53. Delete middle node

    You have been given a singly Linked List of integers. Your task is to delete the middle node of this List.

    Note:

    1. If there is no middle node in the list to delete, return an empty list (i.e...read more
    View 2 more answers
    Q54. Add two 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 summation in the ...read more

    View 3 more answers
    Q55. 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 Di...read more
    View 3 more answers
    Q56. Sort 0 1 2

    You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.

    Note :
    Try to solve the problem in 'Single Scan'. ' Single Scan' r...read more
    View 3 more answers
    Q57. Cube Sum Pairs

    You are given a positive integer N, and you have to find the number of ways to represent N as a sum of cubes of two integers(let’s say A and B), such that:

    N = A^3 + B^3. 

    Note:

    1. A should be gre...read more
    View 3 more answers
    Q58. Two Sum

    You are 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 Target.

    Note:

    We cannot use the element at a given ind...read more
    View 2 more answers
    Q59. BST Iterator

    You are given a class named as BSTIterator that represents an iterator over inorder traversal of a binary search tree. You need to implement the following things as follows:

    1. BSTIterator(Node root...read more
    View 2 more answers
    Q60. Job Sequencing Problem

    You are given a N x 2 2-D array 'Jobs' of 'N' jobs where Jobs[i][0] denote the deadline of i-th job and Jobs[i][1] denotes the profit associated with i-th job.

    You will make a certain prof...read more

    View 2 more answers
    Q61. Closest Leaf To Given Node In Binary Tree

    Ninja is stuck in a maze which is in a form of a binary tree. He needs your help in order to get out.

    Ninja is presently at the node ‘X’. The only exit points of the maz...read more

    View 3 more answers
    Q62. Find Smallest Integer

    You are given an array 'ARR' consisting of 'N' positive numbers and sorted in non-decreasing order, and your task is to find the smallest positive integer value that cannot be represented a...read more

    Ans.

    The task is to find the smallest positive integer value that cannot be represented as a sum of elements of any proper subset of the given array.

    • The array is sorted in non-decreasing order, so we can iterate through the array and keep track of the maximum sum we can form.

    • If the current element is greater than the maximum sum + 1, then the maximum sum + 1 is the smallest positive integer that cannot be represented.

    • If all elements in the array can be represented as a sum of subs...read more

    View 2 more answers
    Q63. LCA In A BST

    You are given a binary search tree of integers with N nodes. You are also given references to two nodes P and Q from this BST.

    Your task is to find the lowest common ancestor(LCA) of these two given...read more

    View 3 more answers
    Q64. Minimum Characters For Palindrome

    Given a string STR of length N. The task is to return the count of minimum characters to be added at front to make the string a palindrome.

    For example, for the given string “de...read more

    View 2 more answers

    Q65. How will you implement a shuffle function for a playlist of songs

    Ans.

    Implementing a shuffle function for a playlist of songs

    • Create a new empty playlist

    • Randomly select a song from the original playlist and add it to the new playlist

    • Remove the selected song from the original playlist

    • Repeat until all songs have been added to the new playlist

    • Return the new shuffled playlist

    Add your answer
    Q66. Minimum number of platforms required

    You have been given two arrays, 'AT' and 'DT', representing the arrival and departure times of all trains that reach a railway station.

    Your task is to find the minimum numbe...read more

    Ans.

    This question asks to find the minimum number of platforms required at a railway station so that no train needs to wait.

    • Sort the arrival and departure times arrays in ascending order.

    • Initialize a variable 'platforms' to 1 and 'maxPlatforms' to 1.

    • Iterate through the arrival and departure times arrays simultaneously.

    • If the current arrival time is less than or equal to the current departure time, increment 'platforms'.

    • If 'platforms' is greater than 'maxPlatforms', update 'maxPla...read more

    View 4 more answers
    Q67. Running median

    You are given a stream of 'N' integers. For every 'i-th' integer added to the running list of integers, print the resulting median.

    Input Format :
    The fi...read more
    View 3 more answers
    Q68. Ceil from BST

    Ninja is given a binary search tree and an integer. Now he is given a particular key in the tree and returns its ceil value. Can you help Ninja solve the problem?

    Note:
    Ceil of an integer is the cl...read more
    Add your answer
    Q69. Diameter Of Binary Tree

    You are given a Binary Tree. You are supposed to return the length of the diameter of the tree.

    The diameter of a binary tree is the length of the longest path between any two end nodes i...read more

    Ans.

    The diameter of a binary tree is the length of the longest path between any two end nodes in the tree.

    • The diameter of a binary tree can be calculated by finding the maximum of the following three values: 1) the diameter of the left subtree, 2) the diameter of the right subtree, and 3) the longest path that passes through the root node.

    • To find the diameter of a binary tree, we can use a recursive approach where we calculate the height of each node and update the diameter at ea...read more

    View 3 more answers
    Q70. Bottom Right View of Binary Tree

    Given a binary tree. Your task is to print the bottom right view of the binary tree.

    Bottom right view, on viewing the given binary tree at the angle of 45 degrees from the botto...read more

    Add your answer
    Q71. Subtree of Another Tree

    Given two binary trees T and S, check whether tree S has exactly the same structure and node values with a subtree of T, i.e., check if tree S is a subtree of the tree T.

    A subtree of a t...read more

    View 3 more answers
    Q72. Count Ways To Reach The N-th Stairs

    You have been given a number of stairs. Initially, you are at the 0th stair, and you need to reach the Nth stair. Each time you can either climb one step or two steps. You are...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

    View 4 more answers
    Q73. Rotate matrix by 90 degrees

    You are given a square matrix of non-negative integers 'MATRIX'. Your task is to rotate that array by 90 degrees in an anti-clockwise direction using constant extra space.

    For example...read more

    View 2 more answers
    Q74. Minimize Cash Flow

    You are given a list of ‘transactions’ between ‘n’ number of friends. who have to give each other money. The list consists of data of receiver, sender, and transaction.

    Your task is to minimiz...read more

    Add your answer
    Q75. Floor Value of X

    You are given a sorted array ‘A’ and an integer ‘X’. Your task is to find and return the floor value of ‘X’ in the array.

    The floor value of ‘X’ in array ‘A’ is the largest element in the array ...read more

    View 2 more answers
    Q76. Container with most water

    Given a sequence of ‘N’ space-separated non-negative integers A[1],A[2],A[3],......A[i]…...A[n]. Where each number of the sequence represents the height of the line drawn at point 'i'. ...read more

    View 2 more answers
    Q77. 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

    View 4 more answers
    Q78. Integer to Roman Numeral

    Given an integer ‘N’, the task is to find its corresponding Roman numeral.

    Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.

    Symbol Value I 1 V 5 X 10 L ...read more
    View 3 more answers
    Q79. Factorial of a Number

    Write a program to find the factorial of a number.

    Factorial of n is:

    n! = n * (n-1) * (n-2) * (n-3)....* 1

    Output the factorial of 'n'. If it does not exist, output 'Error'.

    Input format :...read more
    View 2 more answers
    Q80. 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

    View 2 more answers
    Q81. Check If Two Nodes Are Cousins

    You are given an arbitrary binary tree consisting of N nodes, where each node is associated with a certain value, and two node values, a and b, you need to check if these nodes are...read more

    View 2 more answers
    Q82. Trapping Rain Water

    You have been given a long type array/list 'ARR' of size 'N'. It represents an elevation map wherein 'ARR[i]' denotes the elevation of the 'ith' bar. Print the total amount of rainwater that ...read more

    View 3 more answers
    Q83. Kth Smallest and Largest Element of Array

    You are given an array ‘Arr’ consisting of ‘N’ distinct integers and a positive integer ‘K’. Find out Kth smallest and Kth largest element of the array. It is guaranteed...read more

    View 4 more answers
    Q84. Parity Move

    Ninja recently studied odd and even numbers but he is more interested in even numbers.

    He has an array ‘A’ containing ‘N’ integers. He will transform this array by moving all the even numbers at the ...read more

    View 2 more answers
    Q85. 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

    View 2 more answers
    Q86. 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

    Add your answer
    Q87. Odd even level

    Given a binary tree. Find and return the modulus of the difference between the sum of odd level nodes and the sum of even level nodes.

    Input format:
    The first line contains an integer 'T' which de...read more
    View 2 more answers
    Q88. Colorful Knapsack

    You are given 'N' stones labeled from 1 to 'N'. The 'i-th' stone has the weight W[i]. There are 'M' colors labeled by integers from 1 to 'M'. The 'i-th' stone has the color C[i] which is an int...read more

    View 3 more answers
    Q89. Diameter of the binary tree.

    You are given a Binary Tree. You are supposed to return the length of the diameter of the tree.

    The diameter of a binary tree is the length of the longest path between any two end no...read more

    View 2 more answers
    Q90. Lexicographically smallest array

    You have been given an array/list ARR consisting of ‘N’ integers. You are also given a positive integer ‘K’.

    Your task is to find the lexicographically smallest ARR that can be o...read more

    Add your answer
    Q91. Prerequisite Task

    You are given a positive integer ‘N’ denoting the number of tasks you need to finish. You can directly start performing any task, but some tasks have some prerequisites, i.e. to perform some ta...read more

    View 2 more answers

    Q92. How many BSTs are possible with two nodes and three nodes?

    Ans.

    Number of possible BSTs with 2 and 3 nodes.

    • For 2 nodes, only 2 BSTs are possible.

    • For 3 nodes, 5 BSTs are possible.

    • Number of BSTs can be calculated using Catalan numbers formula.

    • Catalan(2) = 2, Catalan(3) = 5.

    Add your answer
    Q93. DBMS Question

    How would you manage an Employee-Organisation scenario as a Database? Explain your schema and relations between them.

    Add your answer
    Q94. Search In A Row Wise And Column Wise Sorted Matrix

    You are given an N * N matrix of integers where each row and each column is sorted in increasing order. You are given a target integer 'X'. Find the position of...read more

    View 3 more answers
    Q95. Longest Palindromic Substring

    Given a string ’S’ consisting of lower case English letters, you are supposed to return the longest palindromic substring of ‘S’.

    Note that in case of more than one longest palindro...read more

    View 3 more answers
    Q96. Print Nodes at distance K from a given node

    You are given an arbitrary binary tree, a node of the tree, and an integer 'K'. You need to find all such nodes which have a distance K from the given node and return ...read more

    View 2 more answers

    Q97. a unsorted array was given and a number x.find out the two elements whose sum is equal to x

    Ans.

    Find two elements in an unsorted array whose sum is equal to a given number x.

    • Use a hash table to store the difference between x and each element in the array.

    • Iterate through the array and check if the current element is in the hash table.

    • Return the pair of elements that add up to x.

    Add your answer
    Q98. Find subarray with given sum

    Given an array ARR of N integers and an integer S. The task is to find whether there exists a subarray(positive length) of the given array such that the sum of elements of the subar...read more

    View 3 more answers
    Q99. Diagonal Traversal of a binary tree.

    You have been given a binary tree of integers. You are supposed to find the diagonal traversal(refer to Example) of the given binary tree.

    Example:

    Consider lines at an angle...read more
    Add your answer

    Q100. What is my favourite app and any improvements in it which i want to implement?

    Ans.

    My favourite app is Spotify. I would like to see improvements in the algorithm for personalized playlists.

    • Improved algorithm for personalized playlists

    • Better integration with social media platforms

    • Option to create collaborative playlists with friends

    Add your answer
    1
    2
    3
    4
    5
    Contribute & help others!
    Write a review
    Share interview
    Contribute salary
    Add office photos

    Interview Process at null

    based on 322 interviews in the last 1 year
    Interview experience
    4.1
    Good
    View more
    Interview Tips & Stories
    Ace your next interview with expert advice and inspiring stories

    Top Interview Questions from Similar Companies

    3.7
     • 362 Interview Questions
    3.8
     • 202 Interview Questions
    3.7
     • 192 Interview Questions
    4.3
     • 189 Interview Questions
    3.8
     • 169 Interview Questions
    4.7
     • 143 Interview Questions
    View all
    Top Paytm Interview Questions And Answers
    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
    70 Lakh+

    Reviews

    5 Lakh+

    Interviews

    4 Crore+

    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