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

SDE - 1

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

Interview preparation journey

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

Tip 1 : Be conceptually strong
Tip 2 : Practice good amount of questions
Tip 3 : Do good projects

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have some projects on your resume.
Tip 2 : Do not put false things on your resume and be confident.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration45 minutes
Interview date1 Mar 2020
Coding problem2

It consisted of 2 coding questions in 45 min. According to me, the first one was quite easy and the second was medium.
 

1. Segregate Odd-Even

Moderate
25m average time
75% success
0/80
Asked in companies
AdobeLivekeeping (An IndiaMART Company)Thought Works

There is a wedding ceremony at NinjaLand. The bride and groom want everybody to play a game and thus, they have blindfolded the attendees. The people from the bride’s side are holding odd numbers and people from the groom’s side are holding the even numbers. For the game to start quickly, all the bride’s side people should come first, followed by the groom’s side people in the same order.

The attendees of the wedding with their numbers are given in the form of a Singly Linked List, arranged randomly.

A singly linked list is a type of linked list that is unidirectional; that is, it can be traversed in only one direction from head to the last node (tail).

Example:
The attendees holding numbers from 1, 4, 3 are shown: 

As the organizers are busy, you have to arrange all the people by arranging the bride’s side people first followed by the groom’s side people sequentially.

Note:
For the above example 1 -> 4 -> 3, 1 -> 3 -> 4 is the only correct answer, i.e nodes should be grouped sequentially. Hence, 3 -> 1 -> 4 is the wrong answer as we have to preserve the same order.
Problem approach

1) Initialize two index variables left and right: 
left = 0, right = size -1 
2) Keep incrementing left index until we see an even number.
3) Keep decrementing right index until we see an odd number.
4) If left < right then swap arr[left] and arr[right]

Try solving now

2. Find power of a number

Easy
15m average time
80% success
0/40
Asked in companies
AmazonQuikrPayPal

Ninja is sitting in an examination hall. He is encountered with a problem statement, "Find ‘X’ to the power ‘N’ (i.e. ‘X’ ^ ‘N’). Where ‘X’ and ‘N’ are two integers."

Ninja was not prepared for this question at all, as this question was unexpected in the exam.

He is asking for your help to solve this problem. Help Ninja to find the answer to the problem.

Note :

For this question, you can assume that 0 raised to the power of 0 is 1.
Try solving now
02
Round
Easy
Face to Face
Duration50 minutes
Interview date1 Mar 2020
Coding problem3

1. Reverse Linked List

Moderate
15m average time
85% success
0/80
Asked in companies
WalmartHCL TechnologiesInfo Edge India (Naukri.com)

Given a singly linked list of integers. Your task is to return the head of the reversed linked list.

For example:
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Follow Up :
Can you solve this problem in O(N) time and O(1) space complexity?
Problem approach

Initialize three pointers prev as NULL, curr as head and next as NULL.
Iterate through the linked list. In loop, do following. 
// Before changing next of current, 
// store next node 
next = curr->next
// Now change next of current 
// This is where actual reversing happens 
curr->next = prev 
// Move prev and curr one step forward 
prev = curr 
curr = next

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

Reverse the first sub-list of size k. While reversing keep track of the next node and previous node. Let the pointer to the next node be next and pointer to the previous node be prev. 
head->next = reverse(next, k) ( Recursively call for rest of the list and link the two sub-lists )
Return prev ( prev becomes the new head of the list

Try solving now

3. Theory Questions

1. What is the difference between C and C++? Which one is better and why?
2. What are Encapsulation and abstraction?
3. What is runtime polymorphism? Explain with code. He wanted me to write the whole code and then explain it. After this, he directly jumped to DSA questions.

03
Round
Easy
HR Round
Duration25 minutes
Interview date2 Mar 2020
Coding problem1

This round was only for 25 min. This round was very relaxing. We had a very light discussion.

1. Basic HR Questions

1. Introduction
2. Why SAP? What do you know about SAP? Any SAP product name?
3. Where is SAP belongs?
4. Where do you see yourself in the next 2 years?
5. He asked about my Location preference.

Problem approach

Tip 1 : Have knowledge about the company you are applying to
Tip 2 : Be confident
 

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
2657 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
867 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 2 problems
Interviewed by SAP Labs
1753 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes