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

Cognitive AI Manager

IBM
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
I first learned a programming language in my first year. Then, I practiced DSA on various online coding platforms and chose the best platforms for you to practice a wide variety of questions. For other subjects like OS, CN, DBMS, etc., I prepared from my college subjects only.
Application story
I saw openings on the IBM portal for this position, so I reached out to many IBM employees on LinkedIn for a referral. One of the employees agreed to give me a referral, so I applied through his referral.
Why selected/rejected for the role?
My main reason for selection was my in-depth knowledge of advanced DSA topics like Trees. I had prepared for Trees very well, so I was able to provide optimized approaches for Tree-based questions.
Preparation
Duration: 2 Months
Topics: Data Structures, OOPS, Operating Systems, Algorithms, C
Tip
Tip

Tip 1 : Code More
Tip 2 : Study Data Structures
Tip 3 : Be Confident

Application process
Where: Referral
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1: Mention only what you are confident about.
Tip 2: Mention the tools and technologies used in the project as well.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 Minutes
Interview date1 Feb 2023
Coding problem2

1. Decreasing Subsequences

Moderate
0/80
Asked in companies
GoogleIBMPegasystems

Ninja is fond of sequences. He has a set of numbers and wants to make minimum decreasing subsequences such that all numbers are part of exactly one subsequence. Can you help Ninja with this challenge?

You are given an array ‘ARR’ having ‘N’ elements.Your task is to divide all ‘N’ elements of the array into a minimum number of strictly decreasing subsequences. Each number can be in one subsequence only. Find the minimum number of such strictly decreasing subsequences.

For Example
If 'ARR' is [4,2,1,3] ,it can be splitted into two subsequences as [4,2,1] , [3] or [4,3],[2,1].  
Try solving now

2. Next Greater Element

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

You are given an array 'a' of size 'n'.



The Next Greater Element for an element 'x' is the first element on the right side of 'x' in the array, which is greater than 'x'.


If no greater elements exist to the right of 'x', consider the next greater element as -1.


For example:
Input: 'a' = [7, 12, 1, 20]

Output: NGE = [12, 20, 20, -1]

Explanation: For the given array,

- The next greater element for 7 is 12.

- The next greater element for 12 is 20. 

- The next greater element for 1 is 20. 

- There is no greater element for 20 on the right side. So we consider NGE as -1.
Try solving now
02
Round
Medium
Video Call
Duration60 Minutes
Interview date2 Feb 2023
Coding problem2

It was held at 10 AM in the morning.
The interviewer was very friendly.
I was asked to solve two coding questions and was continuously provided with hints by the interviewer.
The questions were on arrays and trees.

1. Left Sum

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

Given a binary tree having ‘N’ number of nodes. Your task is to find the sum of all left nodes present in the input binary tree. That is, you need to take the sum of all nodes which are the left child of some node.

Note :

1. A binary tree is a tree in which each node can have at most two children. 
2. The given tree will be non-empty i.e the number of non-NULL nodes will always be greater than or equal to 1.
3. Multiple nodes in the tree can have the same values, all values in the tree will be positive.
Try solving now

2. Convert Bst To The Greater Sum Tree

Moderate
30m average time
70% success
0/80
Asked in companies
AmazonMathworksCultfit

You have been given a Binary Search Tree of integers. You are supposed to convert it to a greater sum tree such that the value of every node in the given BST is replaced with the sum of the values of all the nodes which are greater than the value of the current node in the tree.

A Binary Search Tree is a tree, whose internal nodes each store a value greater than all the values in the node's left subtree and less than those in its right subtree.

Note :

You need to modify the given tree only. You are not allowed to create a new tree.
For example:
For the given binary search tree

Example

11 will be replaced by {15 + 29 + 35 + 40}, i.e. 119.
2 will be replaced by {7 + 11 + 15 + 29 + 35 + 40}, i.e. 137.
29 will be replaced by {35 + 40}, i.e. 75.
1 will be replaced by {2 + 7 + 11 + 15 + 29 + 35 + 40}, i.e. 139.
7 will be replaced by {11 + 15 + 29 + 35 + 40}, i.e. 130.
15 will be replaced by {15 + 29 + 35 + 40}, i.e. 104.
40 will be replaced by 0 {as there is no node with a value greater than 40}.
35 will be replaced by {40}, i.e. 40.
Try solving now
03
Round
Medium
Video Call
Duration60 Minutes
Interview date2 Feb 2023
Coding problem2

Evening 5 PM. The interviewer was very friendly and provided various hints. It covered complex coding questions on tree data structures.

1. Level Order Traversal

Easy
15m average time
85% success
0/40
Asked in companies
MicrosoftDeutsche BankFlipkart

You have been given a Binary Tree of integers. You are supposed to return the level order traversal of the given tree.

For example:
For the given binary tree

Example

The level order traversal will be {1,2,3,4,5,6,7}.
Try solving now

2. Distance between two nodes of a Tree

Moderate
25m average time
60% success
0/80
Asked in companies
OracleAmazonGoogle

Given a binary tree and the value of two nodes, find the distance between the given two nodes of the Binary Tree.

Distance between two nodes is defined as the minimum number of edges in the path from one node to another.

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

Which operator is used for exponentiation in Python?

Choose another skill to practice
Similar interview experiences
company logo
Associate System Engineer
2 rounds | 2 problems
Interviewed by IBM
2609 views
1 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by IBM
1375 views
0 comments
0 upvotes
company logo
Staff Engineer
3 rounds | 4 problems
Interviewed by IBM
4067 views
0 comments
0 upvotes
company logo
MEAN Stack Developer
4 rounds | 6 problems
Interviewed by IBM
320 views
0 comments
0 upvotes