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

Software Developer

SAP Labs
upvote
share-icon
3 rounds | 8 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
Duration95 minutes
Interview date6 May 2015
Coding problem0

Test was conducted online and it contained objective questions (MCQs).

02
Round
Easy
Video Call
Duration60 minutes
Interview date6 May 2015
Coding problem5

This was a 60 minute technical round involving questions based on data structures, OOPS concepts, DBMS and projects that I had mentioned in my resume.

1. Nth Fibonacci Number

Easy
0/40
Asked in companies
SAP LabsHCL TechnologiesWalmart

The n-th term of Fibonacci series F(n), where F(n) is a function, is calculated using the following formula -

    F(n) = F(n - 1) + F(n - 2), 
    Where, F(1) = 1, F(2) = 1


Provided 'n' you have to find out the n-th Fibonacci Number. Handle edges cases like when 'n' = 1 or 'n' = 2 by using conditionals like if else and return what's expected.

"Indexing is start from 1"


Example :
Input: 6

Output: 8

Explanation: The number is ‘6’ so we have to find the “6th” Fibonacci number.
So by using the given formula of the Fibonacci series, we get the series:    
[ 1, 1, 2, 3, 5, 8, 13, 21]
So the “6th” element is “8” hence we get the output.
Problem approach

The recursive approach involves direct implementation of mathematical recurrence formula. 
F(n) = F(n-1)+F(n-2)
Pseudocode :
fibonacci(n):
if(n<=1)
return n;
return fibonacci(n-1) + fibonacci(n-2)

This is an exponential approach. 
It can be optimized using dynamic programming. Maintain an array that stores all the calculated fibonacci numbers so far and return the nth fibonacci number at last. This approach will take O(n) time complexity and O(n) auxiliary space.

Try solving now

2. OOPS Question

Program demonstrating operator overloading

Problem approach

To overload an operator, we use a special operator function. We define the function inside the class or structure whose objects/variables we want the overloaded operator to work with.

Program overloading << operator :

#include
#include
class Time
{
int hr, min, sec;
public:
// default constructor
Time()
{
hr=0, min=0; sec=0;
}

// overloaded constructor
Time(int h, int m, int s)
{
hr=h, min=m; sec=s;
}

// overloading '<<' operator
friend ostream& operator << (ostream &out, Time &tm); 
};

// define the overloaded function
ostream& operator << (ostream &out, Time &tm)
{
out << "Time is: " << tm.hr << " hour : " << tm.min << " min : " << tm.sec << " sec";
return out;
}

int main()
{
Time tm(3,15,45);
cout << tm;
return 0;
}

3. OOPS Question

What is Function Overloading?

Problem approach

Two or more functions can have the same name but different parameters; such functions are called function overloading. In OOP, function overloading is known as a function of polymorphism. The function can perform various operations best on the argument list. It differs by type or number of arguments they hold. By using a different number of arguments or different types of arguments, the function can be redefined.

4. OOPS Question

Differences between C and C++

Problem approach

1. The C programming language is a procedural language type while C++ is an object-oriented programming language type.
2. C programming follows a top to down programming approach that focuses on the steps rather than the data. C++ follows a bottom-to-top approach that focuses on data rather than the overall procedure.
3. Since C is a structured programming language the program is divided into separate blocks known as functions. Since C++ is an object-oriented programming language, the code is divided into Objects and Classes.

5. Technical Questions

1. How do you think Gmail works?
2. Give me a step by step procedure of how will you download an attachment from an email.

03
Round
Easy
HR Round
Duration45 minutes
Interview date6 May 2015
Coding problem3

HR round that lasted for 45 minutes. Did brainstorming on puzzles and HR asked questions to know more about me.
Tips : During HR, think before you speak, they can catch any word that you speak. Prepare well for aptitude, as they shortlist less people after the test. Ask good questions during the end of the interviews. It might impress them. So prepare for it before going for the interview. Lastly, don’t be nervous, HRs are only trying to make you nervous during the interview as a part of the stress test.

1. Puzzle

You are given 3 boxes containing apples, oranges and apples oranges mixed. All boxes are labeled incorrectly. You can open only 1 box. Find out which box will you open to correctly identify the boxes.

Problem approach

Let the 3 boxes be labelled as:
“Apples and Oranges”
“Apples only”
“Oranges only”
Choose the box having label “Apples and Oranges”.
Now as each box is incorrectly labelled therefore this box should be an “Apples only” box or “Oranges only” box. So now the fruit which is taken out will decide the name of the box. Suppose an orange comes out then this box will be an “Orange only” box.
Now again as each box was incorrectly labelled, the box which was originally labelled as “Apples only” box will get labelled as “Apples and Oranges” and the remaining gets labelled as “Apples only” box.

2. Puzzle

How to Measure 45 minutes using two identical wires?

Problem approach

1. Light the first stick from both the sides and 2nd stick from one side.
2. 1st stick will finish in 30 min. while 2nd stick will be burnt half way.
3. Now light 2nd stick from both the sides. It will finish in next 15 min.
So we have calculated 45 minutes in all.

3. Basic HR Questions

1. Tell me about yourself.
2. Why SAP?
3.What are your Strengths?
4.What are your weaknesses? How would you overcome it?
5.Why should we hire you?
6. Where do you want to see yourself in 5 years from now?
7. What do you mean by innovation? (Lasted really long, but he pushed me to get towards the answer. Around 15mins.)
8. You have written outstanding communication skills. How would you prove it?
9. A customer is really angry upon you for a product which you sold him. How would you convince the customer?

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
6 rounds | 12 problems
Interviewed by SAP Labs
2911 views
0 comments
0 upvotes
company logo
Software Developer
4 rounds | 11 problems
Interviewed by SAP Labs
850 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
1270 views
0 comments
0 upvotes
company logo
Software Developer
4 rounds | 5 problems
Interviewed by Intuit
904 views
0 comments
0 upvotes