FastPrepRisk Limits and Inventory Skew
Problems/Risk Limits and Inventory Skew

Risk Limits and Inventory Skew

Millennium logoMillennium● MediumNEW GRADINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Our version is about 99% the same as the reported question. Decimal inputs are turned into whole numbers on an exact 10^-7 grid so every language runs the same way. The limits keep the input scaling clear. They also keep all derived integer products small enough for Python integers, Java BigInteger, and C++ __int128.

Decide whether to accept, widen, or reject one market-making quote request while respecting liquidity-scaled inventory limits.

Use these values:

  • hard = baseLimit * liquidityScore
  • soft = softFraction * hard
  • signedQuantity = -quantity for BUY and +quantity for SELL
  • projected = currentInventory + signedQuantity

Apply the rules in order:

  1. If abs(projected) > hard, return ["reject", "null"].
  2. Otherwise compute skew = -skewCoefficient * currentInventory. The base BUY quote is reference + halfSpread + skew; the base SELL quote is reference - halfSpread + skew.
  3. If abs(projected) > soft, the action is widen and one extra halfSpread is added for BUY or subtracted for SELL. Otherwise the action is accept.

Every decimal input is exact and has at most seven digits after the decimal point. Return a two-element string array [action, quote]. A non-rejected quote is rounded half upward to six decimal places and serialized with exactly six digits after the decimal point.

Function

decideRequest(currentInventory: int, side: String, quantity: int, reference: double, halfSpread: double, liquidityScore: double, baseLimit: int, softFraction: double, skewCoefficient: double) → String[]

Examples

Example 1

currentInventory = 0side = "BUY"quantity = 100reference = 100.0halfSpread = 0.05liquidityScore = 1.0baseLimit = 50000softFraction = 0.6skewCoefficient = 0.0001return = ["accept","100.050000"]

The projected inventory is -100, which is inside both limits. Current inventory is zero, so skew is zero and the base BUY quote is 100.050000.

Example 2

currentInventory = 300side = "BUY"quantity = 50reference = 100.0halfSpread = 0.05liquidityScore = 0.5baseLimit = 1000softFraction = 0.3skewCoefficient = 0.001return = ["widen","99.800000"]

The hard and soft limits are 500 and 150. Projected inventory is 250, so the request is widened. Skew is -0.3; the base quote 99.75 receives one extra 0.05 on the BUY side.

Constraints

  • -10^9 <= currentInventory <= 10^9
  • side is either BUY or SELL.
  • 1 <= quantity <= 10^9
  • 0 < reference <= 2 * 10^8 and 0 <= halfSpread <= 10^6.
  • 0.1 <= liquidityScore <= 1.
  • 1 <= baseLimit <= 10^9 and 0 <= softFraction <= 1.
  • 0 <= skewCoefficient <= 10^3.
  • Each decimal input has at most seven digits after the decimal point.
  • Every non-rejected quote is positive and at most 10^12.

Source note: The original assessment screenshot defines the liquidity-scaled limits, signed trade direction, skew, widening rule, and output action.

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
  • 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
  • Debug the Tape CleanerOA · Seen Sep 2026

Similar questions at other companies

  • Bold Play to Reach a GoalSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Last Object Exit TimeIBM · OAIBM interview questions
  • Capping Portfolio WeightsCapstone Investment Advisors · OA
  • Repeated Mirror XORMathWorks · OAMathWorks interview questions
  • Stacked Item and Category DiscountsPalantir · OAPalantir interview questions
  • Find Total CostJP Morgan Chase · OAJP Morgan Chase interview questions
  • Macaron Order PriceOpenAI · OAOpenAI interview questions
  • Daily Settlement for Long and Short PositionsBelvedere Trading · OA
  • Prime Factor VisitationMaven Securities · OAMaven Securities interview questions
  • Proportional Momentum Investment StatisticsOptiver · OAOptiver interview questions

Millennium interview experiences

  • Millennium Full Stack Engineer Java Interview: 1 Experience
All Millennium interview questionsSee Millennium hiring insights
Saved
class Solution {
    public String[] decideRequest(int currentInventory, String side, int quantity, double reference, double halfSpread, double liquidityScore, int baseLimit, double softFraction, double skewCoefficient) {
        // write your code here
    }
}
Checking account…