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

SDE

IBM
upvote
share-icon
2 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming.
Tip
Tip

Tip 1 - Practice Atleast 250 Questions
Tip 2 - Do atleast 2 projects
Tip 3 - Practice good number of questions for Aptitude and Quantitative reasoning

Application process
Where: Campus
Eligibility: 6.5 CGPA
Resume Tip
Resume tip

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration60 minutes
Interview date10 Aug 2021
Coding problem4

There were 10-15 mcq DSA questions. Also there were around 5-6 coding questions.

1. Word Break

Moderate
15m average time
85% success
0/80
Asked in companies
Morgan StanleyMakeMyTripIBM

.

Problem approach

My approach was that , apart from the dp table, we also maintain all the indexes which have matched earlier. Then we will check the substrings from those indexes to the current index. If anyone of that matches then we can divide the string up to that index.
In this program, we are using some extra space. However, its time complexity is O(n*s) where s is the length of the largest string in the dictionary and n is the length of the given string

Try solving now

2. 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 idea is very basic run a nested loop, the outer loop which will mark the starting point of the subarray of length k, the inner loop will run from the starting index to index+k, k elements from starting index and print the maximum element among these k elements.

Try solving now

3. Sort a Stack

Easy
10m average time
90% success
0/40
Asked in companies
LinkedInIntuitIBM

You’re given a stack consisting of 'N' integers. Your task is to sort this stack in descending order using recursion.

We can only use the following functions on this stack S.

is_empty(S) : Tests whether stack is empty or not.
push(S) : Adds a new element to the stack.
pop(S) : Removes top element from the stack.
top(S) : Returns value of the top element. Note that this function does not remove elements from the stack.
Note :
1) Use of any loop constructs like while, for..etc is not allowed. 
2) The stack may contain duplicate integers.
3) The stack may contain any integer i.e it may either be negative, positive or zero.
Try solving now

4. Largest rectangle in a histogram

Hard
25m average time
75% success
0/120
Asked in companies
FacebookAppleAmazon

You have been given an array/list 'HEIGHTS' of length ‘N. 'HEIGHTS' represents the histogram and each element of 'HEIGHTS' represents the height of the histogram bar. Consider that the width of each histogram is 1.

You are supposed to return the area of the largest rectangle possible in the given histogram.

For example :
In the below histogram where array/list elements are {2, 1, 5, 6, 2, 3}.

alt text

The area of largest rectangle possible in the given histogram is 10.
Problem approach

1) Create an empty stack.
2) Start from first bar, and do following for every bar ‘hist[i]’ where ‘i’ varies from 0 to n-1. 
……a) If stack is empty or hist[i] is higher than the bar at top of stack, then push ‘i’ to stack. 
……b) If this bar is smaller than the top of stack, then keep removing the top of stack while top of the stack is greater. Let the removed bar be hist[tp]. Calculate area of rectangle with hist[tp] as smallest bar. For hist[tp], the ‘left index’ is previous (previous to tp) item in stack and ‘right index’ is ‘i’ (current index).
3) If the stack is not empty, then one by one remove all bars from stack and do step 2.b for every removed bar.

Try solving now
02
Round
Medium
Video Call
Duration30 minutes
Interview date12 Aug 2021
Coding problem3

This round was cogitative ability round.

There were around 3-4 game problems , we have to solve them in 30-35 minutes. After this round there was English Language Test round . The questions were of type Antonyms , Synonyms , Jumbled Sentences, Verbal Ability Questions

1. Puzzle Question

Shortcuts :-
In Shortcuts, I need to move the blue marble to the starred area. There are some numbers available on the track. When you move any marble, the number on the track will be added to the distance traveled. There will be some red marbles too which will act as an obstacle in the path and you have to fix them too. The aim of this task is to move blue marbles to the stars with the minimum distance traveled. There will be three categories to evaluate your performance i.e, Ok, Good and Great.

2. Prove it

In Proof it, we must identify as many misspelled words and punctuation error as possible in the time provided.

3. Resemble

In Resemble, we need to mentally rotate the image on the left and then replicate it on the right

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
2 rounds | 5 problems
Interviewed by IBM
1080 views
0 comments
0 upvotes
company logo
SDE
2 rounds | 3 problems
Interviewed by IBM
905 views
0 comments
0 upvotes
company logo
SDE
2 rounds | 3 problems
Interviewed by IBM
1033 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by IBM
886 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE
3 rounds | 6 problems
Interviewed by PhonePe
0 views
0 comments
0 upvotes
company logo
SDE
5 rounds | 8 problems
Interviewed by Mathworks
1223 views
0 comments
0 upvotes
company logo
SDE
4 rounds | 7 problems
Interviewed by PhonePe
0 views
0 comments
0 upvotes