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

SDE - Intern

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

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Practice programming questions on daily basis.
Tip 2 : Do not jump into code directly. Brainstorm ideas and arrive at a soltuion.
Tip 3 : Learn OOPS along with real world scenarios and also DBMS, OS.

Application process
Where: Campus
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Keep it on a Page and Think like a employer when preparing resume.
Tip 2 : Your resume isn’t a list of everything you’ve ever done. Carefully curate the experiences that best capture your skills and problem-solving abilities. 
Tip 3 : Include projects and highlight your achievements

Interview rounds

01
Round
Medium
Face to Face
Duration60 minutes
Interview date16 Feb 2022
Coding problem2

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Longest Common Subsequence

Moderate
39m average time
0/80
Asked in companies
PayPalSliceShareChat

Given two strings, 'S' and 'T' with lengths 'M' and 'N', find the length of the 'Longest Common Subsequence'.

For a string 'str'(per se) of length K, the subsequences are the strings containing characters in the same relative order as they are present in 'str,' but not necessarily contiguous. Subsequences contain all the strings of length varying from 0 to K.

Example :
Subsequences of string "abc" are:  ""(empty string), a, b, c, ab, bc, ac, abc.
Problem approach

s1- It's a standard problem can be found at various sites on the internet.
s2- So, I applied the approach that I practised earlier for this question

Try solving now

2. Reverse List In K Groups

Hard
15m average time
85% success
0/120
Asked in companies
SAP LabsSamsungIBM

You are given a linked list of 'n' nodes and an integer 'k', where 'k' is less than or equal to 'n'.


Your task is to reverse the order of each group of 'k' consecutive nodes, if 'n' is not divisible by 'k', then the last group of nodes should remain unchanged.


For example, if the linked list is 1->2->3->4->5, and 'k' is 3, we have to reverse the first three elements, and leave the last two elements unchanged. Thus, the final linked list being 3->2->1->4->5.


Implement a function that performs this reversal, and returns the head of the modified linked list.


Example:
Input: 'list' = [1, 2, 3, 4], 'k' = 2

Output: 2 1 4 3

Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.


Note:
All the node values will be distinct.


Problem approach

s1- I applied linked list contains n number nodes.
s2- Reverse the given linked list of size k, k+1. 
s3- list is 1 2 3 4 5 and K = 3, then the answer would be 3 2 1 5 4.
s4- Linked list whose elements are separated by space and the linked list is terminated by -1.

Try solving now
02
Round
Medium
Face to Face
Duration30 minutes
Interview date6 Jul 2022
Coding problem2

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Top View of the Binary Tree

Easy
0/40
Asked in companies
Thought WorksWalmartSAP Labs

You have been given a Binary Tree of integers. You are supposed to return the top view of the given binary tree.

Top view of the binary tree is the set of nodes which are visible when we see the tree from the top.

For example:
For the given binary tree

Example

The top view of the tree will be {10, 4, 2, 1, 3, 6}.
Problem approach

s1- I simply used level order traversal and the concept of horizontal distance.
s2- Whenever we encountered the first node for a particular horizontal distance then we store that in the map and at last in the map we have tree top view. The interviewer asked me to write its code and I wrote a clean and commented code for it and he was satisfied with that.

Try solving now

2. Detect and Remove Loop

Moderate
10m average time
90% success
0/80
Asked in companies
IBMDelhiveryQualcomm

Given a singly linked list, you have to detect the loop and remove the loop from the linked list, if present. You have to make changes in the given linked list itself and return the updated linked list.

Expected Complexity: Try doing it in O(n) time complexity and O(1) space complexity. Here, n is the number of nodes in the linked list.

Problem approach

s1- Given a singly linked list, you have to detect the loop and remove the loop from the linked list, if present. s2- You have to make changes in the given linked list itself and return the updated linked list.
Expected Complexity: Try doing it in O(n) time complexity and O(1) space complexity. Here, n is the number of nodes in the linked list.

Try solving now
03
Round
Medium
Video Call
Duration60 min
Interview date7 Jul 2022
Coding problem2

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Number of Pairs with Given Sum

Moderate
39m average time
60% success
0/80
Asked in companies
Goldman SachsAmazonSamsung

You have been given an integer array/list(arr) and a number 'Sum'. Find and return the total number of pairs in the array/list which when added, results equal to the 'Sum'.

Note:
Given array/list can contain duplicate elements.

(arr[i],arr[j]) and (arr[j],arr[i]) are considered same.
Problem approach

s1- You have been given an integer array/list(arr) and a number 'Sum'.
s2- Find and return the total number of pairs in the array/list which when added, results equal to the 'Sum'.

Try solving now

2. Inplace rotate matrix 90 degree

Easy
12m average time
80% success
0/40
Asked in companies
OLX GroupSalesforceUrban Company (UrbanClap)

You are given a square matrix of non-negative integers of size 'N x N'. Your task is to rotate that array by 90 degrees in an anti-clockwise direction without using any extra space.

For example:

For given 2D array :

    [    [ 1,  2,  3 ],
         [ 4,  5,  6 ],
         [ 7,  8,  9 ]  ]

After 90 degree rotation in anti clockwise direction, it will become:

    [   [ 3,  6,  9 ],
        [ 2,  5,  8 ],
        [ 1,  4,  7 ]   ]
Problem approach

s1- You are given a square matrix of non-negative integers of size 'N x N'.
s2- Your task is to rotate that array by 90 degrees in an anti-clockwise direction without using any extra space.

Try solving now

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 - Intern
4 rounds | 11 problems
Interviewed by SAP Labs
1568 views
0 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by SAP Labs
2137 views
0 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 4 problems
Interviewed by SAP Labs
825 views
0 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 8 problems
Interviewed by SAP Labs
1901 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15605 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15499 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10216 views
2 comments
0 upvotes