Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Rank Top SKUs and Forecast Next Quarter

HardSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Rank Top SKUs and Forecast Next Quarter. Start with the requirements and the one table on the right.

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.

Problem

You are given raw player transaction data from an Activision commerce feed. Build a summary view that identifies the top-performing SKUs by revenue and projects each SKU’s next-quarter performance using recent quarterly trends.

Your result should show the top SKUs ranked by current-quarter revenue, along with their quarter-over-quarter growth rate and a simple next-quarter revenue projection based on the latest two completed quarters. Use PostgreSQL syntax only.

Schema

player_transactions
ColumnTypeDescription
transaction_idPKBIGINTUnique transaction identifier
player_idBIGINTPlayer who made the purchase
sku_idVARCHAR(50)Purchased SKU identifier
sku_nameVARCHAR(255)Display name of the SKU
transaction_tsTIMESTAMPTransaction timestamp
unitsINTUnits purchased
gross_revenueNUMERIC(12,2)Revenue from the transaction
currency_codeCHAR(3)Currency code
transaction_statusVARCHAR(20)Status such as completed, refunded, or pending
Tablesplayer_transactions
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results