FastPrepMeasure Liquidity
Problems/Measure Liquidity

Measure Liquidity

Millennium logoMillennium● HardNEW GRADINTERNOA

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: Reported in a Millennium online assessment for new grad and intern roles. The report gives the score formula, the fallback for normalization, and the final rounding rule. It leaves out complete input schemas, how precise timestamps are, and sample tables. Here timestamps are whole seconds with no time zone, and prices are exact decimals. Adjacent returns and final scores round half away from zero, so every supported language agrees. These choices do not change the calculation in the report in any real way.

Our version is about 96% the same as the reported question.

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 as current_price / previous_price - 1, round that return to 12 decimal 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.5 as 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

MySQLPostgreSQLPandas

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.

ColumnTypeNullableDescription
timestampPKTimestampNoTimezone-neutral observation time in whole-second YYYY-MM-DD HH:MM:SS precision.
Asset_1DecimalNo—
Asset_2DecimalNo—
Asset_3DecimalNo—

requests

Observed requests. Each row contributes once to request frequency.

ColumnTypeNullableDescription
request_idPKIntegerNo—
assetTextNo—

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
assetTextNo—
liquidity_scoreDecimalNo—

Row order: must match exactly. Numeric tolerance: 0.000001.

Constraints

  • The prices table contains at least 3 rows and at most 2000 rows.
  • Every timestamp is unique, timezone-neutral, and uses whole-second YYYY-MM-DD HH:MM:SS precision.
  • Every asset price is a strictly positive exact decimal value representable as DECIMAL(38, 12).
  • The requests table contains at least 1 row and at most 2000 rows.
  • Every request asset is exactly Asset_1, Asset_2, or Asset_3.
  • Use sample standard deviation, equivalent to ddof=1 in Pandas.
  • Return exactly three rows ordered by asset ascending.

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

Millennium interview experiences

  • Millennium Full Stack Engineer Java Interview: 1 Experience
All Millennium interview questionsSee Millennium hiring insights