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

SDE - 1

IBM
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Journey
Initially grappling with the syntax of languages like Python and Java, I gradually embraced the logic and problem-solving aspects of programming. Each milestone brought a sense of accomplishment as I delved into data structures, algorithms, and web development. Collaborating on projects with peers honed my teamwork and communication skills. Facing bugs and errors became opportunities for learning, fostering resilience. By the end of the initial phase of my coding journey, I had transformed from a novice to a more confident programmer, eager to explore the vast realms of software development that lay ahead.
Application story
This company conducted an initial online assessment followed by three rounds of interviews during their campus placement visit. The interview process consisted of two technical rounds and one round focused on human resources.
Why selected/rejected for the role?
I was rejected because i was not able to perform well during the interviews. There are total 2 rounds of interview.
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1: Regularly participate in coding challenges on platforms like CodeStudio to enhance problem-solving skills and gain exposure to diverse coding scenarios.

Tip 2: Engage in collaborative coding projects focusing on real-world applications. This demonstrates practical coding abilities and enhances teamwork and project management skills, making you more appealing to potential employers.

Application process
Where: Campus
Eligibility: Above 7.5 CGPA
Resume Tip
Resume tip

Tip 1: Highlight quantifiable achievements and results in your resume, showcasing the impact of your contributions in previous roles, such as increased efficiency, cost savings, or successful project outcomes.

Tip 2: Tailor your resume for each job application, emphasizing relevant skills and experiences that align with the position's specific requirements. This customization enhances your chances of standing out to recruiters and aligning with the role's needs.

Interview rounds

01
Round
Easy
Video Call
Duration60 minutes
Interview date29 Oct 2022
Coding problem2

1. Maximum Subarray Sum

Moderate
25m average time
75% success
0/80
Asked in companies
CultfitPayPalWalmart

Given an array of numbers, find the maximum sum of any contiguous subarray of the array.


For example, given the array [34, -50, 42, 14, -5, 86], the maximum sum would be 137, since we would take elements 42, 14, -5, and 86.


Given the array [-5, -1, -8, -9], the maximum sum would be -1.


Follow up: Do this in O(N) time.

Problem approach

You are given an array 'arr' of length 'n', consisting of integers.



A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.



Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.



The sum of an empty subarray is 0.



Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Try solving now

2. Sort 0 1 2

Easy
22m average time
0/40
Asked in companies
Expedia GroupWalmartHCL Technologies

You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.

Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.
Problem approach

You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.

Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date31 Oct 2022
Coding problem2

1. Find Duplicate in Array

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

You are given an array of integers 'ARR' containing N elements. Each integer is in the range [1, N-1], with exactly one element repeated in the array.

Your task is to find the duplicate element. The duplicate element may be repeated more than twice in the error, but there will be exactly one element that is repeated in the array.

Note :

All the integers in the array appear only once except for precisely one integer which appears two or more times.
Problem approach

You are given an array of integers 'ARR' containing N elements. Each integer is in the range [1, N-1], with exactly one element repeated in the array.

Your task is to find the duplicate element. The duplicate element may be repeated more than twice in the error, but there will be exactly one element that is repeated in the array.

Note :

All the integers in the array appear only once except for precisely one integer which appears two or more times.

Try solving now

2. Allocate Books

Moderate
10m average time
90% success
0/80
Asked in companies
PayUIBMZS

Given an array ‘arr’ of integer numbers, ‘arr[i]’ represents the number of pages in the ‘i-th’ book.


There are ‘m’ number of students, and the task is to allocate all the books to the students.


Allocate books in such a way that:

1. Each student gets at least one book.
2. Each book should be allocated to only one student.
3. Book allocation should be in a contiguous manner.


You have to allocate the book to ‘m’ students such that the maximum number of pages assigned to a student is minimum.


If the allocation of books is not possible, return -1.


Example:
Input: ‘n’ = 4 ‘m’ = 2 
‘arr’ = [12, 34, 67, 90]

Output: 113

Explanation: All possible ways to allocate the ‘4’ books to '2' students are:

12 | 34, 67, 90 - the sum of all the pages of books allocated to student 1 is ‘12’, and student two is ‘34+ 67+ 90 = 191’, so the maximum is ‘max(12, 191)= 191’.

12, 34 | 67, 90 - the sum of all the pages of books allocated to student 1 is ‘12+ 34 = 46’, and student two is ‘67+ 90 = 157’, so the maximum is ‘max(46, 157)= 157’.

12, 34, 67 | 90 - the sum of all the pages of books allocated to student 1 is ‘12+ 34 +67 = 113’, and student two is ‘90’, so the maximum is ‘max(113, 90)= 113’.

We are getting the minimum in the last case.

Hence answer is ‘113’.
Problem approach

Given an array ‘arr’ of integer numbers, ‘arr[i]’ represents the number of pages in the ‘i-th’ book.



There are ‘m’ number of students, and the task is to allocate all the books to the students.



Allocate books in such a way that:

1. Each student gets at least one book.
2. Each book should be allocated to only one student.
3. Book allocation should be in a contiguous manner.


You have to allocate the book to ‘m’ students such that the maximum number of pages assigned to a student is minimum.



If the allocation of books is not possible, return -1.



Example:
Input: ‘n’ = 4 ‘m’ = 2 
‘arr’ = [12, 34, 67, 90]

Output: 113

Explanation: All possible ways to allocate the ‘4’ books to '2' students are:

12 | 34, 67, 90 - the sum of all the pages of books allocated to student 1 is ‘12’, and student two is ‘34+ 67+ 90 = 191’, so the maximum is ‘max(12, 191)= 191’.

12, 34 | 67, 90 - the sum of all the pages of books allocated to student 1 is ‘12+ 34 = 46’, and student two is ‘67+ 90 = 157’, so the maximum is ‘max(46, 157)= 157’.

12, 34, 67 | 90 - the sum of all the pages of books allocated to student 1 is ‘12+ 34 +67 = 113’, and student two is ‘90’, so the maximum is ‘max(113, 90)= 113’.

We are getting the minimum in the last case.

Hence answer is ‘113’.

Try solving now

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
2 rounds | 2 problems
Interviewed by IBM
4299 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by IBM
1785 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by IBM
1172 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by IBM
2297 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes