FastPrepCount Fit Records Across Pages
Problems/Count Fit Records Across Pages

Count Fit Records Across Pages

Palantir logoPalantir● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Palantir new grad online assessment. The original task fetches pages of medical records and counts diastolic readings in an inclusive range.

Here, the readings come in pages as an extra argument. The HTTP request and the JSON parsing are not part of the task. We left out the other API fields. The limits, the page sizes, and the examples that run are our choices. The outputs 99 and 3 in the photos belong to their original API data.

Our version is about 75% the same as the reported question.

Count medical records whose diastolic blood-pressure reading is inside an inclusive range.

For this exercise, assume pages contains the complete set of response pages. Each row represents one fetched page, and each integer is the vitals.bloodPressureDiastole value from one record. The source API's other fields are left out.

Return the number of supplied records whose reading is at least lowerlimit and at most upperlimit. Equal readings in different records all count. Visit every page, including pages after an empty one.

The page list and individual pages may be empty. All inputs are well formed. The page matrix is an extra argument for this practice exercise; no HTTP request or JSON parsing is required.

Function

healthCheckup(pages: int[][], lowerlimit: int, upperlimit: int) → int

Examples

Example 1

pages = [[80,90,110],[95],[]]lowerlimit = 90upperlimit = 100return = 2

The first page contributes the reading 90, the second contributes 95, and the empty page contributes none. Both endpoints are included, so the count is 2.

Example 2

pages = [[],[70,70,80],[],[70]]lowerlimit = 70upperlimit = 70return = 3

All three records with reading 70 count, even though two have the same value on one page and another comes after an empty page. The reading 80 is outside the range.

Example 3

pages = []lowerlimit = 0upperlimit = 300return = 0

There are no supplied pages, so there are no records to count.

Constraints

  • 0 <= pages.length <= 50.
  • 0 <= pages[i].length <= 1000.
  • 0 <= pages[i][j] <= 300, with integer readings.
  • 0 <= lowerlimit <= upperlimit <= 300.

More Palantir Online Assessment questions

  • Basic Item DiscountsOA · Seen Nov 2026
  • Optimize Discount Selection Under a Point BudgetOA · Seen Nov 2026
  • Stacked Item and Category DiscountsOA · Seen Nov 2026
  • Minimize Path ValueOA · Seen Sep 2024
  • No Pairs AllowedOA · Seen Sep 2024
  • REST API: Country CodesOA · Seen Feb 2024
  • Swap ParityOA · Seen Feb 2024
  • Freelance Candidate ReviewOA · Seen Nov 2023
  • Benchmarking Tool ReportOA · Seen Sep 2023
  • Network FormationOA · Seen Sep 2023

Similar questions at other companies

  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • Count Valid Square PairsAuxoAI · OA
  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Two SumAmazon · OA · PHONE SCREEN
  • Count Strictly Increasing Contiguous WindowsIBM · OAIBM interview questions
  • Find Words That Can Be Formed by CharactersTabaPay · OA
  • Server InvestmentRippling · OARippling interview questions
  • Book Reading EveningsGoogle · OAGoogle interview questions
  • Minimum Index Distance Between Person and CakeSnowflake · OA · PHONE SCREENSnowflake interview questions
  • Wind-Blown Leaves Remaining in a GridAbridge · OAAbridge interview questions

Interview reports that mention this question

  • Palantir FDSE New Grad OA Questions: 6 Experiences (Part 2 of 2)

Palantir interview experiences

  • Palantir FDSE Experienced-Hire Interviews: 5 Experiences
  • Palantir FDSE New Grad Interviews: 5 Experiences (Part 1 of 2)
  • Palantir FDSE Intern OA and Interviews: 3 Experiences
  • Palantir FDSE Karat and Learning: 7 Experiences (Part 2 of 2)
  • Palantir FDSE OA and Interviews: 16 Experiences (Part 1 of 2)
All Palantir interview questionsSee Palantir hiring insights
Saved
class Solution {
    public int healthCheckup(int[][] pages, int lowerlimit, int upperlimit) {
        return 0;
    }

}
Checking account…