Measure Liquidity
Updated
Problem statement
Use the prices and requests tables to calculate one liquidity score for each of Asset_1, Asset_2, and Asset_3.
Metric definitions
- Sort prices by
timestamp. Treat prices as exact decimal values. For each asset, calculate each adjacent return ascurrent_price / previous_price - 1, round that return to12decimal places using round-half-away-from-zero for an exact tie, and then define volatility as the sample standard deviation of the rounded returns. - Define request frequency as the number of requests for an asset divided by the total number of rows in
requests. - Min-max normalize the three volatility values together and the three frequency values together. If a metric has zero range, use
0.5as that metric's normalized value for every asset.
Liquidity score
For each asset, calculate 0.1 + 0.9 * (0.5 * (1 - volatility_normalized) + 0.5 * frequency_normalized). Round the final score to 6 decimal places using the same round-half-away-from-zero rule and return rows in ascending asset-name order.
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.
prices
Exact decimal prices for the three assets at timezone-neutral whole-second timestamps.
| Column | Type | Nullable | Description |
|---|---|---|---|
| timestampPK | Timestamp | No | Timezone-neutral observation time in whole-second YYYY-MM-DD HH:MM:SS precision. |
| Asset_1 | Decimal | No | — |
| Asset_2 | Decimal | No | — |
| Asset_3 | Decimal | No | — |
requests
Observed requests. Each row contributes once to request frequency.
| Column | Type | Nullable | Description |
|---|---|---|---|
| request_idPK | Integer | No | — |
| asset | Text | No | — |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| asset | Text | No | — |
| liquidity_score | Decimal | No | — |
Row order: must match exactly. Numeric tolerance: 0.000001.
Constraints
- The
pricestable contains at least3rows and at most2000rows. - Every timestamp is unique, timezone-neutral, and uses whole-second
YYYY-MM-DD HH:MM:SSprecision. - Every asset price is a strictly positive exact decimal value representable as
DECIMAL(38, 12). - The
requeststable contains at least1row and at most2000rows. - Every request asset is exactly
Asset_1,Asset_2, orAsset_3. - Use sample standard deviation, equivalent to
ddof=1in Pandas. - Return exactly three rows ordered by
assetascending.
More Millennium Online Assessment questions
- Calculate the Half SpreadOA · Seen Sep 2026
- Debug the Impact ModelOA · Seen Sep 2026
- Debug the Risk-Limit QuoterOA · Seen Sep 2026
- Hedge Inventory with Return CovarianceOA · Seen Sep 2026
- Quote One RequestOA · Seen Sep 2026
- Risk Limits and Inventory SkewOA · Seen Sep 2026
- Track the Book and Mark Final PnLOA · Seen Sep 2026
- Clean the TapeOA · Seen Sep 2026
- Client Markout AnalysisOA · Seen Sep 2026
- Debug Fair-Value LookupOA · Seen Sep 2026
Similar questions at other companies
- Summarize Taxi Drivers and RidesBoston Consulting Group · OABoston Consulting Group interview questions
- Customer Order FeesAdobe · OAAdobe interview questions
- Expected Profit of a Doubling Betting SystemOptiver · OAOptiver interview questions
- Magic Number Range CounterGraviton · OA
- At Most K Jumps with Quadratic Transition CostInfosys · OAInfosys interview questions
- Delete and Freeze GameRubrik · OARubrik interview questions
- Lock CodeVisa · OAVisa interview questions
- Bootstrap Decision Tree ClassifierPinterest · OAPinterest interview questions
- Maximum Signal Walk in a Server TreeTower Research Capital · OA
- Ordered-Pair Checksum SumBirla Pivot · OA