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

Development Consultant

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

Interview preparation journey

expand-icon
Journey
I applied through the on-campus drive. There was an online assessment conducted at the college, followed by three rounds of interviews, including the HR round. For preparation, I studied CS fundamentals from Luv Babbar and Striver’s resources. For DSA, I completed the A2Z TUF sheet and practiced some sections multiple times. Overall, I feel this gave me an edge.
Application story
I applied through the college online job portal, which displays the companies visiting and their processes. On the first day, they conducted a PPT session and an online assessment, both held in the college labs. After that, my name was shortlisted for the interview rounds, which were also conducted on campus.
Why selected/rejected for the role?
I answered every question to the best of my ability and didn’t fake anything. Good communication skills also played a huge role in this.
Preparation
Duration: 3 months
Topics: Data Structures and Algorithms, OOPS, DBMS, Operating Systems, Computer Networks
Tip
Tip

Tip 1: Try to complete at least one DSA sheet.
Tip 2: Study OOPS and DBMS in detail.

Application process
Where: Campus
Eligibility: 7 CGPA, (Salary Package - 23.5 LPA)
Resume Tip
Resume tip

Tip 1: Have at least two strong projects on your resume.
Tip 2: Summer internship experience is also highly beneficial.

Interview rounds

01
Round
Easy
Online Coding Test
Duration90 minutes
Interview date13 Aug 2025
Coding problem2

1. Minimum Cost Traversal

Easy
0/40
Asked in company
SAP Labs

You are given two arrays, A and B, each containing N positive integers, along with two integer switch costs, X and Y.


You must construct a sequence of N choices by traversing from index 0 to N-1. At each index i, you must choose exactly one element, either A[i] or B[i]. The value of the chosen element contributes to a running total cost.


An additional "switching cost" is incurred if your choice of array at index i is different from your choice at index i-1:

Switching from array A to B (choosing A[i-1] then B[i]) costs X.
Switching from array B to A (choosing B[i-1] then A[i]) costs Y.
Staying on the same array (e.g., A[i-1] then A[i]) has no switching cost.


Your goal is to find the minimum possible total cost to traverse from index 0 to N-1. The total cost is the sum of all chosen elements plus the sum of all incurred switching penalties.


Problem approach

Step 1: I first thought of a greedy approach (always pick the smaller element at each position), but it failed because switching costs can affect future choices.

Step 2: Then I realized this is a sequence problem where, at each index, I can choose either array A or B. So, I should use dynamic programming to keep track of both options.

Step 3: I defined two states:

dpA[i] = minimum total cost if I pick from A at position i

dpB[i] = minimum total cost if I pick from B at position i

Step 4: I built the recurrence relation:

dpA[i] = A[i] + min(dpA[i-1], dpB[i-1] + Y)

dpB[i] = B[i] + min(dpB[i-1], dpA[i-1] + X)

Finally, the answer is min(dpA[N], dpB[N]).

Try solving now

2. Rotting Oranges

Moderate
20m average time
78% success
0/80
Asked in companies
IBMSliceSamsung R&D Institute

You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:

  • Value 0 - representing an empty cell.
  • Value 1 - representing a fresh orange.
  • Value 2 - representing a rotten orange.
  • Every second, any fresh orange that is adjacent(4-directionally) to a rotten orange becomes rotten.

    Your task is to find out the minimum time after which no cell has a fresh orange. If it's impossible to rot all the fresh oranges then print -1.

    Note:
    1. The grid has 0-based indexing.
    2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
    
    Problem approach

    Step 1: Put all starting sources into a queue at once, and count how many targets exist.

    Step 2: Run BFS level by level from all sources simultaneously, spreading to neighbors, updating time, and reducing the target count. At the end, check if any targets remain.

    Try solving now
    02
    Round
    Easy
    Face to Face
    Duration40 minutes
    Interview date18 Aug 2025
    Coding problem3

    It was a very interactive round, with questions from Linked Lists and OOPs, and involved a lot of discussion.

    1. Merge Sort

    Easy
    15m average time
    85% success
    0/40
    Asked in companies
    Media.netHewlett Packard EnterpriseIBM

    Given a sequence of numbers ‘ARR’. Your task is to return a sorted sequence of ‘ARR’ in non-descending order with help of the merge sort algorithm.

    Example :

    Merge Sort Algorithm -
    
    Merge sort is a Divide and Conquer based Algorithm. It divides the input array into two-parts, until the size of the input array is not ‘1’. In the return part, it will merge two sorted arrays a return a whole merged sorted array.
    

    subsequence

    The above illustrates shows how merge sort works.
    
    Note :
    It is compulsory to use the ‘Merge Sort’ algorithm.
    
    Problem approach

    I wrote C++ code and explained it with a dry run.

    Try solving now

    2. Puzzle

    There are 4 people (A, B, C, and D) who want to cross a bridge at night.

    • A, B, C and D take 1, 2, 5 and 8 minutes respectively to cross the bridge.
    • There is only one torch with them, and the bridge cannot be crossed without the torch.
    • There cannot be more than two people on the bridge at any time, and when two people cross the bridge together, they must move at the slower person's pace.

    Can they all cross the bridge in 15 minutes?

    Problem approach

    I've solved this kind of problem before, so I answered it correctly.

    3. Puzzle

    The King of a small country invites 1000 senators to his annual party. As a tradition, each senator brings the King a bottle of wine. Soon after, the Queen discovers that one of the senators is trying to assassinate the King by giving him a bottle of poisoned wine. Unfortunately, they do not know which senator, nor which bottle of wine is poisoned, and the poison is completely indiscernible. However, the King has 10 prisoners he plans to execute. He decides to use them as taste testers to determine which bottle of wine contains the poison. The poison when taken has no effect on the prisoner until exactly 24 hours later when the infected prisoner suddenly dies. The King needs to determine which bottle of wine is poisoned by tomorrow so that the festivities can continue as planned. Hence he only has time for one round of testing. How can the King administer the wine to the prisoners to ensure that 24 hours from now he is guaranteed to have found the poisoned wine bottle?

    Problem approach

    I was not able to solve this problem.

    03
    Round
    Easy
    Face to Face
    Duration45 minutes
    Interview date19 Aug 2025
    Coding problem0

    It was a technical and managerial round, starting with an in-depth discussion of the projects mentioned in my resume. I explained both in detail. Then, some DBMS and OOPs questions were asked. Binary search and the motivation behind it were also discussed. Overall, the round was highly discussion-based and aimed at assessing problem-solving capabilities.

    04
    Round
    Easy
    HR Round
    Duration30 minutes
    Interview date18 Aug 2025
    Coding problem0

    It was a very relaxed round. Situational questions were asked, such as where I see myself in five years and what my ambitions are. Overall, it was a very positive round.

    Here's your problem of the day

    Solving this problem will increase your chance to get selected in this company

    Skill covered: Programming

    What is recursion?

    Choose another skill to practice
    Similar interview experiences
    company logo
    Software Developer
    4 rounds | 6 problems
    Interviewed by SAP Labs
    1054 views
    0 comments
    0 upvotes
    company logo
    Software Developer
    4 rounds | 11 problems
    Interviewed by SAP Labs
    830 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
    1302 views
    0 comments
    0 upvotes