Infosys LeetCode Questions
100 questions all-time · 31 easy · 54 medium · 15 hard
| # | Problem | Difficulty | Frequency | Acceptance |
|---|---|---|---|---|
| 1 | Two Sum Array, Hash Table | Easy | 100 | 55.8% |
| 2 | Find Building Where Alice and Bob Can Meet Array, Binary Search, Stack, Binary Indexed Tree, Segment Tree, Heap (Priority Queue), Monotonic Stack | Hard | 95 | 52.2% |
| 3 | Minimum Reverse Operations Array, Breadth-First Search, Ordered Set | Hard | 93 | 15.3% |
| 4 | Count the Number of Ideal Arrays Math, Dynamic Programming, Combinatorics, Number Theory | Hard | 91 | 57.2% |
| 5 | Transform Array by Parity Array, Sorting, Counting | Easy | 89 | 89.6% |
| 6 | Maximum Sum of Subsequence With Non-adjacent Elements Array, Divide and Conquer, Dynamic Programming, Segment Tree | Hard | 89 | 15.4% |
| 7 | Eat Pizzas! Array, Greedy, Sorting | Medium | 89 | 32.4% |
| 8 | Longest Substring Without Repeating Characters Hash Table, String, Sliding Window | Medium | 89 | 36.9% |
| 9 | Determine the Minimum Sum of a k-avoiding Array Math, Greedy | Medium | 86 | 59.9% |
| 10 | Sort the People Array, Hash Table, String, Sorting | Easy | 86 | 84.8% |
| 11 | Number of Beautiful Integers in the Range Math, Dynamic Programming | Hard | 86 | 19.6% |
| 12 | Longest Well-Performing Interval Array, Hash Table, Stack, Monotonic Stack, Prefix Sum | Medium | 86 | 35.9% |
| 13 | Maximum Product After K Increments Array, Greedy, Heap (Priority Queue) | Medium | 86 | 42.3% |
| 14 | Maximum Segment Sum After Removals Array, Union Find, Prefix Sum, Ordered Set | Hard | 86 | 48.4% |
| 15 | Minimum Total Distance Traveled Array, Dynamic Programming, Sorting | Hard | 86 | 59.0% |
| 16 | Minimum Addition to Make Integer Beautiful Math, Greedy | Medium | 86 | 38.0% |
| 17 | Number of Nodes With Value One Tree, Depth-First Search, Breadth-First Search, Binary Tree | Medium | 86 | 65.6% |
| 18 | Can Convert String in K Moves Hash Table, String | Medium | 86 | 35.9% |
| 19 | The Number of Beautiful Subsets Array, Hash Table, Math, Dynamic Programming, Backtracking, Sorting, Combinatorics | Medium | 86 | 50.8% |
| 20 | Stone Game VIII Array, Math, Dynamic Programming, Prefix Sum, Game Theory | Hard | 86 | 52.8% |
| 21 | Maximum Number of Consecutive Values You Can Make Array, Greedy, Sorting | Medium | 86 | 62.1% |
| 22 | Best Time to Buy and Sell Stock Array, Dynamic Programming | Easy | 86 | 55.3% |
| 23 | Find the Minimum Possible Sum of a Beautiful Array Math, Greedy | Medium | 86 | 35.9% |
| 24 | Valid Parentheses String, Stack | Easy | 86 | 42.3% |
| 25 | Maximize the Minimum Game Score Array, Binary Search, Greedy | Hard | 86 | 25.1% |
| 26 | Largest Number After Mutating Substring Array, String, Greedy | Medium | 86 | 36.9% |
| 27 | Find the Number of Subsequences With Equal GCD Array, Math, Dynamic Programming, Number Theory | Hard | 86 | 28.8% |
| 28 | Merge Sorted Array Array, Two Pointers, Sorting | Easy | 80 | 52.9% |
| 29 | Next Permutation Array, Two Pointers | Medium | 80 | 43.1% |
| 30 | Palindrome Number Math | Easy | 77 | 59.2% |
| 31 | Remove Duplicates from Sorted Array Array, Two Pointers | Easy | 77 | 60.4% |
| 32 | Maximum Subarray Array, Divide and Conquer, Dynamic Programming | Medium | 77 | 52.1% |
| 33 | Reverse String Two Pointers, String | Easy | 73 | 79.8% |
| 34 | Longest Common Prefix String, Trie | Easy | 68 | 45.5% |
| 35 | Rotate Image Array, Math, Matrix | Medium | 68 | 77.9% |
| 36 | Trapping Rain Water Array, Two Pointers, Dynamic Programming, Stack, Monotonic Stack | Hard | 68 | 65.1% |
| 37 | Second Highest Salary Database | Medium | 68 | 43.9% |
| 38 | Valid Anagram Hash Table, String, Sorting | Easy | 68 | 66.7% |
| 39 | Product of Array Except Self Array, Prefix Sum | Medium | 68 | 67.8% |
| 40 | Fibonacci Number Math, Dynamic Programming, Recursion, Memoization | Easy | 62 | 72.9% |
| 41 | Reverse Integer Math | Medium | 62 | 30.3% |
| 42 | Coin Change Array, Dynamic Programming, Breadth-First Search | Medium | 62 | 46.5% |
| 43 | 3Sum Array, Two Pointers, Sorting | Medium | 62 | 37.1% |
| 44 | Group Anagrams Array, Hash Table, String, Sorting | Medium | 62 | 70.9% |
| 45 | Generate Parentheses String, Dynamic Programming, Backtracking | Medium | 62 | 77.1% |
| 46 | Rotate Array Array, Math, Two Pointers | Medium | 62 | 43.0% |
| 47 | Spiral Matrix Array, Matrix, Simulation | Medium | 62 | 53.9% |
| 48 | Merge Intervals Array, Sorting | Medium | 62 | 49.4% |
| 49 | Longest Consecutive Sequence Array, Hash Table, Union Find | Medium | 55 | 47.0% |
| 50 | Reverse Words in a String Two Pointers, String | Medium | 55 | 51.9% |
| 51 | Kth Largest Element in an Array Array, Divide and Conquer, Sorting, Heap (Priority Queue), Quickselect | Medium | 55 | 68.0% |
| 52 | Sort an Array Array, Divide and Conquer, Sorting, Heap (Priority Queue), Merge Sort, Bucket Sort, Radix Sort, Counting Sort | Medium | 55 | 56.6% |
| 53 | Two Sum II - Input Array Is Sorted Array, Two Pointers, Binary Search | Medium | 55 | 63.4% |
| 54 | Move Zeroes Array, Two Pointers | Easy | 55 | 62.8% |
| 55 | Find the Index of the First Occurrence in a String Two Pointers, String, String Matching | Easy | 55 | 45.0% |
| 56 | Rearrange Array Elements by Sign Array, Two Pointers, Simulation | Medium | 55 | 84.4% |
| 57 | Longest Palindromic Substring Two Pointers, String, Dynamic Programming | Medium | 55 | 35.8% |
| 58 | Number of Islands Array, Depth-First Search, Breadth-First Search, Union Find, Matrix | Medium | 55 | 62.3% |
| 59 | Palindrome Partitioning String, Dynamic Programming, Backtracking | Medium | 55 | 72.1% |
| 60 | Add Two Numbers Linked List, Math, Recursion | Medium | 55 | 46.2% |
| 61 | Single Element in a Sorted Array Array, Binary Search | Medium | 55 | 59.2% |
| 62 | Reverse Nodes in k-Group Linked List, Recursion | Hard | 55 | 63.0% |
| 63 | Climbing Stairs Math, Dynamic Programming, Memoization | Easy | 55 | 53.5% |
| 64 | Sqrt(x) Math, Binary Search | Easy | 55 | 40.4% |
| 65 | Merge Two Sorted Lists Linked List, Recursion | Easy | 55 | 66.8% |
| 66 | Missing Number Array, Hash Table, Math, Binary Search, Bit Manipulation, Sorting | Easy | 55 | 70.1% |
| 67 | House Robber Array, Dynamic Programming | Medium | 55 | 52.3% |
| 68 | Gas Station Array, Greedy | Medium | 55 | 46.4% |
| 69 | Create a DataFrame from List | Easy | 44 | 81.5% |
| 70 | Maximum Product of Three Numbers Array, Math, Sorting | Easy | 44 | 45.3% |
| 71 | 4Sum Array, Two Pointers, Sorting | Medium | 44 | 38.2% |
| 72 | Minimum Window Substring Hash Table, String, Sliding Window | Hard | 44 | 45.4% |
| 73 | Integer to Roman Hash Table, Math, String | Medium | 44 | 68.6% |
| 74 | Koko Eating Bananas Array, Binary Search | Medium | 44 | 49.1% |
| 75 | Best Time to Buy and Sell Stock II Array, Dynamic Programming, Greedy | Medium | 44 | 69.5% |
| 76 | Subsets Array, Backtracking, Bit Manipulation | Medium | 44 | 80.9% |
| 77 | Container With Most Water Array, Two Pointers, Greedy | Medium | 44 | 57.8% |
| 78 | Implement Queue using Stacks Stack, Design, Queue | Easy | 44 | 68.1% |
| 79 | Search in Rotated Sorted Array Array, Binary Search | Medium | 44 | 42.8% |
| 80 | Binary Search Array, Binary Search | Easy | 44 | 59.6% |
| 81 | Isomorphic Strings Hash Table, String | Easy | 44 | 46.9% |
| 82 | To Lower Case String | Easy | 44 | 84.2% |
| 83 | Kids With the Greatest Number of Candies Array | Easy | 44 | 88.1% |
| 84 | Subarray Sum Equals K Array, Hash Table, Prefix Sum | Medium | 44 | 45.5% |
| 85 | Combination Sum Array, Backtracking | Medium | 44 | 74.7% |
| 86 | Maximum Depth of Binary Tree Tree, Depth-First Search, Breadth-First Search, Binary Tree | Easy | 44 | 77.1% |
| 87 | String to Integer (atoi) String | Medium | 44 | 19.2% |
| 88 | Jump Game Array, Dynamic Programming, Greedy | Medium | 44 | 39.5% |
| 89 | Car Fleet Array, Stack, Sorting, Monotonic Stack | Medium | 44 | 53.5% |
| 90 | Median of Two Sorted Arrays Array, Binary Search, Divide and Conquer | Hard | 44 | 43.8% |
| 91 | Edit Distance String, Dynamic Programming | Medium | 44 | 58.8% |
| 92 | Greatest Common Divisor of Strings Math, String | Easy | 44 | 52.7% |
| 93 | Replace Employee ID With The Unique Identifier Database | Easy | 44 | 83.6% |
| 94 | Find the Duplicate Number Array, Two Pointers, Binary Search, Bit Manipulation | Medium | 44 | 62.8% |
| 95 | Maximum Score Words Formed by Letters Array, String, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask | Hard | 44 | 81.6% |
| 96 | Valid Palindrome Two Pointers, String | Easy | 44 | 51.0% |
| 97 | Combination Sum II Array, Backtracking | Medium | 44 | 57.7% |
| 98 | Pow(x, n) Math, Recursion | Medium | 44 | 37.0% |
| 99 | Average Time of Process per Machine Database | Easy | 44 | 68.6% |
| 100 | Roman to Integer Hash Table, Math, String | Easy | 44 | 64.9% |
How to read this list
The tabs at the top split the questions by how recently people said they were asked in interviews. "Last 30 Days" is the past month, "Last 3 Months" is the past quarter, and so on. "All Time" is every question on record for this company.
Frequency is a score from 0 to 100 for how often a question showed up in that time window. A higher number means it came up more often, so the list starts with the most common questions first. Acceptance is the share of submissions that pass on LeetCode. Click any question to open it on LeetCode.