All company sheets
SAP Labs DSA interview questions
62 problems to practise before your SAP Labs online test or coding round. Most widely asked first.
62
Questions
16
Easy
39
Medium
7
Hard
Commonly reported. Problems candidates often report from this company’s coding rounds. These are Astra’s own tags, not an official question list.
62 questions
- 1
Find if Binary Tree Path Sum Equals Target
EasyRecursionTagged at 7 companies - 2
Find Smallest Letter Greater Than Target
EasyBinary SearchTagged at 7 companies - 3
Find the Floor and Ceiling of a Number in a Sorted Array
EasyBinary SearchTagged at 7 companies - 4
Find the First Bad Version in Product Releases
EasyBinary SearchTagged at 7 companies - 5
Find the K-th Row of Pascal's Triangle (O(k) Space)
EasyArrayTagged at 7 companies - 6
Jump Game
MediumGreedyTagged at 7 companies - 7
Find K Closest Elements
MediumArrayTagged at 7 companies - 8
Task Scheduler
MediumGreedyTagged at 7 companies - 9
Calculate Power of a Number (x^n)
MediumRecursionTagged at 7 companies - 10
Find All Palindrome Partitionings of a String
MediumRecursionTagged at 7 companies - 11
Count Number of Unique Binary Search Trees
MediumRecursionTagged at 7 companies - 12
Design a Time-Based Key-Value Store (TimeMap)
MediumBinary SearchTagged at 7 companies - 13
Find Smallest Divisor Given a Threshold
MediumBinary SearchTagged at 7 companies - 14
Rotate an Array to the Right by K Steps
MediumArrayTagged at 7 companies - 15
Find All Majority Elements II (More than n/3)
MediumArrayTagged at 7 companies - 16
Determine if a Sudoku Board is Valid
MediumArrayTagged at 7 companies - 17
Plagiarism Checker Snippet Match
MediumSliding WindowTagged at 7 companies - 18
Find Words That Can Be Formed by Characters
EasyStringTagged at 6 companies - 19
Remove All Adjacent Duplicates from a String
EasyStack and QueueTagged at 6 companies - 20
Count Number of Recent Calls in a Ping Counter
EasyStack and QueueTagged at 6 companies - 21
Generate Binary Numbers from 1 to N Using Queue
EasyStack and QueueTagged at 6 companies - 22
Remove All Linked List Elements with a Given Value
EasyLinkedListTagged at 6 companies - 23
Move the Last Element to the Front of the Linked List
EasyLinkedListTagged at 6 companies - 24
Find the Last Stone's Weight (Heap)
EasyTreeTagged at 6 companies - 25
Find the Diameter of a Binary Tree (Facebook/Google)
EasyTreeTagged at 6 companies - 26
Check if Two Binary Trees are the Same
EasyTreeTagged at 6 companies - 27
Find the Longest Common Prefix of Strings
EasyStringTagged at 6 companies - 28
Determine if a String Has Valid Parentheses
EasyStringTagged at 6 companies - 29
Kth Smallest Element in a BST
MediumTreeTagged at 6 companies - 30
Maximal Square
MediumDPTagged at 6 companies - 31
Determine if All Rooms Can Be Visited Using Keys
MediumStack and QueueTagged at 6 companies - 32
Find the Maximum Width Ramp in an Array
MediumStack and QueueTagged at 6 companies - 33
Design a Hit Counter for Recent Hits
MediumStack and QueueTagged at 6 companies - 34
Reverse a Linked List Sub-list (from m to n)
MediumLinkedListTagged at 6 companies - 35
Split a Linked List in k Consecutive Parts
MediumLinkedListTagged at 6 companies - 36
Swap Two Nodes in a Linked List (by value or pointers)
MediumLinkedListTagged at 6 companies - 37
Find the Nth Node from the End (Recursive)
MediumLinkedListTagged at 6 companies - 38
Implement a Binary Heap (Min-Heap) - Insert
MediumTreeTagged at 6 companies - 39
Count All Nodes in a Complete Binary Tree (O(log n * log n))
MediumTreeTagged at 6 companies - 40
Find Longest Substring Without Repeating Characters
MediumStringTagged at 6 companies - 41
Count All Palindromic Substrings in a String
MediumStringTagged at 6 companies - 42
Implement the 'Count and Say' Sequence
MediumStringTagged at 6 companies - 43
Find All Repeated DNA Sequences in a String
MediumStringTagged at 6 companies - 44
Find the Longest Substring with No Repeating Characters
MediumStringTagged at 6 companies - 45
Google Docs Spell Checker
MediumDynamic ProgrammingTagged at 6 companies - 46
Web Crawler URL Parser
MediumDynamic ProgrammingTagged at 6 companies - 47
Find the First Missing Positive Integer
HardArrayTagged at 6 companies - 48
Find the Maximum Profit in Job Scheduling (DP + Binary Search)
HardArrayTagged at 6 companies - 49
Course Schedule
MediumGraphTagged at 5 companies - 50
Design a Leaderboard
MediumDesignTagged at 5 companies - 51
Degree of Each Vertex
MediumGraphTagged at 5 companies - 52
Connected Components Count
MediumGraphTagged at 5 companies - 53
Detect Cycle in Directed Graph
MediumGraphTagged at 5 companies - 54
Find Eventual Safe States
MediumGraphTagged at 5 companies - 55
Cheapest Flights Within K Stops
MediumGraphTagged at 5 companies - 56
Check if Graph is Bipartite using DFS
MediumGraphTagged at 5 companies - 57
LinkedIn Connection Suggestion
MediumGraphTagged at 5 companies - 58
Find the Length of the Longest Valid Parentheses
HardStack and QueueTagged at 5 companies - 59
Count Number of Visible People in a Queue
HardStack and QueueTagged at 5 companies - 60
Instagram Feed Aggregator
HardLinked ListTagged at 5 companies - 61
Scramble String
HardDPTagged at 4 companies - 62
Word Break II
HardDPTagged at 4 companies