SAP Labs Internship Interview Experience | August 2019 (On-Campus)

* Disclaimer: All the questions described here were not asked to just me. I tried to archive all the questions that I remembered being asked to any of us. *

Round 1: Online Coding Round

The test conducted on hackerrank had 1 section of MCQ questions based on OOPS concepts and SQL, debugging and output.

Another section on Aptitude Questions which were easy as well.
These were the scoring parts.

Then there was 1 C question to code . a class Polygon is given which has a constructor taking two inputs as arguments- height and width. Write code for two child classes Rectangle and Triangle and calculate its area and use another given class Output to print it.

Then there was a section of two coding questions. I got 1 SQL query and 1 string comparison question.

Some students got 2 sql queries some others got graph coloring question to code.

The SQL queries were too advanced for me. Majority of the students couldn’t solve it.
The string comparison question was easy I solved it using brute force and all test cases passed.

The test had sectional cutoff’s.

17 students were selected for interviews.

On Interview Day:

They presented their Pre-Placement Talk to only the students who were selected for further rounds.

Each round started with the question “Tell me about yourself”.
So it is important to have a proper answer prepared in your mind.

And each round ended with “Do you have any Questions for me?”
You can ask about feedback:
Role of interns, company hierarchy, senior junior relations, work culture, etc.
But it is very important to always ask a question.

Technical Round 1 & 2

Every interviewer had some fixed set of questions according to them(Atleast that’s what it seemed to me.)

Their major focus in round 1 was on OOPS and other basic concepts like-
Abstraction, data hiding, Polymorphism(run-time and compile-time with examples), Virtual functions,
Encapsulation, friend function, function overloading vs function overriding, Operator overloading, etc.

Revise every concept with examples

Then there were some other questions like –

 1. The keyword ‘extern’

2.  Why is C better than C++ ?

(because C is  a lower-level language as compared to C++ and thus it is closer to the machine. This makes it faster and more efficient. Also the reason why it is more widely and commercially used. ex-IRCTC).

3.  What happens when the compiler encouters  ” cout<< ”  Also what if we do operator overloading of  ‘<<‘.

4.  Write a recursive program to reverse a string without using any extra variable.

filter_none

edit
close

play_arrow

link
brightness_4
code

public class Program {
    public static void main(String[] args)
    {
        String s = "daaaaam !";
        System.out.println(rev(s));
    }
    public static String rev(String s)
    {
        int n = s.length();
        if (n <= 1) {
            return s;
        }
        s = rev(s.substring(1, n)) + s.charAt(0);
        return s;
    }
}

chevron_right


5. Write a program to eliminate all duplicate characters in a string .

( you can do this using a hashmap or a 26 size character array.)

6. Write a program to generate a simple pattern

1
12
123
1234
123
12
1

filter_none

edit
close

play_arrow

link
brightness_4
code

public class Program {
    public static void main(String[] args)
    {
        pattern(4);
    }
    public static void pattern(int n)
    {
        // upper half
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j);
            }
            System.out.println();
        }
        // lower half
        for (int i = n - 1; i > 0; i--) {
            for (int j = 1; j <= i; j++) {
                System.out.print(j);
            }
            System.out.println();
        }
    }
}

chevron_right


Some were asked to write the code for Dijekstra too.

Then since I code in Java they asked me Java specifics.

It is very important for java developers to know  details of how HashMap is implemented. I was asked this inevery interview.

1. Difference b/w ArrayList and LinkedList. Which is better for more insertions and deletions?

2. Exception Handling- example and hierarchy

3. Can you override the hash map’s hashcode function ?

4. What is a garbage collector in Java? Is it a good practice to make use of the garbage collector instead of explicitly destroying the content.

 

There were a few SQL questions as well. Look at the TOP and other basic insert, update, delete operations of SQL

It is important to have a look at the different types of joins of tables.

 

The round always ends with a puzzle .
These puzzles are usually easy, not too tough.

1. You have bottles one of them is poisoned. You are given 1 rat.The rat dies after x hrs  of consuming the poison. What is the minimum time required to identify the poisoned bottle?

( ans is  y+x hrs.
Every hour feed the rat with a different bottle i. The hr in which the rat dies will be the x+ith hour. )

2. You are given a 3ltr and a 5ltr container . How can you measure 4ltrs ?

( 1.  Fill the 5ltr container
2.  5-3=2 So fill 3L container until it begans to overflow and you have 2 L water in the 5L container now.
3. Now empty the 3L container and put the 2L in it.
4. The 3L container has space for 1L now
5.  5-1=4 So fill the 5L container and fill the remaining 1L in the 3L container. And viola! you have 4L.)

3. You are given two containers, 50 red balls and 50 blue balls. Distribute these in a way such that the probability of picking a red ball is more/maximum.

( Put one red ball in one container and all other balls in the second container
P(red ball)= 1/2( 1+49/50 )=99/100
which is greater than
P(blue ball)= 1/2( 0+1 ) =50/100 )

Round 3: HR Round

11 students were selected for this round

The major focus during all this was on the projects that you have worked on. They didn’t care about the number of projects.They wanted some unique different types of projects.

I had only one project but it was different than the usual ones.

  1. Tell me about yourself
  2.  Why SAP
  3.  How would you describe your previous rounds
  4.  Weakness
  5.  Any situation where you had to go against the authorities and you believed the cause was justifiable.
  6.  Tell me about the projects you have worked on.

These were actually the initial questions but by the time my turn came it was 9:15 pm so they just directly asked me about myself and my projects.

At the end they selected 6-7 students.

Write your Interview Experience or mail it to contribute@geeksforgeeks.org



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.