Town Temperature Regression Analysis
Updated
Problem statement
You are given a temperatures table containing daily temperatures for NYC and six predictor towns named Town1 through Town6. Produce exactly six analysis rows.
- Find the town with the largest population standard deviation of temperature.
- Take the median
NYCtemperature among rows whereTown2is between90and100, inclusive. Use0when there are no such rows, then round to the nearest integer. - For each town independently, fit ordinary least squares with an intercept to predict
NYCfrom that town. Sum the absolute values of the six slope coefficients, excluding intercepts, then round to the nearest integer. - Find the single town whose intercept-based model has the smallest training mean squared error.
- Find the pair of towns whose joint intercept-based model has the smallest training mean squared error.
- Select five towns by forward greedy selection. Starting with no towns, repeatedly add the unused town that gives the smallest training mean squared error when fit jointly with the already selected towns and an intercept.
For every exact score tie, choose the lexicographically smaller town name or comma-joined town list. Round halfway values away from zero. All supplied predictor matrices have a unique least-squares solution.
Return columns metric, towns, and value in the exact row order shown below. Use null for towns on the two numeric-only rows and for value on the maximum-standard-deviation row. Pair names are comma-joined in lexicographic order; the five-town list is comma-joined in greedy selection order. The value for the last three selection rows is that model's training MSE.
Table schema
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
temperatures
One row per observed day, with NYC as the regression target and six town predictors.
| Column | Type | Nullable | Description |
|---|---|---|---|
| day_idPK | Integer | No | — |
| NYC | Decimal | No | — |
| Town1 | Decimal | No | — |
| Town2 | Decimal | No | — |
| Town3 | Decimal | No | — |
| Town4 | Decimal | No | — |
| Town5 | Decimal | No | — |
| Town6 | Decimal | No | — |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| metric | Text | No | — |
| towns | Text | Yes | — |
| value | Decimal | Yes | — |
Row order: must match exactly. Numeric tolerance: 0.000001.
Constraints
- The table has
8to1000rows. day_idvalues are distinct; input row order does not affect the result.- All temperatures are finite decimals with absolute value at most
10^6. - The six town columns contain no missing values.
- Every tested predictor matrix, including the intercept column, has a unique least-squares solution.
- Decimal results are compared with absolute or relative tolerance
10^-6.
More Citadel Phone Screen questions
- Speed Up a Slow FunctionOA · PHONE SCREEN · Seen Nov 2026
- Portfolio Tickers with Constant-Time Random PickPHONE SCREEN · Seen Nov 2026
- Square Root FunctionPHONE SCREEN · Seen Oct 2026
- Reachable Transfer PositionsPHONE SCREEN · Seen Oct 2026
- Spreadsheet Formula DependenciesPHONE SCREEN · Seen Oct 2026
- Currency Arbitrage CyclePHONE SCREEN · Seen Sep 2026
- Order Book with Cancel by Order IDPHONE SCREEN · Seen Sep 2026
- Smart Queue of Latest PricesPHONE SCREEN · Seen Sep 2026
- Merge Price-Delta FeedsPHONE SCREEN · Seen Sep 2026
- Reconcile Unmatched Trades with Timestamp TolerancePHONE SCREEN · Seen Sep 2026
Similar questions at other companies
- Best Starting Cell for Restaurant DistanceDoorDash · PHONE SCREEN
- Daily Temperature By TownTwo Sigma · OA
- Choose the Next Minesweeper ActionRunloop · PHONE SCREEN
- Best-Fit Plane Normal from 3D PointsThe Voleon Group · PHONE SCREEN
- Prefix Matrix Products and AutogradOpenAI · PHONE SCREEN · ONSITE INTERVIEW
- Maximize Adjacent Difference With One ReversalAmazon · PHONE SCREEN
- Implement Multi-Head AttentionApple · PHONE SCREEN
- Min Flips to Make Grid PalindromeGoogle · PHONE SCREEN
- Multi-Head Attention BlockScale AI · PHONE SCREEN
- Range of a Third CorrelationTower Research Capital · PHONE SCREEN
Citadel interview experiences
- Citadel Securities Quant Researcher Intern Loop: 1 Experience
- Citadel Securities Research Engineer Interview: 1 Experience
- Citadel Securities SWE Intern First Round: 2 Experiences
- Citadel Securities Experienced SWE Interviews: 1 Experience
- Citadel SWE Intern Later Rounds and Superday: 13 Experiences
- Citadel SWE Intern First-Round Questions: 20 Experiences