IBM OA high-frequency test questions sharing | How to pass IBM OA?

33 Views
No Comment

IBM OA usually consists of two questions, and it takes less than 10 minutes to submit and pass them all. It is a typical free question. To be honest, the overall difficulty of IBM's Online Assessment is relatively low. As long as you answer enough questions and are proficient in the templates, it is easy to kill in seconds. I have recently been preparing for OA and VO for Amazon, Google, and Microsoft at the same time, and they have been relatively smooth, so I have briefly compiled some of the high-frequency real questions I encountered at IBM this time and shared them with students who are still preparing for IBM.

IBM OA high-frequency test questions sharing | How to pass IBM OA?

IBM OA high-frequency real question sharing-Programhelp exclusive

Topic 1: High load timestamp index

Question description

Find the index (0-based) of all timestamps that satisfy the server load for that timestampGreater thanTwice the average server load.

Function GetHighLoadTimestamps Receive an input:

  • Int load[n]: Server load value for each timestamp

The function needs to return an array of integers, sorting in ascending order all items that satisfy Load[i] > 2 × average server load Timestamp index (0-based). If there is no index that satisfies the condition, an empty array is returned.

Example

  • N=3
  • Load = [1, 2, 9]
  • Load average = (1 + 2 + 9) / 3 = 4, twice the average load is 8
  • Only index 2 has load value 9 > 8, so the answer is [2]

Constraints

  • 1 ≤ n ≤ 2 × 10^5
  • 1 ≤ load[i] ≤ 10^9

Question 2: Calculation of the minimum total cost of items

Question description

Given a set of items and their corresponding multiple optional prices, the total number of items is NumItems, numbered from 0 toNumItems-1.

There are two lengthsNAn array of integers defining all available prices:ItemId And Cost,in:

  • ItemId[i] It's the firstIThe item number corresponding to the price item
  • Cost[i] Is the price corresponding to the price item

Implement a function that calculates the minimum total cost of selecting exactly one price entry for each item. If any item does not have a corresponding price entry, return-1.

Function MinTotalCost Receives the following input:

  • Int numItems: Total number of items, numbered 0 toNumItems-1
  • Int itemId[n]: Array of item numbers corresponding to each price item
  • Int cost[n]: Price array corresponding to each price item

The function needs to return a long integer, indicating the minimum total cost of selecting all items; if the price cannot be selected for all items, return-1.

Example

  • NumItems = 3
  • N=4
  • ItemId = [2, 0, 1, 2]
  • Cost = [8, 7, 6, 9]
  • The minimum price of item 0 is 7, the minimum price of item 1 is 6, and the minimum price of item 2 is 8
  • Total minimum cost = 7 + 6 + 8 = 21

Question 3: Selection of at most non-overlapping time windows

Question description

Given two arrays of integers StartTime And EndTime, the lengths are allN. No.IThe starting time of each time window isStartTime[i](inclusive), end time isEndTime[i](not included).

Implement a function to calculate the maximum number of non-overlapping time windows that can be selected.

Function SelectMostCompatibleWindows Receives the following input:

  • Int startTime[n]:Start time array of time window
  • Int endTime[n]: End time array of time window

The function needs to return an integer, which is the maximum number of non-overlapping time windows that can be selected.

Example 1

  • N=3
  • StartTime = [1, 1, 2]
  • EndTime = [3, 2, 4]
  • You can choose window 0 (1-3), or window 1 (1-2) and window 2 (2-4), up to 2 non-overlapping windows, so the answer is2

Example 2 (Sample Case 0)

  • N=4
  • StartTime = [1, 1, 2, 3]
  • EndTime = [2, 3, 3, 4]
  • You can choose Window 0 (1-2), Window 2 (2-3), Window 3 (3-4), a total of 3 non-overlapping windows, so the answer is3

Constraints

  • 1 ≤ n ≤ 10^5
  • 1 ≤ startTime[i], endTime[i] ≤ 10^9

Question 4: Calculation of maximum water level increase

Question description

Meteorologists record array of river water levels in chronological orderArr, each value is a reading recorded in time sequence.

Your task is to find the maximum increase in water level, that is, the maximum difference that satisfies the following conditions Arr[j] - arr[i]:

  • I < j: The lower reading must have occurred at an earlier time
  • Arr[i] < arr[j]: Earlier readings must be strictly smaller than later readings

If no such pair of readings exists (i.e. No reading is higher than the previous reading), return-1.

Example 1

  • Arr = [5, 3, 6, 7, 4]
  • Among all the differences that satisfy the conditions, the maximum is 7 - 3 = 4, so the output4

Example 2

  • Arr = [4, 3, 2, 1]
  • No reading is higher than the previous reading, so the output-1

Constraints

  • 1 ≤ array length ≤ 2 × 10^6
  • -10^6 ≤ arr[i] ≤ 10^6

Not sure how to prepare for IBM OA?

We have also compiled complete solution ideas and code templates for these IBM OA questions. If you need detailed solutions, please send us a private message.

If you are preparing for an OA or interview with a large company and need professional assistance, we can provide help:OA ghostwriting Supports platforms such as HackerRank, Niuke.com, Codesignal, etc. To ensure that all test cases pass 100%, and there will be no charge if they fail; VO interview real-time assistance is provided by North American CS experts to provide ideological guidance; it can also provide proxy interviews and full-service, escorting the entire process from OA to Offer negotiations. Others such as mock interviews, algorithm coaching, resume optimization, etc. Can be supported. Welcome to discuss in detail via private message, we will give you a suitable solution based on your situation. I wish everyone a smooth interview and get your favorite offer as soon as possible!

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END
 0