Solve remembered OA coding tasks
Company: Upstart
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Take-home Project
The online assessment reportedly had five coding questions, but only the following three were described clearly enough to reconstruct:
1. **Find the top three companies by average stock price**
You are given a mapping from company name to a list of its daily stock prices over several days. Compute the average stock price for each company and return the names of the **three companies with the highest average price**. If there are fewer than three companies, return all of them. If two companies have the same average, break ties by company name in ascending lexicographic order.
2. **Compute the bounding rectangle of a set of points**
You are given a list of 2D coordinates `[(x1, y1), (x2, y2), ..., (xn, yn)]`. Return four values:
- the minimum `x` value,
- the minimum `y` value,
- `max_x - min_x`,
- `max_y - min_y`.
In other words, return the lower-left corner, width, and height of the smallest axis-aligned rectangle that contains all points.
3. **Validate a partially filled 9x9 number board**
You are given a 9x9 grid where each cell contains either a digit `'1'` through `'9'` or `'.'` for empty. Determine whether the current board state is valid under these rules:
- no digit may appear more than once in any row,
- no digit may appear more than once in any column,
- no digit may appear more than once in any 3x3 subgrid.
The other two OA questions were not described clearly enough to reconstruct.
Quick Answer: This set of problems evaluates skills in data aggregation and ordering (identifying top averages), computational geometry and extrema calculation (axis-aligned bounding rectangle), and grid constraint validation and consistency checking (partially filled 9x9 number board).