FastPrepBond Haircut by Ratings and Maturity
Problems/Bond Haircut by Ratings and Maturity

Bond Haircut by Ratings and Maturity

Jane Street logoJane Street● MediumFULLTIMENEW GRADOA

Updated Aug 2024

QuestionConstraints

Problem statement

Source note: Seen in six Jane Street trading desk operations reports from 2017 to 2024, all about the Excel test. The 2020 new-grad post shows its worked sheet for the bond task. Each bond has three agency ratings, a type, an issue size and a maturity, and it counts as investment grade when two of its three ratings are. The rate comes from a maturity table for municipal bonds, a maturity table for investment-grade corporate bonds, or an issue-size table for junk corporate bonds, and it is charged on the absolute market value. Its six bonds, as-of date, 365.5-day year and rate tables are our first example. A 2017 report mentions maturities, lookups and absolute values, a 2020 report says the rate depends on the kind of bond, and the other three give only the topic: haircuts on securities or bonds, or an Excel assessment built around bonds.

We kept those rules. Returning one row per bond instead of one total, using the municipal table whatever a municipal bond's ratings are, picking the table row with the largest bound not above the bond's value, listing only the needed ratings in the first example, the table and column names, the 0.0001 tolerance, the second example and the test data are ours.

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

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:

  1. Investment grade. The rating_scale table 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.
  2. Years to maturity. The single row of settings gives the as-of date and the number of days in a year. The years to maturity are the number of days from as_of_date to maturity_date, divided by days_per_year.
  3. Rate. A municipal bond uses the 'Muni' rows of maturity_haircuts, and an investment-grade corporate bond uses the 'Corp' rows. In both cases, take the row with the largest min_years that is at most the bond's years to maturity. A corporate bond that is not investment grade uses issue_size_haircuts instead: take the row with the largest min_issue_millions that 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

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.

bonds

Bond positions.

ColumnTypeNullableDescription
bond_idPKIntegerNoUnique position ID.
symbolTextNoBond identifier.
bond_typeTextNo'Corp' or 'Muni'.
maturity_dateDateNoDate the bond matures.
moodys_ratingTextNoMoody's rating, for example 'Baa3'.
sp_ratingTextNoS&P rating, for example 'BBB-'.
fitch_ratingTextNoFitch rating, for example 'BBB-'.
issue_size_usdIntegerNoSize of the original issue in dollars.
market_value_usdDecimalNoMarket value of the position, negative when short.

rating_scale

Whether each agency rating is investment grade.

ColumnTypeNullableDescription
agencyTextNo'MOODYS', 'SP' or 'FITCH'.
ratingTextNoRating on that agency's scale.
investment_gradeBooleanNoTrue when the rating is investment grade.

maturity_haircuts

Rates by years to maturity for municipal and investment-grade corporate bonds.

ColumnTypeNullableDescription
bond_typeTextNo'Muni' or 'Corp'.
min_yearsDecimalNoLower bound of the row, in years.
haircut_percentDecimalNoRate in percent.

issue_size_haircuts

Rates by issue size for corporate bonds that are not investment grade.

ColumnTypeNullableDescription
min_issue_millionsDecimalNoLower bound of the row, in millions of dollars.
haircut_percentDecimalNoRate in percent.

settings

One row with the as-of date and the year length.

ColumnTypeNullableDescription
as_of_dateDateNoDate the haircut is computed for.
days_per_yearDecimalNoNumber of days in a year.

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
symbolTextNo—
investment_gradeBooleanNo—
haircut_percentDecimalNo—
haircut_usdDecimalNo—

Row order: any order is accepted. Numeric tolerance: 0.0001.

Constraints

  • The bonds table has between 1 and 150 rows. bond_id and symbol values are unique.
  • bond_type is 'Corp' or 'Muni'.
  • settings has exactly one row, 360 <= days_per_year <= 366, and every maturity_date is on or after as_of_date and at most 50 years later.
  • Every bond's three ratings appear in rating_scale for their agency, and each (agency, rating) pair appears once.
  • 1 <= issue_size_usd <= 1012 and -1010 < market_value_usd < 1010, with at most 2 digits after the decimal point.
  • For each bond type, maturity_haircuts has a row whose min_years is 0, and no two rows of a type share the same min_years. issue_size_haircuts has a row whose min_issue_millions is 0, and its min_issue_millions values are unique.
  • All bounds are non-negative, and every haircut_percent is between 0 and 100, 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
All Jane Street interview questionsSee Jane Street hiring insights