SAP Labs interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

SAP Labs
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1.5 Months
Topics: Data Structures ,Algorithms ,Computer Networks ,OOPS ,DBMS
Tip
Tip

Tip 1 : Prepare DSA well , as problem solving is the most required skill nowadays to get into a product based organization.
Tip 2 : Prepare for DBMS , as there will definitely be DBMS questions being thrown at you. 
Tip 3 : Study a bit about the company , as they have a certain level of monopoly in the ERP market & have a vast product line-up.

Application process
Where: Campus
Eligibility: 7.1 CGPA , 70% in 10th / 12th
Resume Tip
Resume tip

Tip 1 : First & foremost , make your resume crisp & clear , highlight the tech stack used in projects. Make sure to outline the achievements , so that you can create an edge in the mindset of the interviewer.
Tip 2 : Add links for different coding platforms , so that if the interviewer decides to look into your profile , you can get it ready immediately. Also , don't forget to add GitHub code repository links & live production links for your projects. Seeing the project live would definitely impress the interviewer.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 Minutes
Interview date11 Dec 2021
Coding problem1

The test was in the morning & since it was a campus recruitment process , the link was shared by the TPO of college.
The test was to be taken from home & it had easy MCQs based upon CS fundamentals & some also on DSA.

1. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
QualcommUberAmazon

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Problem approach

Firstly , I directly used two nested loops to calculate the sum of each subarray that can be made & kept a variable to store the maximum sum found , initialized it with 0. If the current sum found was larger than previously stored sum , then update , else keep on calculating for the next element.
However , this gave TLE on some cases as it costed time complexity to be O(n2) .

Then , I used the traditional & very famous Kadane's Algorithm & thus solved the problem.

Try solving now
02
Round
Medium
Video Call
Duration60 Minutes
Interview date16 Dec 2021
Coding problem3

This round was mainly based on DSA , OOPS & some other CS fundamentals ( which were eventually not asked to me ) .
This was around 12 PM or something , it was also remote ( from home ) & the interviewer was seemingly nice & pretty straightforward.

1. Insert Into A Binary Search Tree

Easy
20m average time
80% success
0/40
Asked in companies
AdobeSAP LabsCIS - Cyber Infrastructure

You have been given a root node of the binary search tree and a positive integer value. You need to perform an insertion operation i.e. inserting a new node with the given value in the given binary search tree such that the resultant tree is also a binary search tree.


If there can be more than one possible tree, then you can return any.


Note :

A binary search tree is a binary tree data structure, with the following properties :

    a. The left subtree of any node contains nodes with a value less than the node’s value.

    b. The right subtree of any node contains nodes with a value equal to or greater than the node’s value.

    c. Right, and left subtrees are also binary search trees.
It is guaranteed that,

    d. All nodes in the given tree are distinct positive integers.

    e. The given BST does not contain any node with a given integer value.

Example, below the tree, is a binary search tree.

1

Below the tree is not a BST as node ‘2’ is less than node ‘3’ but ‘2’ is the right child of ‘3’, and node ‘6’ is greater than node ‘5’ but it is in the left subtree of node ‘5’.

1

Problem approach

The problem is pretty straightforward & famous and mostly people have read about it somewhere.
We need to find a position , such that all the nodes in the left subtree must be less than this new node & all the nodes in the right subtree must be greater than this new node.
So what we can do is find the right position for the new node. Start traversing the tree from root , if the current node's value is less than the new node's value , then the new node will definitely be present in the right subtree of current node , thus current node = current node -> right. Else if the current node's value is greater than the new node's value , make the transition as current node = current node->left. 
Keep on doing this traversal till we find a dead end i.e. if we want to move left & current node's left is NULL , then that is the place we want to stop , and insert the new node as current node -> left=new node & break. 
Similarly , if we want to move right & current node -> right is NULL , then that is the position we want to insert our new node at , make current node -> right = new node & break.

Try solving now

2. Find Number Of Islands

Moderate
34m average time
60% success
0/80
Asked in companies
WalmartShareChatAmazon

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 to another cell, if one cell lies immediately next to the other cell, in any of the eight directions (two vertical, two horizontal, and four diagonals).

A group of connected cells having value 1 is called an island. Your task is to find the number of such islands present in the matrix.

Problem approach

This problem can be solved using Depth-First-Search ( DFS ). Initialize a variable numberOfIslands with 0 , start traversing the grid , as soon as you encounter a 1 , call DFS for that coordinate & increase the island count by 1 i.e. increment the numberOfIslands variable. As this DFS call would visit all the connected 1s & count them as one island. In the DFS() function , first of all , mark this particular coordinate as visited either by using a visited array but that would consume O(n) extra space where n is number of elements is the grid , I asked the interviewer if we can amend the values of the grid , to which he agreed & thus whichever coordinate ( i , j ) I visited , I made grid[i][j]=2 as this would mark an already visited cell. Then I called DFS for the surrounding 4 directions ( Up , down , top , bottom ) recursively to mark all the connected 1s as 2s as they all are contributing to one single island.

The base condition for recursion would be that either if the i, j cell is already visited or i or j is out of bounds , in that case , return back to the calling function.

Similarly , I did for the entire grid & in the end returned the numberOfIslands variable.

Try solving now

3. DBMS Question

Some basic SQL queries using LIKE operator and GROUP BY 
Also , some theoretical questions based on Joins.

Problem approach

Tip 1: Go through the SQL queries well.
Tip 2: Understand the concept of Joins & Data Normalization.

03
Round
Easy
HR Round
Duration20 Minutes
Interview date16 Dec 2021
Coding problem1

This round was scheduled right after the DSA round ( if cleared ) & was shorter if compared to the previous rounds.

1. Basic HR questions

The questions asked were pretty common , like Introduce yourself , What's your favorite pass-time , What's your approach towards learning & support the same with an example , How much are you comfortable with the office location & compensation , Have you received any other offers ?

Problem approach

Tip 1 : Read some HR interview experiences on GFG 
Tip 2 : Go through some YouTube videos for reference
Tip 3 : Make sure to be clear & confident while answering. Your body language should show that you're confident about your response.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 3 problems
Interviewed by SAP Labs
2656 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by SAP Labs
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by SAP Labs
866 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 2 problems
Interviewed by SAP Labs
1752 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115096 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58237 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35146 views
7 comments
0 upvotes