Preparing for your next Quant Interview?
Practice Here!
OpenQuant
All Questions
Next Question
Most Profitable Strategy
00:00:00
4/10
Data Wrangling
Parts
Part 1

A quantitative hedge fund consists of a team of 35 traders. These traders execute trading strategies that fall into one of four categories: 'momentum', 'trend', 'mean reversion', and 'stat arb'.

Using the tables given below, for each trader that has made at least 5 trades of the same strategy in the past week, find their most profitable trading strategy and the profit they earned from that strategy. If more than one strategy is equally profitable, return the first trading strategy deployed. Output the trader's name, trading strategy and total profit. Sort the result by profit in descending order and name in ascending order

Example Output:

full_namestrategytotal_profit
Brian Humomentum7500
John Doetrend3300
Michael Lewisstat arb3300
Samuel Wellingtonmomentum1000

Tables:

traders

Column NameData Type
trader_idbigint
first_nametext
last_nametext
emailtext
ageint
joined_company_dtdatetime

trade_results

Column NameData Type
trade_idbigint
trader_idbigint
trade_execution_dtdatetime
profitbigint
strategytext