Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

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

IBM

3 rounds | 6 Coding
problems

Journey

My life has had many ups and downs, but I somewhat managed to get admission to the college where I took computer science as a subject. Then my coding journey started from here.

Application story

This company visited to my campus for the placements .

Why selected/rejected for the role?

I was rejected because i am not able to answer all the questions correctly and precise. .

Preparation

Duration: 3 months

Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming

Tip

Tip 1 : Practice more problem solving questions

Tip 2 : understand the comcepts in depth

Tip 3 : try to work on onw or two handson project to get more experience in that stack.

Application process

Where: Campus

Eligibility: Above 7 CGPA

Resume tip

Tip 1 : Have some projects on resume.

Tip 2 : Do not put false things on resume.

01

Round

Easy

Video Call

Duration60 minutes

Interview date3 Feb 2023

Coding problem2

```
Input: Consider the following Binary Tree:
```

```
Output:
Following is the level-order traversal of the given Binary Tree: [1, 2, 3, 5, 6, 4]
```

```
The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
```

```
Can you solve this problem in O(N) time and O(1) space complexity?
```

Problem approach

You are given a Singly Linked List of integers. You need to reverse the Linked List by changing the links between nodes.

02

Round

Easy

Video Call

Duration60 minutes

Interview date3 Feb 2023

Coding problem2

```
1. The length of each array is greater than zero.
2. Both the arrays are sorted in non-decreasing order.
3. The output should be in the order of elements that occur in the original arrays.
4. If there is no intersection present then return an empty array.
```

Problem approach

You are given two arrays 'A' and 'B' of size 'N' and 'M' respectively. Both these arrays are sorted in non-decreasing order. You have to find the intersection of these two arrays.

Intersection of two arrays is an array that consists of all the common elements occurring in both arrays.

```
For a (6 x 6) board, the numbers are written as follows:
```

```
You start from square 1 of the board (which is always in the last row and first column). On each square say 'X', you can throw a dice which can have six outcomes and you have total control over the outcome of dice throw and you want to find out the minimum number of throws required to reach the last cell.
Some of the squares contain Snakes and Ladders, and these are possibilities of a throw at square 'X':
You choose a destination square 'S' with number 'X+1', 'X+2', 'X+3', 'X+4', 'X+5', or 'X+6', provided this number is <= N*N.
If 'S' has a snake or ladder, you move to the destination of that snake or ladder. Otherwise, you move to S.
A board square on row 'i' and column 'j' has a "Snake or Ladder" if board[i][j] != -1. The destination of that snake or ladder is board[i][j].
```

```
You can only take a snake or ladder at most once per move: if the destination to a snake or ladder is the start of another snake or ladder, you do not continue moving - you have to ignore the snake or ladder present on that square.
For example, if the board is:
-1 1 -1
-1 -1 9
-1 4 -1
Let's say on the first move your destination square is 2 [at row 2, column 1], then you finish your first move at 4 [at row 1, column 2] because you do not continue moving to 9 [at row 0, column 0] by taking the ladder from 4.
A square can also have a Snake or Ladder which will end at the same cell.
For example, if the board is:
-1 3 -1
-1 5 -1
-1 -1 9
Here we can see Snake/Ladder on square 5 [at row 1, column 1] will end on the same square 5.
```

Problem approach

You have been given a Snake and Ladder Board with 'N' rows and 'N' columns with the numbers written from 1 to (N*N) starting from the bottom left of the board, and alternating direction each row.

03

Round

Easy

Video Call

Duration60 minutes

Interview date3 Feb 2023

Coding problem2

```
str = "ababc"
The longest palindromic substring of "ababc" is "aba", since "aba" is a palindrome and it is the longest substring of length 3 which is a palindrome.
There is another palindromic substring of length 3 is "bab". Since starting index of "aba" is less than "bab", so "aba" is the answer.
```

```
Let us say we have array 'ARR' =[-1,3,5,-2,4,-9]. The longest sub-array with the positive product is [3,5,-2,4,-9].
```

Problem approach

You are given an array ‘ARR’ of ‘N’ integers, you need to find the maximum length of the sub-array such that the product of elements of the sub-array is positive.

Here's your problem of the day

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

Suppose list1 is [2, 133, 12, 12], what is max(list1) in Python?

Choose another skill to practice

Start a Discussion

Similar interview experiences

System Engineer

3 rounds | 12 problems

Interviewed by IBM

1788 views

0 comments

0 upvotes

Associate System Engineer

2 rounds | 2 problems

Interviewed by IBM

2421 views

1 comments

0 upvotes

Associate System Engineer

3 rounds | 5 problems

Interviewed by IBM

2063 views

0 comments

0 upvotes

SDE - 1

2 rounds | 4 problems

Interviewed by IBM

336 views

0 comments

0 upvotes