Reported May 2026
Upstart

Filter by Threshold and Return Name with Max Score

Reported by candidates from Upstart's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Upstart OA. Under 2s to a working solution.
Founder's read

You're taking Upstart's OA in the next 48 hours and this problem landed in May 2026. It's a filter-and-find-max, which sounds trivial but trips candidates who misread the threshold direction or forget to track both name and score together. Parse the input, filter records where score is less than or equal to threshold, then return the name of the record with the highest score in that filtered set. The pattern is straightforward, but the implementation detail matters: you need to keep the name paired with the score through the filtering step. StealthCoder will spot the pattern instantly if you blank on parsing.

The problem

Complete the function below. The function receives the full standard input as a single string and must return the exact standard output lines for the described problem. Problem Given records records = [(name, score),...] and an integer threshold: Filter out all records with score > threshold (keep score <= threshold). Among the remaining records, find the record with the maximum score and output its name. Constraints: At least one record satisfies score <= threshold. name is a no-space string, score is an integer. Input: Line 1: integer n Line 2: integer threshold Next n lines: name score Output: One line: the name with the maximum score among those <= threshold. Example: Input: 4 80 alice 50 bob 90 cindy 80 dave 70 Output: cindy Example Input 4 80 alice 50 bob 90 cindy 80 dave 70 Output cindy Function Description Complete solveFilterThresholdMaxScore. It has one parameter, String input, containing the full stdin payload. Return the stdout payload as an array of lines, without trailing newline characters. The returned string array must match the expected standard output lines for the sample input. Use the limits and requirements stated in the prompt.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The algorithm is a single pass through the data with two logical steps: first, filter the records by keeping only those where score <= threshold. Second, iterate through the filtered set and track the maximum score and its corresponding name. Common pitfall: candidates confuse the inequality and filter the wrong way, or they forget to store the name alongside the score during the max-finding step. The threshold is a hard ceiling, not a floor. Parse input carefully: first line is n (count), second line is threshold, then n lines of 'name score' pairs. Once filtered, a simple max comparison solves it. This is not a trick question, but execution and parsing accuracy matter. StealthCoder handles the input parsing and max logic if you freeze during the live OA.

Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.

If this hits your live OA

You can drill Filter by Threshold and Return Name with Max Score cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Upstart's OA.

Upstart reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Filter by Threshold and Return Name with Max Score FAQ

Do I filter by score > threshold or score <= threshold?+

Keep score <= threshold (less than or equal). The problem says 'filter out all records with score > threshold', which means you keep the rest. In the example, threshold is 80, so cindy with 80 is kept, bob with 90 is removed.

What if multiple records have the same max score after filtering?+

The problem doesn't specify and the constraints guarantee at least one record passes the threshold. The example has cindy as the sole max. If it's a tie, your language's max function will pick one. Test locally if you're unsure, but Upstart likely avoids this edge case.

How do I parse 'name score' pairs when name is a single word?+

Split each line by whitespace. The last token is the score (integer), everything before it is the name. Since names have no spaces, you can split and take the first token as name and second as score, then convert score to int.

Is this problem still asked at Upstart or is it outdated?+

This exact problem was reported in May 2026, so it's live and current. Upstart likes straightforward input parsing and filtering logic. Expect similar problems in their OA: read structured input, apply a condition, return a result.

How should I return the output? One line with the name only?+

Yes. Return an array of strings with one element: the name. No extra formatting, no score, no newlines. The expected output is 'cindy', nothing else.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Upstart.

OA at Upstart?
Invisible during screen share
Get it