Quote One Request
Updated
Problem statement
Quote one client request around a reference price. First add a size penalty to the supplied half spread:
adjustedHalfSpread = halfSpread + penaltyPerUnit * quantity
For a BUY request, form the ask price reference + adjustedHalfSpread and round it upward to the next multiple of tickSize. For a SELL request, form the bid price reference - adjustedHalfSpread and round it downward to the next multiple of tickSize. A price already on a tick remains unchanged.
Every decimal input is exact and has at most seven digits after the decimal point. Return the tick-rounded quote rounded half upward to six decimal places.
Function
quoteOneRequest(reference: double, halfSpread: double, penaltyPerUnit: double, quantity: int, side: String, tickSize: double) → doubleExamples
Example 1
reference = 100.0halfSpread = 0.05penaltyPerUnit = 0.0002quantity = 100side = "BUY"tickSize = 0.01return = 100.07The adjusted half spread is 0.05 + 0.0002 * 100 = 0.07. The raw ask 100.07 is already on a 0.01 tick.
Example 2
reference = 100.0halfSpread = 0.05penaltyPerUnit = 0.0002quantity = 125side = "SELL"tickSize = 0.01return = 99.92The adjusted half spread is 0.075, so the raw bid is 99.925. Rounding downward to a 0.01 tick gives 99.92.
Constraints
0 < reference <= 2 * 10^80 <= halfSpread <= 10^60 <= penaltyPerUnit <= 10^31 <= quantity <= 10^6sideis eitherBUYorSELL.10^-6 <= tickSize <= 10^3.- Each decimal input has at most seven digits after the decimal point.
- The raw quote and the rounded quote are positive and at most
2 * 10^8.
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
- 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
- Debug the Tape CleanerOA · Seen Sep 2026
Similar questions at other companies
- Basic Item DiscountsPalantir · OAPalantir interview questions
- Diagonal Bounce TraversalAutodesk · OAAutodesk interview questions
- Costliest ChocolateRippling · OARippling interview questions
- Distinct Chapters Missed During a Cyclic AbsenceVisa · OAVisa interview questions
- Count Palindromic Base RepresentationsSEDEMAC · OA
- Reduce a Number to One DigitAccenture · OAAccenture interview questions
- Online No-Intercept Linear RegressionTwo Sigma · OATwo Sigma interview questions
- Plus Mult ArrayIBM · OAIBM interview questions
- Product Minus Sum of DigitsTikTok · OATikTok interview questions
- Progressive Tax CalculatorInteractive Brokers · OA