SAP LeetCode Questions
42 questions all-time · 14 easy · 21 medium · 7 hard
| # | Problem | Difficulty | Frequency | Acceptance |
|---|---|---|---|---|
| 1 | Two Sum Array, Hash Table | Easy | 100 | 0.6% |
| 2 | Maximum Path Quality of a Graph Array, Backtracking, Graph Theory | Hard | 92 | 0.6% |
| 3 | Count the Number of Infection Sequences Array, Math, Combinatorics | Hard | 92 | 0.4% |
| 4 | Maximum Students Taking Exam Array, Dynamic Programming, Bit Manipulation, Matrix, Bitmask | Hard | 92 | 0.5% |
| 5 | Movie Rating Database | Medium | 92 | 0.4% |
| 6 | Count Increasing Quadruplets Array, Dynamic Programming, Binary Indexed Tree, Enumeration, Prefix Sum | Hard | 92 | 0.3% |
| 7 | Container With Most Water Array, Two Pointers, Greedy | Medium | 86 | 0.6% |
| 8 | Longest Common Prefix Array, String, Trie | Easy | 79 | 0.5% |
| 9 | Valid Parentheses String, Stack | Easy | 79 | 0.4% |
| 10 | Best Time to Buy and Sell Stock Array, Dynamic Programming | Easy | 75 | 0.6% |
| 11 | Number of Islands Array, Depth-First Search, Breadth-First Search, Union-Find, Matrix | Medium | 75 | 0.6% |
| 12 | Merge Intervals Array, Sorting | Medium | 75 | 0.5% |
| 13 | Maximum Subarray Array, Divide and Conquer, Dynamic Programming | Medium | 69 | 0.5% |
| 14 | Longest Palindromic Substring Two Pointers, String, Dynamic Programming | Medium | 69 | 0.4% |
| 15 | Palindrome Number Math | Easy | 69 | 0.6% |
| 16 | Reverse Linked List Linked List, Recursion | Easy | 62 | 0.8% |
| 17 | Kth Largest Element in an Array Array, Divide and Conquer, Sorting, Heap (Priority Queue), Quickselect | Medium | 62 | 0.7% |
| 18 | Valid Palindrome Two Pointers, String | Easy | 62 | 0.5% |
| 19 | LRU Cache Hash Table, Linked List, Design, Doubly-Linked List | Medium | 62 | 0.5% |
| 20 | Leftmost Column with at Least a One Array, Binary Search, Matrix, Interactive | Medium | 62 | 0.6% |
| 21 | Coin Change Array, Dynamic Programming, Breadth-First Search | Medium | 62 | 0.5% |
| 22 | Group Anagrams Array, Hash Table, String, Sorting | Medium | 62 | 0.7% |
| 23 | Move Zeroes Array, Two Pointers | Easy | 62 | 0.6% |
| 24 | Longest Substring Without Repeating Characters Hash Table, String, Sliding Window | Medium | 62 | 0.4% |
| 25 | Linked List Cycle Hash Table, Linked List, Two Pointers | Easy | 62 | 0.5% |
| 26 | Search a 2D Matrix Array, Binary Search, Matrix | Medium | 62 | 0.5% |
| 27 | Maximal Square Array, Dynamic Programming, Matrix | Medium | 53 | 0.5% |
| 28 | Valid Perfect Square Math, Binary Search | Easy | 53 | 0.5% |
| 29 | Trapping Rain Water Array, Two Pointers, Dynamic Programming, Stack, Monotonic Stack | Hard | 53 | 0.7% |
| 30 | Binary Search Tree to Greater Sum Tree Tree, Depth-First Search, Binary Search Tree, Binary Tree | Medium | 53 | 0.9% |
| 31 | Candy Array, Greedy | Hard | 53 | 0.5% |
| 32 | Product of Array Except Self Array, Prefix Sum | Medium | 53 | 0.7% |
| 33 | Same Tree Tree, Depth-First Search, Breadth-First Search, Binary Tree | Easy | 53 | 0.7% |
| 34 | Search in Rotated Sorted Array Array, Binary Search | Medium | 53 | 0.5% |
| 35 | Count Primes Array, Math, Enumeration, Number Theory | Medium | 53 | 0.4% |
| 36 | Add Two Numbers Linked List, Math, Recursion | Medium | 53 | 0.5% |
| 37 | Implement Queue using Stacks Stack, Design, Queue | Easy | 53 | 0.7% |
| 38 | Lowest Common Ancestor of a Binary Tree Tree, Depth-First Search, Binary Tree | Medium | 53 | 0.7% |
| 39 | Palindrome Linked List Linked List, Two Pointers, Stack, Recursion | Easy | 53 | 0.6% |
| 40 | Ransom Note Hash Table, String, Counting | Easy | 53 | 0.7% |
| 41 | Daily Temperatures Array, Stack, Monotonic Stack | Medium | 53 | 0.7% |
| 42 | Minimum Window Substring Hash Table, String, Sliding Window | Hard | 53 | 0.5% |
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.