Add office photos
Engaged Employer
Amazon
based on 23.7k Reviews
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Company Overview
Associated Companies
Company Locations
Filter interviews by
300+ Interview Questions and Answers
Updated 6 Nov 2024
Popular Designations
Asked in
Software Developer InterviewQ1. 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 39 more answers
Asked in
Software Developer InterviewQ2. Minimum Number of Platform Needed You are given the arrival and departure times of N trains at a railway station in a day. You need to find the minimum of platforms required for the railway station such that no...
read more
View 9 more answers
Asked in
Software Developer InterviewQ3. Permutation in String You have been given two strings ‘str1’ and ‘str2’ of length N and M respectively. Your task is to check whether string ‘str2’ contains one of the permutations of string ‘str1’ as its subst...
read more
View 5 more answers
Asked in
Software Developer InterviewQ4. Fenwick Tree You are given an array/list 'ARR' of ‘N’ integers, and ‘Q’ queries. Each query can be of two types: Given 2 integers ‘L’,’R’ ( L>=0 and R Given an index ‘i’ update the value of ARR[i] to a given in...
read more
View 4 more answers
Discover null interview dos and don'ts from real experiences
Asked in
Software Developer InterviewQ5. Count Special Nodes in Generic Tree Given a generic tree, find the count of all special nodes. A node is a special node if there is a path from root to that node with all distinct elements. The input was not a ...
read more
View 3 more answers
Asked in
Software Developer InterviewQ6. Delete alternate nodes Given a Singly Linked List of integers, delete all the alternate nodes in the list. Example: List: 10 -> 20 -> 30 -> 40 -> 50 -> 60 -> null Alternate nodes will be: 20, 40, and 60. Hence ...
read more
View 2 more answers
Are these interview questions helpful?
Asked in
Software Developer InterviewQ7. Fire in the cells. You are given a matrix 'MAT' of size ‘N’ * ‘M’, where ‘N’ is the number of rows and ‘M’ is the number of columns. Value ‘0’ in a cell represents that the cell is set on fire initially, (at ti...
read more
View 2 more answers
Asked in
Software Developer InterviewQ8. Maximum sum of non-adjacent elements You are given an array/list of ‘N’ integers. You are supposed to return the maximum sum of the subsequence with the constraint that no two elements are adjacent in the give...
read more
View 4 more answers
Share interview questions and help millions of jobseekers 🌟
Asked in
Software Developer InterviewQ9. 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
Asked in
Software Developer InterviewQ10. There is a 12 km road and a contractor who is in-charge of repairing it. Contractor updates you about the work which is done in patches. Like “Road between 3.2 km to 7.9 km repaired ”, “Road between 1.21 km to ...
read more
Ans.
The longest continuous patch of a road repaired by a contractor is determined. Iterate through the updates and keep track of the start and end points of each patch Calculate the length of each patch and update the longest patch if necessary Return the start and end points of the longest patch
View 1 answer
Asked in
Software Developer InterviewQ11. Maximum Path Sum Between Two Leaves You are given a non-empty binary tree where each node has a non-negative integer value. Return the maximum possible sum of path between any two leaves of the given tree. The ...
read more
View 4 more answers
Asked in
Software Developer InterviewQ12. Car Pooling You are working as a cab driver. Your car moves in a straight line and moves toward the forward direction only. Initially, you have ‘C’ empty seats for the passengers. Now, you are given ‘N’ number...
read more
View 3 more answers
Asked in
Software Developer InterviewQ13. Best Time To Buy and Sell Stock You have been given an array 'PRICES' consisting of 'N' integers where PRICES[i] denotes the price of a given stock on the i-th day. You are also given an integer 'K' denoting th...
read more
View 4 more answers
Asked in
Software Developer InterviewQ14. Search for integers with given difference and at given distance You are given an array consisting of 'N' non-negative integers, and two non-negative integers 'K' and 'M', your task is to find a pair of indices(...
read more
View 3 more answers
Asked in
Software Developer InterviewQ15. Sum of minimum and maximum elements of all subarrays of size “K” You are given an array consisting of N integers, and an integer, K. Your task is to determine the total sum of the minimum element and the maximu...
read more
View 3 more answers
Asked in
Software Developer InterviewQ16. Count Inversions For a given integer array/list 'ARR' of size 'N' containing all distinct values, find the total number of 'Inversions' that may exist. An inversion is defined for a pair of integers in the arra...
read more
View 4 more answers
Asked in
Software Developer InterviewQ17. 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
View 3 more answers
Asked in
Software Developer InterviewQ18. 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 S...
read more
View 3 more answers
Asked in
Software Developer InterviewQ19. Count derangements A Derangement is a permutation of ‘N’ elements, such that no element appears in its original position. For example, an instance of derangement of {0, 1, 2, 3} is {2, 3, 1, 0}, because 2 pres...
read more
View 4 more answers
Asked in
Software Developer InterviewQ20. Mike and Mobile Mike is a little boy who loves solving math problems. One day he was playing with his mom’s mobile. The mobile keypad contains 12 buttons { 10 digits(0-9) and 2 characters(‘*’ and ‘#’) }. Mike ...
read more
View 4 more answers
Asked in
Software Developer InterviewQ21. Selling Stock You have been given stock values/prices for N number of days. Every i-th day signifies the price of a stock on that day. Your task is to find the maximum profit which you can make by buying and se...
read more
View 3 more answers
Asked in
Software Developer InterviewQ22. 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'...
read more
View 4 more answers
Asked in
Software Developer InterviewQ23. Spiral Matrix You are given a 2-D array 'MATRIX' of dimensions N x M, of integers. You need to return the spiral path of the matrix. Example Of Spiral Path: Input Format: The first line contains an integer 'T' ...
read more
View 2 more answers
Asked in
Software Developer InterviewQ24. 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. Valu...
read more
View 3 more answers
Asked in
Software Developer InterviewQ25. Detect Cycle In A Directed Graph You are given a directed graph having ‘N’ nodes. A matrix ‘EDGES’ of size M x 2 is given which represents the ‘M’ edges such that there is an edge directed from node EDGES[i][0]...
read more
View 3 more answers
Asked in
Software Developer InterviewQ26. Unique Paths You are present at point ‘A’ which is the top-left cell of an M X N matrix, your destination is point ‘B’, which is the bottom-right cell of the same matrix. Your task is to find the total number o...
read more
View 5 more answers
Asked in
Software Developer InterviewQ27. Covid Vaccination We are suffering from the Second wave of Covid-19. The Government is trying to increase its vaccination drives. Ninja wants to help the Government to plan an effective method to help increase ...
read more
View 2 more answers
Asked in
Software Developer InterviewQ28. First Missing Positive You are given an array 'ARR' of integers of length N. Your task is to find the first missing positive integer in linear time and constant space. In other words, find the lowest positive i...
read more
View 5 more answers
Asked in
Software Developer InterviewQ29. Maximum In Sliding Windows Of Size K Given an array/list of integers of length ‘N’, there is a sliding window of size ‘K’ which moves from the beginning of the array, to the very end. You can only see the ‘K’ n...
read more
View 3 more answers
Asked in
Software Developer InterviewQ30. Find Pair Sum equal to K. 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: Given...
read more
View 3 more answers
Asked in
Software Developer InterviewQ31. Rotten oranges problem 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 orang...
read more
View 3 more answers
Asked in
Software Developer InterviewQ32. Shortest Path In A Binary Maze Given a maze in the form of a binary rectangular matrix of size M*N, where each element can either be 0 or 1, the task is to find the length of the shortest path in a maze from a ...
read more
View 4 more answers
Asked in
Software Developer InterviewQ33. Maximum 0-1 Distance You are given an N*M binary matrix, considering for every 0-cell(cell with value = 0) the distance from this cell to its nearest 1-cell(cell with value = 1) is 'di', you need to find the ma...
read more
View 3 more answers
Asked in
Software Developer InterviewQ34. Special Binary Tree. You are given an arbitrary binary tree. A binary tree is called special if every node of this tree has either zero or two children. You have to determine if the given binary tree is special...
read more
View 3 more answers
Asked in
Software Developer InterviewQ35. 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
View 4 more answers
Asked in
Software Developer InterviewQ36. 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
View 3 more answers
Asked in
Software Developer InterviewQ37. Longest Decreasing Subsequence You are given an array/list ARR consisting of N integers. Your task is to find the length of the longest decreasing subsequence. A subsequence is a sequence of numbers obtained by...
read more
View 4 more answers
Asked in
Software Developer InterviewQ38. 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 t...
read more
View 3 more answers
Asked in
Software Developer InterviewQ39. Longest Substring Without Repeating Characters Given a string 'S' of length 'L', return the length of the longest substring without repeating characters. Example: Suppose given input is "abacb", then the length...
read more
View 5 more answers
Asked in
Software Developer InterviewQ40. Count triplets in a sorted doubly linked list whose sum is equal to a given value x You are given a sorted doubly linked list of distinct nodes that means no two nodes present in the list have the same data. Y...
read more
View 4 more answers
Asked in
Software Developer InterviewQ41. Longest Palindromic Substring You are given a string (STR) of length N. Your task is to find the longest palindromic substring. If there is more than one palindromic substring with the maximum length, return th...
read more
View 4 more answers
Asked in
Software Developer InterviewQ42. Trapping Rainwater 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 4 more answers
Asked in
Software Developer InterviewQ43. First and Last Position of an Element In Sorted Array You have been given a sorted array/list ARR consisting of ‘N’ elements. You are also given an integer ‘K’. Now, your task is to find the first and last occu...
read more
View 2 more answers
Asked in
Software Developer InterviewQ44. Strongly Connected Components (Tarjan’s Algorithm) You are given an unweighted directed graph of 'V' vertices and 'E' edges. Your task is to print all the strongly connected components (SCCs) present in the gra...
read more
View 2 more answers
Asked in
Software Developer InterviewQ45. Check if the Word is present in Sentence or not You have been given a sentence ‘S’ in the form of a string and a word ‘W’, you need to find whether the word is present in the given sentence or not. The word mus...
read more
View 3 more answers
Asked in
Software Developer InterviewQ46. 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, ...
read more
View 3 more answers
Asked in
Software Developer InterviewQ47. 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 ...
read more
View 3 more answers
Asked in
Software Developer InterviewQ48. 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 3 more answers
Asked in
Software Developer InterviewQ49. 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 ...
read more
View 3 more answers
Asked in
Software Developer InterviewQ50. Minimum Window Subsequence You are given two strings ‘S’ and ‘T’. Your task is to find the minimum (Contiguous) substring ‘W’ of ‘S’, such that ‘T’ is a subsequence of ‘W’ A subsequence is a sequence that can b...
read more
View 2 more answers
Asked in
Software Developer InterviewQ51. Number of islands Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5 islands Example: Input : mat[][] = {{1, 1, 0, 0, 0}, {0...
read more
View 2 more answers
Asked in
Software Developer InterviewQ52. Dijkstra's shortest path You have been given an undirected graph of ‘V’ vertices (labeled 0,1,..., V-1) and ‘E’ edges. Each edge connecting two nodes (‘X’,’Y’) will have a weight denoting the distance between n...
read more
View 3 more answers
Asked in
Software Developer InterviewQ53. Evaluation of postfix expression An expression is called the postfix expression if the operator appears in the expression after the operands. Example : Infix expression: A + B * C - D Postfix expression: A B + ...
read more
View 2 more answers
Asked in
Software Developer InterviewQ54. 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 sh...
read more
View 4 more answers
Asked in
Software Developer InterviewQ55. Minimum Path Sum Ninjaland is a country in the shape of a 2-Dimensional grid 'GRID', with 'N' rows and 'M' columns. Each point in the grid has some cost associated with it. Find a path from top left i.e. (0, 0)...
read more
View 4 more answers
Asked in
Software Developer InterviewQ56. 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 ...
read more
View 4 more answers
Asked in
Software Developer InterviewQ57. Count Frequency You are given a string 'S' of length 'N', you need to find the frequency of each of the characters from ‘a’ to ‘z’ in the given string. Example : Given 'S' : abcdg Then output will be : 1 1 1 1 ...
read more
Add your answer
Asked in
Software Developer InterviewQ58. Longest Increasing Subsequence For a given array with N elements, you need to find the length of the longest subsequence from the array such that all the elements of the subsequence are sorted in strictly incre...
read more
View 5 more answers
Asked in
Software Developer InterviewQ59. Number with maximum probability One day Ninja Misha and Ninja Andrew (students of the Ultimate Ninja Ankush) were playing a very simple game. First, each player chooses an integer in the range from 1 to ‘N’. Le...
read more
View 2 more answers
Asked in
Software Developer InterviewQ60. 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 subarray e...
read more
View 2 more answers
Asked in
Software Developer InterviewQ61. 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 c...
read more
View 4 more answers
Asked in
Software Developer InterviewQ62. Weighted Job Scheduling You are given 'N' jobs with their start time 'Start', end time 'End' and profit 'Profit'. You need to tell the maximum profit you can obtain by performing these jobs such that no two job...
read more
View 4 more answers
Asked in
Software Developer InterviewQ63. Boundary Traversal You have been given a binary tree of integers. Your task is to print the boundary nodes of this binary tree in Anti-Clockwise direction starting from the root node. NOTE: The boundary nodes o...
read more
View 2 more answers
Asked in
Software Developer InterviewQ64. 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
Asked in
Software Developer InterviewQ65. Clone a linked List having random pointers 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...
read more
View 4 more answers
Asked in
Software Developer InterviewQ66. Element that appears once You are given an arbitrary array ‘arr’ consisting of N non-negative integers, where every element appears thrice except one. You need to find the element that appears only once. Input ...
read more
View 3 more answers
Asked in
Software Developer InterviewQ67. Right View You have been given a Binary Tree of integers. Your task is to print the Right view of it. The right view of a Binary Tree is a set of nodes visible when the tree is viewed from the Right side and th...
read more
View 2 more answers
Asked in
Software Developer InterviewQ68. Smallest Window You are given two strings S and X containing random characters. Your task is to find the smallest substring in S which contains all the characters present in X. Example: Let S = “abdd” and X = “...
read more
View 2 more answers
Asked in
Software Developer InterviewQ69. Maximum Subarray Sum You are given an array (ARR) of length N, consisting of integers. You have to find the sum of the subarray (including empty subarray) having maximum sum among all subarrays. A subarray is a...
read more
View 5 more answers
Asked in
Software Developer InterviewQ70. Next Greater Element You have been given an array/list ‘ARR’ consisting of ‘N’ positive integers. Your task is to return the Next Greater Element(NGE) for every element. The Next Greater Element for an element ...
read more
View 2 more answers
Asked in
Software Developer InterviewQ71. Find k’th character of decrypted string Given an encoded string where repetitions of substrings are represented as substring followed by count of substrings. For example, if encrypted string is “ab2cd2” and k=4...
read more
View 3 more answers
Asked in
Software Developer InterviewQ72. Find Row K Given a square binary matrix ‘mat[n][n]’, find ‘K’ such that all elements in the Kth row are ‘0’ and all elements in the Kth column are ‘1’. The value of mat[k][k] can be anything (either ‘0’ or ‘1’)...
read more
View 2 more answers
Asked in
Software Developer InterviewQ73. Most Frequent Word You are given two strings 'A' and 'B' of words. Your task is to find out the most frequent and lexicographically smallest word in string 'A', which is not present in string 'B'. If no such wo...
read more
View 2 more answers
Asked in
Software Developer InterviewQ74. Rearrange String You are given a string of lowercase characters. Your task is to rearrange (reorder) the string in such a way that no two adjacent characters are the same. You have to return the rearranged stri...
read more
View 3 more answers
Asked in
Software Developer InterviewQ75. Path In A Tree You are given a binary tree with ‘N’ number of nodes and a node ‘X’. Your task is to print the path from the root node to the given node ‘X’. A binary tree is a hierarchical data structure in whi...
read more
Add your answer
Asked in
Software Developer InterviewQ76. Minimum Number of Platforms 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 number of pla...
read more
View 3 more answers
Asked in
Software Developer InterviewQ77. Square root (decimal) You have been given two integers 'N' and 'D', Your task is to find the square root of the number 'N' with precision up to 'D' decimal places i.e. the difference between your answer and th...
read more
View 3 more answers
Asked in
Software Developer InterviewQ78. Find Number of Islands You are given a 2-dimensional array/list having N rows and M columns, which is filled with ones(1) and zeroes(0). 1 signifies land, and 0 signifies water. A cell is said to be connected ...
read more
View 2 more answers
Asked in
Software Developer InterviewQ79. K Most Frequent Words You have been given an array/list 'WORDS' of 'N' non-empty words, and an integer 'K'. Your task is to return the 'K' most frequent words sorted by their frequency from highest to lowest. ...
read more
View 3 more answers
Asked in
Software Developer InterviewQ80. Left View Of Binary Tree Given a binary tree. Print the Left View of the Tree. Example : If the input tree is as depicted in the picture: The Left View of the tree will be: 2 35 2 Input format : Elements in the...
read more
View 3 more answers
Asked in
Software Developer InterviewQ81. 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 s...
read more
Add your answer
Asked in
Software Developer InterviewQ82. Minimum Direction Changes Given a 2D grid having N Rows and M Columns. Each cell of the grid has a character among [ 'U', 'L', 'D', 'R' ] written on it, denoting Up, Left, Down, and Right respectively and indic...
read more
Add your answer
Asked in
Software Developer InterviewQ83. Clone a Linked List with random pointers 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 o...
read more
View 4 more answers
Asked in
Software Developer InterviewQ84. Maximum Path Sum in the matrix You have been given an N*M matrix filled with integer numbers, find the maximum sum that can be obtained from a path starting from any cell in the first row to any cell in the las...
read more
View 4 more answers
Asked in
Software Developer InterviewQ85. Total Unique Paths You are present at point ‘A’ which is the top-left cell of an M X N matrix, your destination is point ‘B’, which is the bottom-right cell of the same matrix. Your task is to find the total nu...
read more
View 4 more answers
Asked in
Software Developer InterviewQ86. Bottom view of binary tree Given a binary tree, print its bottom view from left to right. Assume, the left and the right child make a 45-degree angle with the parent. A binary tree is a tree in which each paren...
read more
View 4 more answers
Asked in
Software Developer InterviewQ87. 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 o...
read more
Ans.
Software testing is the process of evaluating a software item to detect differences between given input and expected output. Software testing ensures that the software is working as expected It helps to identify defects and errors in the software Testing can be done manually or using automated tools Types of testing include functional, performance, security, and usability testing
View 4 more answers
Asked in
Software Developer InterviewQ88. Kth smallest element in an unsorted array Given an unsorted array ‘arr’ of distinct integers and an integer ‘k’, your task is to find the ‘k-th’ smallest element in the array. Example: n = 5, k = 2 and arr[] = ...
read more
View 3 more answers
Asked in
Software Developer InterviewQ89. Minimum Cost to Connect All Points You are given an array, ‘COORDINATES’ that represents the integer coordinates of some points on a 2D plane. Your task is to find the minimum cost to make all the points connec...
read more
View 2 more answers
Asked in
Software Developer InterviewQ90. Tiling Problem Given a “2 x n” board and tiles of size “2 x 1”, count the number of ways to tile the given board using the 2 x 1 tiles. A tile can either be placed horizontally i.e., as a 1 x 2 tile or vertical...
read more
View 4 more answers
Asked in
Software Developer InterviewQ91. Largest rectangle in a histogram You have been given an array/list 'HEIGHTS' of length ‘N. 'HEIGHTS' represents the histogram and each element of 'HEIGHTS' represents the height of the histogram bar. Consider t...
read more
View 4 more answers
Asked in
Software Developer InterviewQ92. Infix To Postfix You are given a string EXP which is a valid infix expression. Convert the given infix expression to postfix expression. Infix expression is of the form a op b. Where operator is is between the ...
read more
Add your answer
Asked in
Software Developer InterviewQ93. 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 summati...
read more
View 3 more answers
Asked in
Software Developer InterviewQ94. 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
Asked in
Software Developer InterviewQ95. Merge Two Sorted Linked Lists You are given two sorted linked lists. You have to merge them to produce a combined sorted linked list. You need to return the head of the final linked list. Note: The given linked...
read more
View 3 more answers
Asked in
Software Developer InterviewQ96. What are the different types of hashing? Suggest an alternative and a better way for Linear Chaining.
Ans.
Different types of hashing and alternative for Linear Chaining Different types of hashing include division, multiplication, and universal hashing Alternative for Linear Chaining is Open Addressing Open Addressing includes Linear Probing, Quadratic Probing, and Double Hashing
View 2 more answers
Asked in
Software Developer InterviewQ97. 14. you have given a string of multiline. you have to print the maximum occupancy word in each line and if there is some capital letter in each line then print each capital letter occupancy and then small lette...
read more
Ans.
The question asks to find the maximum occupancy word in each line of a given multiline string and also count the occupancy of capital and small letters separately. Split the multiline string into individual lines For each line, split it into words Initialize variables to store the maximum occupancy word and its count Iterate through each word and count the occupancy of each letter If the current word has a higher occupancy than the maximum occupancy word, update the maximum ...
read more
View 1 answer
Asked in
Software Developer InterviewQ98. Loot Houses A thief wants to loot houses. He knows the amount of money in each house. He cannot loot two consecutive houses. Find the maximum amount of money he can loot. Input Format : The first line of input ...
read more
View 3 more answers
Asked in
Software Developer InterviewQ99. Given a string, find the next smallest palindrome You are given a number 'N' in the form of a string 'S', your task is to find the smallest number strictly greater than the given number 'N' which is a palindrom...
read more
View 2 more answers
Asked in
Software Developer InterviewQ100. 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 give...
read more
View 2 more answers
1
2
3
4
More about working at Amazon
Top Rated Mega Company - 2024
Top Rated Company for Women - 2024
Top Rated Internet/Product Company - 2024
HQ - Seattle,Washington, United States
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos
Top HR Questions asked in null
Interview Process at null
based on 52 interviews in the last 1 year
3 Interview rounds
Coding Test Round
Technical Round 1
Technical Round 2
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories
Top Software Developer Interview Questions from Similar Companies
78 Interview Questions
71 Interview Questions
19 Interview Questions
18 Interview Questions
17 Interview Questions
17 Interview Questions
>
Top Amazon Software Developer Interview Questions And Answers
Share Interview Advice
Stay ahead in your career. Get AmbitionBox app
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