Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Monthly Trader Insight Summary
00:00
5 left

Monthly Trader Insight Summary

MediumSQL · PostgreSQL

Problem

You are given trading activity data from a platform such as Wolverine Trading's internal analytics environment. Write a PostgreSQL query that returns one row per trader for February 2024, showing each trader's name, team, number of executed orders, total filled quantity, gross trading revenue, and an activity label of High Activity, Moderate Activity, or Low Activity based on executed order count. Include traders even if they had no executed orders in February.

Use only February 2024 orders, count only rows where status = 'EXECUTED', and classify traders as High Activity for 3+ executed orders, Moderate Activity for 1-2, and Low Activity for 0.

Schema

traders
ColumnTypeDescription
trader_idPKINTPrimary key for each trader
trader_nameVARCHAR(100)Trader full name
team_idINTReference to the trader's team
start_dateDATEDate the trader joined
teams
ColumnTypeDescription
team_idPKINTPrimary key for each team
team_nameVARCHAR(100)Team name
orders
ColumnTypeDescription
order_idPKINTPrimary key for each order
trader_idINTReference to the trader who placed the order
symbolVARCHAR(20)Traded symbol
order_dateDATEOrder date
statusVARCHAR(20)Order status such as EXECUTED or CANCELLED
filled_qtyINTFilled quantity for the order
gross_revenueDECIMAL(12,2)Gross revenue generated by the order
Tablestradersteamsorders
Interviewer

Your question is Monthly Trader Insight Summary. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.