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

Software Developer

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

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS
Tip
Tip

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

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

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 minutes
Interview date20 Dec 2016
Coding problem2

The test had a time limit. Every 10 minutes you had to do at least 4 questions. It was quite fast paced. The questions were from basic coding, aptitude and debugging.
Tips: Learn to be fast at coding. Practice a lot of aptitude questions. Have a decent knowledge of basic coding.

1. Reverse Linked List

Easy
15m average time
85% success
0/40
Asked in companies
Citi BankDelhiverySprinklr
Note :
You do not need to print anything, just return the head of the reversed linked list. 
Problem approach

This can be solved both: recursively and iteratively. 
The recursive approach is more intuitive. First reverse all the nodes after head. Then we need to set head to be the final node in the reversed list. We simply set its next node in the original list (head -> next) to point to it and sets its next to NULL. The recursive approach has a O(N) time complexity and auxiliary space complexity.

For solving the question is constant auxiliary space, iterative approach can be used. We maintain 3 pointers, current, next and previous, abbreviated as cur, n and prev respectively. All the events occur in a chain.
1. Assign prev=NULL, cur=head .
2. Next, repeat the below steps until no node is left to reverse:
1. Initialize n to be the node after cur. i.e(n=cur->next)
2. Then make cur->next point to prev (next node pointer).
3. Then make prev now point to the cur node.
4. At last move cur also one node ahead to n.
The prev pointer will be the last non null node and hence the answer.

Try solving now

2. Longest Substring Without Repeating Characters

Moderate
20m average time
80% success
0/80
Asked in companies
AmazonInfo Edge India (Naukri.com)Oracle

Given a string 'S' of length 'L', return the length of the longest substring without repeating characters.

Example:

Suppose given input is "abacb", then the length of the longest substring without repeating characters will be 3 ("acb").
Problem approach

The basic idea is, keep a hash map which stores the characters in string as keys and their positions as values, and keep two pointers which define the max substring. move the right pointer to scan through the string , and meanwhile update the hash map. If the character is already in the hash map, then move the left pointer to the right of the same character last found. Note that the two pointers can only move forward. 
The time and space complexity for this solution will be O(n).

Try solving now
02
Round
Easy
Face to Face
Duration60 minutes
Interview date22 Dec 2016
Coding problem3

The interviewer started off by asking basic sorting questions. Followed by data structures and algorithms. And DBMS related questions in the end.
Tips: Have a good presence of mind. Understand the question asked properly. Be confident and keep discussing. Don't get nervous and solve the questions incorrectly. Have good grip over topics like sorting, DS, Algorithms and DBMS.

1. LCA Of Binary Tree

Moderate
10m average time
90% success
0/80
Asked in companies
GrabDisney + HotstarShareChat

You have been given a Binary Tree of distinct integers and two nodes ‘X’ and ‘Y’. You are supposed to return the LCA (Lowest Common Ancestor) of ‘X’ and ‘Y’.


The LCA of ‘X’ and ‘Y’ in the binary tree is the shared ancestor of ‘X’ and ‘Y’ that is located farthest from the root.


Note :
You may assume that given ‘X’ and ‘Y’ definitely exist in the given binary tree.
For example :
For the given binary tree

Example

LCA of ‘X’ and ‘Y’ is highlighted in yellow colour.
Problem approach

The recursive approach is to traverse the tree in a depth-first manner. The moment you encounter either of the nodes node1 or node2, return the node. The least common ancestor would then be the node for which both the subtree recursions return a non-NULL node. It can also be the node which itself is one of node1 or node2 and for which one of the subtree recursions returns that particular node.
Pseudo code :
LowestCommonAncestor(root, node1, node2) {
if(not root)
return NULL
if (root == node1 or root == node2) 
return root
left = LowestCommonAncestor(root.left, node1, node2)
right = LowestCommonAncestor(root.right, node1, node2)
if(not left)
return right
else if(not right)
return left
else
return root
}

Try solving now

2. Next Permutation

Moderate
15m average time
85% success
0/80
Asked in companies
UberAdobeCultfit

You have been given a permutation of ‘N’ integers. A sequence of ‘N’ integers is called a permutation if it contains all integers from 1 to ‘N’ exactly once. Your task is to rearrange the numbers and generate the lexicographically next greater permutation.

To determine which of the two permutations is lexicographically smaller, we compare their first elements of both permutations. If they are equal — compare the second, and so on. If we have two permutations X and Y, then X is lexicographically smaller if X[i] < Y[i], where ‘i’ is the first index in which the permutations X and Y differ.

For example, [2, 1, 3, 4] is lexicographically smaller than [2, 1, 4, 3].

Problem approach

The solution can be built using the concept of counting sort.
1. Maintain the count of the frequency of each digit in the number. 
2. If the number is non-negative :
2. 1 Place the smallest digit (except 0) at the left most of the required number and decrement the frequency of that digit by 1.
2 .2 Place all remaining digits in ascending order from left to right.
3. Else if it is a negative number then:
3.1 Place the largest digit at the left most of the required number. and decrement the frequency of that digit by 1.
3.2 Place all remaining digits in descending order from right to left.

Try solving now

3. DBMS Question

Discuss a DBMS consisting of college faculty, professors, courses and students.

03
Round
Easy
Face to Face
Duration60 minutes
Interview date22 Dec 2016
Coding problem0

This was a managerial interview. There was a discussion upon the company's work in fields like Big Data, IoT. They asked me in detail about the projects mentioned in my CV. Other skills mentioned in CV were also discussed.
 

04
Round
Easy
HR Round
Duration30 minutes
Interview date23 Dec 2016
Coding problem1

The round was based around my over all personality. They checked how would I be an asset to their company. They analyzed my core values and capabilities of working in a team.
Tips: Show that you are willing to work in a team. Be confident and polite. Express your feelings and passion towards your job and the company. Explain your college extra curricular activities well.

1. Basic HR Questions

Q1. What extra curricular activities did you do in college?
Q2. Do you seek for help if stuck in a problem?
Q3. What do you understand by teamwork?
Q4 How do you tackle something that you can't find a solution to?
Q5. Where do you want to see yourself after 5 years?

Problem approach

Tip 1 : Be sure to do your homework on the organization and its culture before the interview.
Tip 2 : Employers want to understand how you use your time and energy to stay productive and efficient. Be sure to emphasize that you adhere to deadlines and take them seriously.
Tip 3 : Interviewers like to hear stories about candidates. Make sure your story has a great beginning, a riveting middle, and an end that makes the interviewer root for you to win the job. Talk about a relevant incident that made you keen on the profession you are pursuing and follow up by discussing your education.

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
Software Developer
3 rounds | 8 problems
Interviewed by SAP Labs
1119 views
0 comments
0 upvotes
company logo
Software Developer
6 rounds | 12 problems
Interviewed by SAP Labs
2912 views
0 comments
0 upvotes
company logo
Software Developer
4 rounds | 11 problems
Interviewed by SAP Labs
851 views
0 comments
0 upvotes
company logo
Software Developer
5 rounds | 6 problems
Interviewed by SAP Labs
802 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Software Developer
5 rounds | 14 problems
Interviewed by Microsoft
4029 views
1 comments
0 upvotes
company logo
Software Developer
3 rounds | 3 problems
Interviewed by Amazon
1271 views
0 comments
0 upvotes
company logo
Software Developer
4 rounds | 5 problems
Interviewed by Intuit
905 views
0 comments
0 upvotes