IBM Coding Assessment 2 - On campus

ibm logo
ibm
September 10, 2026 · 2 reads

Summary

I took the second coding assessment for an on‑campus interview at IBM, which included a problem about finding strictly increasing contiguous slopes of size K and a framework bug‑fixing task.

Full Experience

This is the second coding assessment after shortlisted from OA

1.)Given an integer array named yCoordinates where yCoordinates[i] represents the Y axis and each index represents the X axis. Find the strictly increasing contiguous slope of the give points of size exactly K.

Example: Input:

[6,5,7,8,3,5,6] and k=3

The points are (0,6),(1,5),(2,7),(3,8),(4,3),(5,5),(6,6)

output : 2

Possible increasing slopes are: (1,5),(2,7),(3,8) (4,3)(5,5),(6,6)

constraints: 1<=yCoordinates.size()<=10^5; yCoorinates[i]>=1

2.) This is a framework based questions we are allowed to pick the framework such as Node.js,Spring boot or Django.The code repository is given to us where we need to resolve the bugs in that and total test cases of 8 was given to us. No AI tool is incorporated.

Interview Questions (1)

1.

Find Strictly Increasing Contiguous Slope of Size K

Data Structures & Algorithms

Given an integer array yCoordinates where yCoordinates[i] represents the Y‑coordinate at X‑coordinate i. Find the number of strictly increasing contiguous sub‑arrays (slopes) of length exactly K.

Example

Input:  yCoordinates = [6,5,7,8,3,5,6], K = 3
Points: (0,6), (1,5), (2,7), (3,8), (4,3), (5,5), (6,6)
Output: 2

Possible increasing slopes of length 3 are:

  • (1,5), (2,7), (3,8)
  • (4,3), (5,5), (6,6)

Constraints

  • 1 <= yCoordinates.size() <= 10^5
  • yCoordinates[i] >= 1

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!