Count Paginated Medical Records in a Range
Updated
Problem statement
A medical-records API returns a paginated response. For this network-free practice version, pages[i] contains the integer values of the requested record field returned on API page i + 1.
A record qualifies when its field value lies in the inclusive interval from lowerBound through upperBound.
Return the total number of qualifying records across every page.
Function
countMedicalRecordsInRange(pages: int[][], lowerBound: int, upperBound: int) → intExamples
Example 1
pages = [[110,125,120],[100,115],[]]lowerBound = 110upperBound = 120return = 3The qualifying values are 110, 120, and 115. Values 125 and 100 fall outside the inclusive interval, and the empty page contributes no records.
Constraints
pagesand any of its rows may be empty.- Every field value,
lowerBound, andupperBoundfits in a signed 32-bit integer. lowerBound ≤ upperBound.
Source note: These screenshots show the paginated HackerRank medical-records API schema from two independent IBM OA source sightings. Both crops omit the requested filter field and the complete callable contract.
More IBM Online Assessment questions
- Missing IntervalsOA · Seen Nov 2026
- Last Object Exit TimeOA · Seen Nov 2026
- Count Peaks and ValleysOA · Seen Nov 2026
- Count Strictly Increasing Contiguous WindowsOA · Seen Nov 2026
- Total Each Letter's Count in an Encoded StringOA · Seen Nov 2026
- Count Servers With No Requests in a Time WindowOA · Seen Nov 2026
- Maximum Easy Tasks After RearrangingOA · Seen Nov 2026
- Tree Pythagorean TriplesOA · Seen Oct 2026
- Minimum Power-of-Two Removal OperationsOA · Seen Oct 2026
- Maximum Compatible Time WindowsOA · Seen Oct 2026
Similar questions at other companies
- Macaron Order with Set DiscountsShopify · OA
- Count Card Duel RoundsAirbnb · OA
- Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OA
- Book Reading EveningsGoogle · OA
- Basic Item DiscountsPalantir · OA
- Wind-Blown Leaves Remaining in a GridAbridge · OA
- Lift Total TravelInfosys · OA
- Shell Command Counts with History ReferencesTikTok · OA
- Count Dropped RequestsJP Morgan Chase · OA
- Recursively Expanded Shell Command CountsHudson River Trading · OA