Bond Haircut by Ratings and Maturity
Updated
Problem statement
A broker-dealer charges a risk haircut on each bond it holds. The bonds table lists the positions. Each bond has a type ('Corp' for a corporate bond, 'Muni' for a municipal bond), a maturity date, ratings from three agencies (Moody's, S&P and Fitch), the size of its original issue in dollars and the market value of the position in dollars (negative for a short position).
Find each bond's haircut rate as follows:
- Investment grade. The
rating_scaletable says, for each agency ('MOODYS','SP'or'FITCH') and rating, whether that rating is investment grade. A bond is investment grade when at least 2 of its 3 ratings are investment grade. - Years to maturity. The single row of
settingsgives the as-of date and the number of days in a year. The years to maturity are the number of days fromas_of_datetomaturity_date, divided bydays_per_year. - Rate. A municipal bond uses the
'Muni'rows ofmaturity_haircuts, and an investment-grade corporate bond uses the'Corp'rows. In both cases, take the row with the largestmin_yearsthat is at most the bond's years to maturity. A corporate bond that is not investment grade usesissue_size_haircutsinstead: take the row with the largestmin_issue_millionsthat is at most the bond's issue size in millions of dollars (issue_size_usd / 1000000).
The haircut in dollars is the absolute market value times the rate, divided by 100.
Return one row per bond with the columns symbol, investment_grade (true or false), haircut_percent and haircut_usd, in any order. A decimal answer is accepted when it is within 0.0001 of the exact value.
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.
bonds
Bond positions.
| Column | Type | Nullable | Description |
|---|---|---|---|
| bond_idPK | Integer | No | Unique position ID. |
| symbol | Text | No | Bond identifier. |
| bond_type | Text | No | 'Corp' or 'Muni'. |
| maturity_date | Date | No | Date the bond matures. |
| moodys_rating | Text | No | Moody's rating, for example 'Baa3'. |
| sp_rating | Text | No | S&P rating, for example 'BBB-'. |
| fitch_rating | Text | No | Fitch rating, for example 'BBB-'. |
| issue_size_usd | Integer | No | Size of the original issue in dollars. |
| market_value_usd | Decimal | No | Market value of the position, negative when short. |
rating_scale
Whether each agency rating is investment grade.
| Column | Type | Nullable | Description |
|---|---|---|---|
| agency | Text | No | 'MOODYS', 'SP' or 'FITCH'. |
| rating | Text | No | Rating on that agency's scale. |
| investment_grade | Boolean | No | True when the rating is investment grade. |
maturity_haircuts
Rates by years to maturity for municipal and investment-grade corporate bonds.
| Column | Type | Nullable | Description |
|---|---|---|---|
| bond_type | Text | No | 'Muni' or 'Corp'. |
| min_years | Decimal | No | Lower bound of the row, in years. |
| haircut_percent | Decimal | No | Rate in percent. |
issue_size_haircuts
Rates by issue size for corporate bonds that are not investment grade.
| Column | Type | Nullable | Description |
|---|---|---|---|
| min_issue_millions | Decimal | No | Lower bound of the row, in millions of dollars. |
| haircut_percent | Decimal | No | Rate in percent. |
settings
One row with the as-of date and the year length.
| Column | Type | Nullable | Description |
|---|---|---|---|
| as_of_date | Date | No | Date the haircut is computed for. |
| days_per_year | Decimal | No | Number of days in a year. |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| symbol | Text | No | — |
| investment_grade | Boolean | No | — |
| haircut_percent | Decimal | No | — |
| haircut_usd | Decimal | No | — |
Row order: any order is accepted. Numeric tolerance: 0.0001.
Constraints
- The
bondstable has between1and150rows.bond_idandsymbolvalues are unique. bond_typeis'Corp'or'Muni'.settingshas exactly one row,360 <= days_per_year <= 366, and everymaturity_dateis on or afteras_of_dateand at most 50 years later.- Every bond's three ratings appear in
rating_scalefor their agency, and each (agency, rating) pair appears once. 1 <= issue_size_usd <= 1012and-1010 < market_value_usd < 1010, with at most 2 digits after the decimal point.- For each bond type,
maturity_haircutshas a row whosemin_yearsis0, and no two rows of a type share the samemin_years.issue_size_haircutshas a row whosemin_issue_millionsis0, and itsmin_issue_millionsvalues are unique. - All bounds are non-negative, and every
haircut_percentis between0and100, with at most 2 digits after the decimal point.
More Jane Street interview questions
- Product Profit SummaryOA · Seen Sep 2026
- Cheating CodemakerOA · Seen Mar 2026
- Currency Haircut with FX ForwardsOA · Seen Aug 2024
- Transform StringOA · Seen Jul 2024
- Price Deviation AlertsOA · Seen Nov 2023
- Trade Blotter Summary by TickerOA · Seen Jun 2021
- Biggest Daily Move and Longest Rising StreakOA · ONSITE INTERVIEW · Seen Apr 2021
- Transaction Fees by InstrumentOA · Seen Mar 2018
- Maximum-Scoring Consecutive Tree LevelsPHONE SCREEN · Seen Nov 2026
- Tree Selection and VisibilityPHONE SCREEN · Seen Nov 2026
Similar questions at other companies
- Bond Holders Above the Cash Flow ThresholdBirla Pivot · OA
- Prepare Taxi Driver Classification DataBoston Consulting Group · OABoston Consulting Group interview questions
- Find the Dominant SellerSquadStack.ai · OA
- Track the Book and Mark Final PnLMillennium · OAMillennium interview questions
- Market Share Ticker with ImbalanceWolverine Trading · OAWolverine Trading interview questions
- Overloaded Game Account InventoriesWells Fargo · OAWells Fargo interview questions
- Transaction Totals and Ranked Failure ReasonsIntuit · OAIntuit interview questions
- Employees Joined per MonthOdoo · OAOdoo interview questions
- Customer Order FeesAdobe · OAAdobe interview questions
- Process Airline Seat RequestsAgoda · OAAgoda interview questions
Interview reports that mention this question
- Jane Street TDO UK and Hong Kong: 22 Experiences (Part 10 of 10)
- Jane Street TDO Phone Math Round: 26 Experiences (Part 9 of 10)
- Jane Street TDOE UK Phone Screen: 15 Experiences (Part 4 of 10)
- Jane Street TDO Excel and VBA Test: 23 Experiences (Part 8 of 10)
- Jane Street TDOE Interviews: 165 Experiences (Part 1 of 10)
- Jane Street TDOE New Grad Interview Questions: 11 Experiences