How often are these problems asked?
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent SAP interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
Problem database last updated: June 20, 2025
38 problems · 15 Easy, 17 Medium, 6 Hard · Ranked #54 of 458
15 Easy
39% · avg 23%
17 Medium
45% · avg 59%
6 Hard
16% · avg 18%
Based on 38 reported problems, SAP interviews are in line with industry averages - 16% Hard vs 18% overall.
Compared to the industry average, SAP puts unusual emphasis on memoization (5.3% of problems, 3.2x the industry average), trie (5.3% of problems, 2x the industry average), graph (5.3% of problems, 1.8x the industry average). If you're short on time, these are the categories to double down on.
The most common topics are array (63.2%), dynamic-programming (28.9%), two-pointers (18.4%), string (18.4%). Problems below are sorted by frequency, the ones at the top are asked most often.
| Problem | Difficulty | Frequency | Topics | |
|---|---|---|---|---|
Two Sum Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target. | Easy | Very Likely | arrayhash-map | Solve |
Count the Number of Infection Sequences You are given an integer n and an array sick sorted in increasing order, representing positions of infected people in a line of n people. | Hard | Very Likely | arraymathcombinatorics | Solve |
Movie Rating Table: Movies | Medium | Very Likely | database | Solve |
Container With Most Water You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). | Medium | Very Likely | arraytwo-pointersgreedy | Solve |
Maximum Students Taking Exam Given a m n matrix seats that represent seats distributions in a classroom. If a seat is broken, it is denoted by '' character otherwise it is denoted by a '.'... | Hard | Very Likely | arraydynamic-programmingbit-manipulation | Solve |
Maximum Path Quality of a Graph There is an undirected graph with n nodes numbered from 0 to n - 1 (inclusive). You are given a 0-indexed integer array values where values[i] is the value of t... | Hard | Very Likely | arraybacktrackinggraph | Solve |
Count Increasing Quadruplets Given a 0-indexed integer array nums of size n containing all numbers from 1 to n, return the number of increasing quadruplets. | Hard | Very Likely | arraydynamic-programmingbinary-indexed-tree | Solve |
Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. | Easy | Very Likely | arraystringtrie | Solve |
Valid Parentheses Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. | Easy | Very Likely | stringstack | Solve |
Number of Islands Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands. | Medium | Very Likely | arraydepth-first-searchbreadth-first-search | Solve |
Reverse Linked List Given the head of a singly linked list, reverse the list, and return the reversed list. | Easy | Likely | linked-listrecursion | Solve |
Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. | Hard | Likely | arraytwo-pointersdynamic-programming | Solve |
Maximal Square Given an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. | Medium | Likely | arraydynamic-programmingmatrix | Solve |
Valid Palindrome A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forwa... | Easy | Likely | two-pointersstring | Solve |
Maximum Subarray Given an integer array nums, find the subarray with the largest sum, and return its sum. | Medium | Likely | arraydivide-and-conquerdynamic-programming | Solve |
Rotate String Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s. | Easy | Likely | stringstring-matching | Solve |
Longest Consecutive Sequence Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. | Medium | Likely | arrayhash-tableunion-find | Solve |
Remove Duplicates from Sorted Array Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o... | Easy | Likely | arraytwo-pointers | Solve |
Best Time to Buy and Sell Stock You are given an array prices where prices[i] is the price of a given stock on the ith day. | Easy | Likely | arraydynamic-programming | Solve |
Daily Temperatures Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait aft... | Medium | Likely | arraystackmonotonic-stack | Solve |
Maximum Number of Weeks for Which You Can Work There are n projects numbered from 0 to n - 1. You are given an integer array milestones where each milestones[i] denotes the number of milestones the ith proje... | Medium | Likely | arraygreedy | Solve |
Longest Palindromic Substring Given a string s, return the longest palindromic substring in s. | Medium | Likely | two-pointersstringdynamic-programming | Solve |
Kth Largest Element in an Array Given an integer array nums and an integer k, return the kth largest element in the array. | Medium | Likely | arraydivide-and-conquersorting | Solve |
Monotone Increasing Digits An integer has monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y. | Medium | Likely | mathgreedy | Solve |
Fibonacci Number The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, startin... | Easy | Likely | mathdynamic-programmingrecursion | Solve |
Coin Change You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. | Medium | Likely | arraydynamic-programmingbreadth-first-search | Solve |
Sort Array by Increasing Frequency Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them... | Easy | Likely | arrayhash-tablesorting | Solve |
Maximum Depth of Binary Tree Given the root of a binary tree, return its maximum depth. | Easy | Likely | treedepth-first-searchbreadth-first-search | Solve |
Sqrt(x) Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well. | Easy | Likely | mathbinary-search | Solve |
Group Anagrams Given an array of strings strs, group the anagrams together. You can return the answer in any order. | Medium | Likely | arrayhash-tablestring | Solve |
Move Zeroes Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. | Easy | Likely | arraytwo-pointers | Solve |
LRU Cache Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. | Medium | Likely | hash-tablelinked-listdesign | Solve |
Linked List Cycle Given head, the head of a linked list, determine if the linked list has a cycle in it. | Easy | Likely | hash-tablelinked-listtwo-pointers | Solve |
Maximum Employees to Be Invited to a Meeting A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large circular table, capable of seating any nu... | Hard | Likely | arraydynamic-programmingdepth-first-search | Solve |
Word Break Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. | Medium | Likely | arrayhash-tablestring | Solve |
Binary Search Tree to Greater Sum Tree Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum o... | Medium | Likely | treedepth-first-searchbinary-search-tree | Solve |
Max Consecutive Ones III Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's. | Medium | Likely | arraybinary-searchsliding-window | Solve |
Valid Perfect Square Given a positive integer num, return true if num is a perfect square or false otherwise. | Easy | Likely | mathbinary-search | Solve |
Two Sum
SolveGiven an array of integers nums and an integer target, return the indices of the two numbers that add up to target.
Count the Number of Infection Sequences
SolveYou are given an integer n and an array sick sorted in increasing order, representing positions of infected people in a line of n people.
Container With Most Water
SolveYou are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
Maximum Students Taking Exam
SolveGiven a m n matrix seats that represent seats distributions in a classroom. If a seat is broken, it is denoted by '' character otherwise it is denoted by a '.'...
Maximum Path Quality of a Graph
SolveThere is an undirected graph with n nodes numbered from 0 to n - 1 (inclusive). You are given a 0-indexed integer array values where values[i] is the value of t...
Count Increasing Quadruplets
SolveGiven a 0-indexed integer array nums of size n containing all numbers from 1 to n, return the number of increasing quadruplets.
Longest Common Prefix
SolveWrite a function to find the longest common prefix string amongst an array of strings.
Valid Parentheses
SolveGiven a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
Number of Islands
SolveGiven an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.
Reverse Linked List
SolveGiven the head of a singly linked list, reverse the list, and return the reversed list.
Trapping Rain Water
SolveGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
Maximal Square
SolveGiven an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.
Valid Palindrome
SolveA phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forwa...
Maximum Subarray
SolveGiven an integer array nums, find the subarray with the largest sum, and return its sum.
Rotate String
SolveGiven two strings s and goal, return true if and only if s can become goal after some number of shifts on s.
Longest Consecutive Sequence
SolveGiven an unsorted array of integers nums, return the length of the longest consecutive elements sequence.
Remove Duplicates from Sorted Array
SolveGiven an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order o...
Best Time to Buy and Sell Stock
SolveYou are given an array prices where prices[i] is the price of a given stock on the ith day.
Daily Temperatures
SolveGiven an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait aft...
Maximum Number of Weeks for Which You Can Work
SolveThere are n projects numbered from 0 to n - 1. You are given an integer array milestones where each milestones[i] denotes the number of milestones the ith proje...
Longest Palindromic Substring
SolveGiven a string s, return the longest palindromic substring in s.
Kth Largest Element in an Array
SolveGiven an integer array nums and an integer k, return the kth largest element in the array.
Monotone Increasing Digits
SolveAn integer has monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y.
Fibonacci Number
SolveThe Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, startin...
Coin Change
SolveYou are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money.
Sort Array by Increasing Frequency
SolveGiven an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them...
Maximum Depth of Binary Tree
SolveGiven the root of a binary tree, return its maximum depth.
Sqrt(x)
SolveGiven a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well.
Group Anagrams
SolveGiven an array of strings strs, group the anagrams together. You can return the answer in any order.
Move Zeroes
SolveGiven an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements.
LRU Cache
SolveDesign a data structure that follows the constraints of a Least Recently Used (LRU) cache.
Linked List Cycle
SolveGiven head, the head of a linked list, determine if the linked list has a cycle in it.
Maximum Employees to Be Invited to a Meeting
SolveA company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large circular table, capable of seating any nu...
Word Break
SolveGiven a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.
Binary Search Tree to Greater Sum Tree
SolveGiven the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum o...
Max Consecutive Ones III
SolveGiven a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's.
Valid Perfect Square
SolveGiven a positive integer num, return true if num is a perfect square or false otherwise.
Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent SAP interviews.
Very Likely
75-100%
Likely
50-74%
Sometimes
25-49%
Rare
0-24%
SAP interviews focus heavily on array, dynamic-programming, two-pointers problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.
Beyond solving problems, practice explaining your approach. SAP interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.
Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.
SAP has been reported to ask 38 distinct coding problems. The most common topics are array, dynamic-programming, two-pointers. 15 are Easy difficulty, 17 are Medium, and 6 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.
Based on 38 reported problems, SAP interviews are in line with industry averages - 16% Hard vs 18% overall. 45% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.
Start with the highest-frequency problems listed on this page. Focus on the core topics: array, dynamic-programming, two-pointers. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.
Simulate a real SAP coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.
Simulate a SAP interview with AIarrow_forward