Transaction Fees by Instrument
Updated
Problem statement
A broker charges a fee on every trade. The instruments table gives each symbol an instrument_type, and the fee_schedule table gives the fee rule for each type. The trades table lists the trades, each with a symbol, a quantity of units and a price per unit.
The fee on one trade is worked out from the rule of its instrument's type:
- The trade value is
quantity * price. - The rate is in basis points. One basis point is 0.01%, so the rate part is
trade value * rate_bps / 10000. - The unit part is
quantity * per_unit_fee. - The fee is the rate part plus the unit part, but never less than
minimum_fee. The minimum applies to each trade on its own.
Return one row for every symbol in instruments, with these columns:
symboltrade_count: the number of trades in that symbol.total_fee: the sum of the fees on those trades, or0when the symbol has no trades.
Return the rows in any order. A fee total 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.
instruments
One row per instrument.
| Column | Type | Nullable | Description |
|---|---|---|---|
| symbol | Text | No | Instrument symbol. |
| instrument_type | Text | No | Type that decides the fee rule. |
fee_schedule
One fee rule per instrument type.
| Column | Type | Nullable | Description |
|---|---|---|---|
| instrument_type | Text | No | Instrument type. |
| rate_bps | Decimal | No | Fee rate in basis points of the trade value. |
| per_unit_fee | Decimal | No | Fee per unit traded. |
| minimum_fee | Decimal | No | Smallest fee on one trade. |
trades
One row per trade.
| Column | Type | Nullable | Description |
|---|---|---|---|
| trade_idPK | Integer | No | Unique trade ID. |
| symbol | Text | No | Instrument traded. |
| quantity | Integer | No | Units traded. |
| price | Decimal | No | Price per unit. |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| symbol | Text | No | — |
| trade_count | Integer | No | — |
| total_fee | Decimal | No | — |
Row order: any order is accepted. Numeric tolerance: 0.0001.
Constraints
instrumentshas between1and100rows, and itssymbolvalues are unique.fee_schedulehas between1and20rows, itsinstrument_typevalues are unique, and every type used ininstrumentsappears in it.tradeshas between1and2000rows,trade_idvalues are unique, and every trade'ssymbolappears ininstruments.symbolandinstrument_typehave 1 to 20 characters: English letters, digits, spaces, dots and underscores. No twosymbolvalues, and no twoinstrument_typevalues, differ only in letter case.1 <= quantity <= 10000and0 < price <= 10000, with at most 4 digits after the decimal point.0 <= rate_bps <= 100and0 <= minimum_fee <= 1000, each with at most 2 digits after the decimal point.0 <= per_unit_fee <= 10, with at most 4 digits after the decimal point.
More Jane Street interview questions
- Product Profit SummaryOA · Seen Sep 2026
- Cheating CodemakerOA · Seen Mar 2026
- Bond Haircut by Ratings and MaturityOA · Seen Aug 2024
- 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
- Maximum-Scoring Consecutive Tree LevelsPHONE SCREEN · Seen Nov 2026
- Tree Selection and VisibilityPHONE SCREEN · Seen Nov 2026
Similar questions at other companies
- Students Scoring Above AverageCapstone Investment Advisors · OA
- Bond Interest Summary Above 3%Wells Fargo · OAWells Fargo interview questions
- Employee Promotion OpportunitiesIntuit · OAIntuit interview questions
- Students and Their SubjectsBirla Pivot · OA
- Companies with Average Salary Above 40000AT&T · OAAT&T interview questions
- Build Taxi Driver Performance FeaturesBoston Consulting Group · OABoston Consulting Group interview questions
- Weekend Appointments for Consular Services ReschedulingMcKinsey & Company · OAMcKinsey & Company interview questions
- Companies Above a Salary ThresholdVerisk · OA
- Customer Resource Usage AnalysisIBM · OAIBM interview questions
- Customers Who Never OrderedAccenture · OAAccenture interview questions
Interview reports that mention this question
Jane Street interview experiences
- Jane Street TDO UK and Hong Kong: 22 Experiences (Part 10 of 10)
- Jane Street TDOE US Final Round: 11 Experiences (Part 5 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 TDOE UK Coding Round: 15 Experiences (Part 3 of 10)