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

Data Cloud (IT) Role

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

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Machine Learning, Cloud Computing, DBMS, OOPS
Tip
Tip

Tip 1 : Work on machine learning concepts, 
Tip 2 : Must do Previously asked Interview as well as Online Test Questions.
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
Duration90 minutes
Interview date14 Jan 2016
Coding problem2

The level of test was really good and if you don't maintain speed , you won't even come to know when the timer of each question will finish off
Tips: 

1) Maintain speed + accuracy
2) work on Machine learning concepts
3) There was a timer associated with every question, so make sure you take care of it

1. Right View

Moderate
35m average time
65% success
0/80
Asked in companies
AmazonAdobeUber

You have been given a Binary Tree of integers.

Your task is to print the Right view of it.

The right view of a Binary Tree is a set of nodes visible when the tree is viewed from the Right side and the nodes are printed from top to bottom order.

Problem approach

BFS can be used to solve this question.
Steps :
1. Traverse the whole tree in level order fashion using BFS along with storing the last processed node (curr).
2. Keep a tag at the end of each level to know that a particular level has ended.
3. Whenever a level ends store the last processed node value to the resultant list.
Time Complexity : O(n) [ Since, each node is traversed exactly once ]
Space Complexity : O(w) [ 'w' is the maximum width of the tree ]

Try solving now

2. Duplicate In Array

Easy
15m average time
85% success
0/40
Asked in companies
HSBCMicrosoftDelhivery

You are given an array ‘ARR’ of size ‘N’ containing each number between 1 and ‘N’ - 1 at least once. There is a single integer value that is present in the array twice. Your task is to find the duplicate integer value present in the array.

For example:

Consider ARR = [1, 2, 3, 4, 4], the duplicate integer value present in the array is 4. Hence, the answer is 4 in this case.
Note :
A duplicate number is always present in the given array.
Problem approach

Concept of indexing can be used to solve this question.
Traverse the array. For every element at index i,visit a[i]. If a[i] is positive, then change it to negative. If a[i] is negative, it means the element has already been visited and thus it is repeated. Print that element.
Pseudocode :
findRepeating(arr[], n)
{
missingElement = 0

for (i = 0; i < n; i++){
element = arr[abs(arr[i])]

if(element < 0){
missingElement = arr[i]
break
}

arr[abs(arr[i])] = -arr[abs(arr[i])]
}

return abs(missingElement)

}

Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date18 Jan 2016
Coding problem4

Tips :
1) Just keep calm and ask for clarifications
2) keep the discussion interesting
3) Try to answer questions based on your experience of internship and use industry terms (plus points)
Technical Interview where questions were based on concept of machine learning, database and datastructures.

1. DBMS Question

Internal Implementation of tables

Problem approach

A hash table is the simplest index structure that a database can implement. The major components of a hash index is the "hash function" and the "buckets". Effectively the DBMS constructs an index for every table you create that has a primary key attribute, like:
CREATE TABLE test (
id INTEGER PRIMARY KEY
,name varchar(100)
);
In table test, if we have decided to store 4 rows then the algorithm splits the places which the rows are to be stored into areas. These areas are called buckets. If a row's primary key matches the requirements to be stored in that bucket, then that is where it will be stored. The algorithm to decide which bucket to use is called the hash function.
In DBMS systems we can usually ask for a hash index for a table, and also say how many buckets we thing we will need.
B and B+ trees are also currently used for providing indexes.

2. DBMS Question

Compare MongoDB vs PostgreSQL.

Problem approach

1. MongoDB has the potential for ACID (atomicity, consistency, isolation, durability) compliance, while Postgres has ACID compliance built-in.
2. MongoDB uses collections for the same purpose that Postgres uses tables. These collections include options for setting validation rules and setting maximum sizes. Postgres describes tables in a very specific language and structures the data in such a way that the database or an ETL tool can process it. 
3. Another example of the difference in terminology and syntax between the two is that MongoDB uses documents to obtain data while Postgres uses rows for the same purpose. 
4. While MongoDB does not support FOREIGN KEY constraints, PostgreSQL does. 
5. MongoDB aggregation pipelines are made up of multiple stages to transform data. Postgres uses GROUP_BY to run queries while MongoDB uses the aggregation pipeline.

3. Build Heap

Moderate
30m average time
70% success
0/80
Asked in companies
SAP LabsSamsungOYO

You are given an integer array with N elements. Your task is to build a max binary heap from the array.

A max-heap is a complete binary tree in which the value of each internal node is greater than or equal to the values of the children of that node.

Note :
You do not need to print anything, just return the vector representation of the heap such that the input array follows 0 - based indexing and :

The left child of the ith node is at (2 * i + 1)th index.

The right child of the ith node is at (2 * i + 2)th index.

Parent of the node present at ith index is at (i - 1) / 2 indexes.
Problem approach

A Binary Heap is a Binary Tree with following properties.
1) It’s a complete tree (All levels are completely filled except possibly the last level and the last level has all keys as left as possible). 
2) A Binary Heap is either Min Heap or Max Heap. In a Min Binary Heap, the key at root must be minimum among all keys present in Binary Heap. The same property must be recursively true for all nodes in Binary Tree. Max Heap is similar to MinHeap.

Representation of Min Heap :
So basically Min Heap is a complete binary tree. A Min heap is typically represented as an array. The root element will be at Arr[0]. For any ith node, i.e., Arr[i] : 
Arr[(i -1) / 2] returns its parent node.
Arr[(2 * i) + 1] returns its left child node.
Arr[(2 * i) + 2] returns its right child node.

Operations on Heap :
1. Insertion
Add the node to the bottom of the tree.
Look at the parent node. If the parent is greater than the node, swap them.
Continue comparing and swapping to allow the node to move upwards until it finds a parent node that is smaller than it.

insert(int element) {
Heap[++size] = element; 
int current = size;
heapify(current);
}

2. Deletion
Take the bottom level’s right most node and move it to top, replacing the deleted node.
Compare the new root to its children. If it is larger than either child, swap the item with the smaller of the two children.
Continue comparing and swapping, move downward the node until it is smaller than both of its children.
extractMin() {
int min = Heap[0];
Heap[0] = Heap[size--];
heapify(0);
return min;
}

Try solving now

4. Technical Question

Implementation of CLOB and BLOB

03
Round
Easy
HR Round
Duration45 minutes
Interview date18 Jan 2016
Coding problem1

This was a Technical + HR Interview. The interviewer wanted to know more about me and asked general dsa questions too mainly focusing on heap. 
Tips: 

1) Keep calm and don't get too emotional because next question may be technical.
2) Make sure you reflect a good image in front of HR.
3) Try to draw your personal experiences from your life and specially internship

1. Basic HR Questions

1. Questions on my projects
2. Tell us about yourself
3. Craziest thing you have done
4. Negative points about your internship
5. Strengths and Weaknesses
6. Where do you see yourself in 10 years?
7. A lot of Questions on projects of internship (properly grilled)

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 : 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
4 rounds | 6 problems
Interviewed by SAP Labs
1075 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
SDE - 1
3 rounds | 5 problems
Interviewed by SAP Labs
0 views
0 comments
0 upvotes
company logo
Scholar
4 rounds | 12 problems
Interviewed by SAP Labs
1321 views
0 comments
0 upvotes