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

SDE - 1

SAP Labs
upvote
share-icon
3 rounds | 11 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
Medium
Video Call
Duration60 minutes
Interview date8 Jun 2015
Coding problem5

This was a 60 minute technical round where the interviewer asked programming based questions and questions on DBMS concepts.

1. Maximum Of All Subarrays Of Size k.

Moderate
20m average time
80% success
0/80
Asked in companies
AmazonOracleSAP Labs

You are given an array consisting of N non-negative integers, and an integer K denoting the length of a subarray, your task is to determine the maximum elements for each subarray of size K.

Note:
A subarray is a contiguous subset of an array.

The array may contain duplicate elements.

The given array follows 0-based indexing.

It is guaranteed that there exists at least one subarray of size K.
Problem approach

The problem can be solved using the concept of sliding window. 
We scan the array from 0 to n-1, and maintain a deque to keep "promising" elements. 
At each i, we keep "promising" elements, which are potentially max number in window [i-(k-1),i] or any subsequent window. This means: 
1. If an element in the deque and it is out of i-(k-1), we discard them. We just need to remove from the head, as we are using a deque and elements are ordered as the sequence in the array
2. Now only those elements within [i-(k-1),i] are in the deque. We then discard elements smaller than a[i] from the tail. This is because if a[x] 3.As a result, elements in the deque are ordered in both sequence in array and their value. At each step the head of the deque is the max element in [i-(k-1),i]
The algorithm is amortized O(n) as each element is pushed and removed once.

Try solving now

2. DBMS Question

Explain ACID Properties.

Problem approach

ACID is a set of properties of database transactions intended to guarantee validity even in the event of errors, power failures, etc.
ACID stands for : 
1. Atomicity : All statements of a transaction must succeed completely, or fail completely in each and every situation, including power failures, errors and crashes. Example - Debiting and crediting in a money transfer transaction, both must happen either together or not at all.
2. Consistency : The database must remain in a consistent state after any transaction. Data in the database should not have any changes other than intended after the transaction completion.
3. Isolation : Isolation ensures that concurrent execution of transactions leaves the database in the same state that would have been obtained if the transactions were executed sequentially.
4. Durability :Durability guarantees that once a transaction has been committed, it will remain committed even in the case of a system failure which actually means recording the completed transactions (or their effects) in non-volatile memory.

3. DBMS Question

Write ahead logging in DBMS

Problem approach

Write-Ahead Logging (WAL) simply means that SQL Server needs to write the log records associated with a particular modification before it writes the page to the disk. This process ensures that no modifications to a database page will be flushed to disk until the associated transaction log records with that modification are written to disk firs to maintain the ACID properties of a transaction.

4. DBMS Question

What are deadlock avoidance schemes?

Problem approach

To avoid deadlocks, prior knowledge about the usage of resources by processes including resources available, resources allocated, future requests and future releases by processes can be used. Most deadlock avoidance algorithms need every process to tell in advance the maximum number of resources of each type that it may need. Based on all this info we may decide if a process should wait for a resource or not, and thus avoid chances for a circular wait. Deadlock avoidance can mainly be done with the help of Banker's Algorithm.
The bankers algorithm is used to avoid deadlock and allocate resources safely to each process in the computer system. The 'S-State' examines all possible tests or activities before deciding whether allocation should be allowed to each process. It also helps the operating system to successfully share resources between all the processes. The banker's algorithm is named because it checks whether a person should be sanctioned a loan amount or not to help the bank system safely simulate allocation resources.

5. DBMS Question

What is a clustered index ?

Problem approach

A clustered index defines the order in which data is stored in the table which can be sorted in only one way. It is a type of index which sorts the data rows in the table on their key values. So, there can be an only a single clustered index for every table. In an RDBMS, usually, the primary key allows you to create a clustered index based on that specific column.

02
Round
Easy
Video Call
Duration60 minutes
Interview date8 Jun 2015
Coding problem5

This was a 60 minute technical round where the interviewer asked data structure based questions, questions on OOPS and OS concepts.

1. Debugging Question

There is a program which inserts and deletes node in a sorted singly linked list. There is a bug in one of the modules, how would you debug it?

Problem approach

Tip 1 : Check each function separately for its correct functioning. 
Tip 2 : After identifying the wrong function, add debugging statements to identify which part of the function is wrong.

2. OOPS Question

What is a virtual function in C++?

Problem approach

Virtual functions are member functions in the base class that have been redefined in derived classes. The virtual keyword is used to declare them. It instructs the compiler to perform dynamic linking or late binding on the function. In function declarations, a 'virtual' keyword precedes the normal declaration. C++ determines which virtual function is to be invoked based on the class of the object pointed by the class pointer when the function is made virtual.

3. OOPS Question

Explain malloc() and free() operations

Problem approach

malloc() : It stands for memory allocation. The malloc() function reserves a block of memory of the specified number of bytes. And, it returns a pointer of void which can be casted into pointers of any form.
free() : Dynamically allocated memory created with either calloc() or malloc() doesn't get freed on their own. You must explicitly use free() to release the space.

4. OOPS Question

What is structure padding?

Problem approach

While memory allocation, one or more empty bytes are inserted (or left empty) between memory addresses which are allocated for other structure members. This is known as structure padding. A computer processor is designed in such a way that it can read one word from memory at a time. Because of this processor advantage, data is always aligned as a 4 byte package, which results in inserting empty addresses between other members' addresses. Because of this padding concept in C, the size of the structure is never as we think.

5. Technical Question

A pair of redundant systems are operating, how would you ensure that when one of them goes down, the other one will take over its operation ?

Problem approach

Tip 1 : Explain fault tolerant systems, 
Tip 2 : Describe the components of fault tolerant systems.

03
Round
Easy
HR Round
Duration30 minutes
Interview date8 Jun 2015
Coding problem1

HR based round that lasted for 30 minutes. The interviewer asked question to know more about me.

1. Basic HR Questions

1. Explain your project in detail especially your contribution.
2. What is your negative point that you want to improve?
3. Would you like to change your domain, if yes why ?
4. Tell me an experience of yours in that you didn’t like to do and how you handled it ?
5. What are you expecting from the company ?
6. Are you comfortable shifting base ?

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
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