Export Trade Records to CSV
Updated
Problem statement
A trading desk keeps its raw trade records in a trades table and needs them written to a CSV file. Using Pandas, build the table that will be written to that file.
Each row of trades is one trade. It has a trade_id, the time executed_at, a symbol, a side (BUY or SELL), a quantity of shares and a price per share. The time is text in the form MM/DD/YYYY HH:MM:SS, on a 24-hour clock.
Return one row per trade with exactly these columns, in this order:
trade_idtrade_time: the timeexecuted_atwritten in the ISO 8601 formYYYY-MM-DDTHH:MM:SS. For example,04/07/2025 09:30:05becomes2025-04-07T09:30:05.symbolsidequantitypricenotional: the value of the trade,quantity * price.
Sort the rows by time, earliest first. Break a tie by symbol in alphabetical order, and then by trade_id, smallest first.
The judge checks the table you return, the same table that to_csv(index=False) would then write to the file. A notional 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.
trades
One row per trade, as it arrives from the trading system.
| Column | Type | Nullable | Description |
|---|---|---|---|
| trade_idPK | Integer | No | Unique trade ID. |
| executed_at | Text | No | Execution time as MM/DD/YYYY HH:MM:SS (24-hour clock). |
| symbol | Text | No | Stock symbol. |
| side | Text | No | BUY or SELL. |
| quantity | Integer | No | Shares traded. |
| price | Decimal | No | Price per share. |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| trade_id | Integer | No | — |
| trade_time | Text | No | — |
| symbol | Text | No | — |
| side | Text | No | — |
| quantity | Integer | No | — |
| price | Decimal | No | — |
| notional | Decimal | No | — |
Row order: must match exactly. Numeric tolerance: 0.0001.
Constraints
tradeshas between1and500rows.trade_idvalues are unique, and1 <= trade_id <= 109.- Every
executed_atis a real date and time in the formMM/DD/YYYY HH:MM:SS, with two digits for the month, day, hour, minute and second, and a year from2000to2099. All times are in the same time zone. symbolhas 1 to 5 uppercase English letters.sideisBUYorSELL.1 <= quantity <= 100000 < price <= 10000, with at most 4 digits after the decimal point.
More Citadel Phone Screen questions
- Merge Price-Delta FeedsPHONE SCREEN · Seen Dec 2026
- Speed Up a Slow FunctionOA · PHONE SCREEN · Seen Nov 2026
- Portfolio Tickers with Constant-Time Random PickPHONE SCREEN · Seen Nov 2026
- Square Root FunctionPHONE SCREEN · Seen Oct 2026
- Reachable Transfer PositionsPHONE SCREEN · Seen Oct 2026
- Spreadsheet Formula DependenciesPHONE SCREEN · Seen Oct 2026
- Currency Arbitrage CyclePHONE SCREEN · Seen Sep 2026
- Order Book with Cancel by Order IDPHONE SCREEN · Seen Sep 2026
- Smart Queue of Latest PricesPHONE SCREEN · Seen Sep 2026
- Reconcile Unmatched Trades with Timestamp TolerancePHONE SCREEN · Seen Sep 2026
Similar questions at other companies
- Second Highest SalaryPaytm · PHONE SCREENPaytm interview questions
- Employees Who Earn More Than Their ManagersNykaa · PHONE SCREENNykaa interview questions
- Employees Who Joined More Than a Week AgoNewgen Software · PHONE SCREEN
- Departments Without EmployeesDell Technologies · PHONE SCREENDell Technologies interview questions
- Second-Highest Distinct SalaryChubb · PHONE SCREENChubb interview questions
- Swap Two Gender ValuesInfosys · PHONE SCREENInfosys interview questions
- Find Rows Common to Two TablesSalesforce · PHONE SCREENSalesforce interview questions
- Count Records Present in A but Not BCapital One · PHONE SCREENCapital One interview questions
- Customer Order Count Distribution by CountryApple · PHONE SCREENApple interview questions
- Employees Earning More Than Their ManagerMygate · PHONE SCREENMygate interview questions
Citadel interview experiences
- Citadel Securities Quant Researcher Intern Loop: 1 Experience
- Citadel Securities Research Engineer Interview: 1 Experience
- Citadel Securities SWE Intern First Round: 2 Experiences
- Citadel Securities Experienced SWE Interviews: 1 Experience
- Citadel SWE Intern Later Rounds and Superday: 13 Experiences
- Citadel SWE Intern First-Round Questions: 20 Experiences