← Upstart Interview Insights

Upstart·Software Engineer·Online Assessment (OA)·Intermediate

Intermediate
May 2026

Summary

Upstart's software engineer OA had three coding problems that looked reasonable at first glance but the third one had a gotcha that would've burned me if I tried to simulate it naively. Decent set overall, felt more like a competency filter than anything trying to trip you up.

Questions Asked (3)

Q1

Given a list of 2D integer coordinates, return the bounding box as [minX, minY, width, height], where width and height are the differences between the max and min values on each axis.

Algorithms & Data Structures
Author's notes

Pretty mechanical.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints (e.g., empty list, single point, coordinate ranges) and then propose a single-pass solution that tracks the minimum and maximum x and y values. After iterating through all points, compute the width and height as the differences between the max and min values, and return the bounding box as [minX, minY, width, height].

Pro tip: Mention edge cases like an empty list (return null or throw an exception) and a single point (width and height are 0) to show thoroughness. Also, discuss the trade-off between a single-pass O(n) solution and a potential two-pass approach for clarity, emphasizing that single-pass is optimal.

1. Clarify requirements and edge cases

Ask about input size, coordinate ranges, and behavior for empty or single-point lists. Confirm the output format and whether the bounding box should be inclusive of all points.

2. Initialize min and max values

Set minX and minY to positive infinity, and maxX and maxY to negative infinity, or initialize with the first point if the list is non-empty.

3. Iterate through all points

For each point, update minX, minY, maxX, and maxY accordingly. This single pass ensures O(n) time complexity.

4. Compute width and height

Calculate width = maxX - minX and height = maxY - minY. These represent the dimensions of the bounding box.

5. Return the result

Return the array [minX, minY, width, height]. If the input list is empty, handle appropriately (e.g., return null or throw an exception).

Key Points to Mention

  • Time complexity: O(n) single pass, space complexity: O(1) extra space.
  • Edge cases: empty list, single point, all points collinear (width or height zero).
  • Initialization strategy: using infinity or first point to avoid missing updates.
  • Correctness: ensuring min and max are updated for both axes.
  • Output format: exactly [minX, minY, width, height] as specified.
  • Potential follow-up: handling large datasets or streaming input (can still be done in one pass).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Given a list of name-score records and a threshold, filter out scores above the threshold, then return the name with the highest remaining score. Return null if nothing qualifies, and break ties by original order.

Algorithms & Data Structures
Author's notes

The tie-breaking rule is where people probably slip up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints and edge cases, then propose a single-pass solution that tracks the best candidate among scores at or below the threshold. Emphasize that ties are broken by original order, so only update the best when a strictly higher score is found.

Pro tip: Mention that you can solve this in O(n) time and O(1) extra space, and explicitly handle the case where no scores qualify by returning null. Also, confirm whether the threshold is inclusive (scores ≤ threshold) to avoid off-by-one errors.

1. Clarify requirements and edge cases

Ask whether the threshold is inclusive, what to return if the list is empty or no scores qualify, and confirm tie-breaking by original order.

2. Outline the algorithm

Propose iterating through the list once, keeping track of the name with the highest score that is ≤ threshold. Only update when a strictly higher score is found to preserve original order for ties.

3. Analyze complexity

State that the solution runs in O(n) time and uses O(1) extra space, which is optimal for this problem.

4. Discuss edge cases and testing

Mention testing with empty list, all scores above threshold, multiple ties, and negative scores. Verify that null is returned when no score qualifies.

5. Write clean code

Implement the solution with clear variable names and a simple loop, avoiding unnecessary data structures.

Key Points to Mention

  • Single-pass O(n) time and O(1) space solution
  • Inclusive threshold (scores ≤ threshold) unless specified otherwise
  • Tie-breaking by original order: only update best on strictly higher score
  • Return null when no scores qualify
  • Handle edge cases: empty list, all scores above threshold, negative scores
  • Avoid sorting to maintain O(n) time and preserve original order

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

On a zero-indexed grid of given width and height, implement a function that moves from a starting cell in one of eight directions for up to maxAttempts steps, stopping early if the boundary would be crossed. Return the final cell. The grid and maxAttempts can be very large, so O(1) is required.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is the one that matters.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize that the problem reduces to computing the final position after moving in a straight line in one of eight directions, with early stopping at boundaries. Use arithmetic to calculate the maximum steps possible in each axis and take the minimum, then update coordinates in O(1) time. Handle edge cases like zero steps or starting at boundary.

Pro tip: Mention that you can avoid loops entirely by computing the distance to the boundary in the direction of movement and clamping maxAttempts to that distance. This demonstrates you understand the O(1) requirement and can optimize for large inputs.

1. Clarify the problem

Confirm the grid dimensions, starting cell, direction (as a vector or angle), and maxAttempts. Ensure you understand that movement stops early if the next step would go out of bounds.

2. Decompose movement into axes

Break the direction into row and column deltas (e.g., (-1, 0) for up, (1, 1) for down-right). This allows independent calculation of steps possible in each axis.

3. Compute maximum steps per axis

For each axis, if the delta is positive, max steps = (size - 1 - start) / delta; if negative, max steps = start / -delta; if zero, steps are unlimited (but bounded by maxAttempts). Use integer division.

4. Determine actual steps

The actual number of steps is the minimum of maxAttempts and the maximum steps possible in each axis (ignoring axes with zero delta). This ensures we stop at the boundary.

5. Calculate final position

Update the starting coordinates by adding the direction deltas multiplied by the actual steps. Return the final cell as a tuple or object.

Key Points to Mention

  • O(1) time complexity by using arithmetic instead of simulation.
  • Handling of all eight directions, including diagonal moves where both axes change.
  • Edge cases: maxAttempts = 0, starting at boundary, direction with zero delta in one axis.
  • Use of integer division and minimum function to clamp steps.
  • Potential overflow considerations for very large grids (use appropriate data types).
  • Clarity in defining direction representation (e.g., as a pair of integers).

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.