Grouped Totals in Report Order
Updated
Problem statement
The entries table contains a category and an integer amount for each record. Produce one report row for each category present in the table.
For this exercise, assume the report has columns category, record_count, and total_amount, in that order. Count all records in the category, including repeated rows, and sum their amounts.
Sort by total amount from largest to smallest. Break equal-total ties by category in ascending order. Categories with a total of zero still appear. An empty input table returns no rows.
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.
entries
| Column | Type | Nullable | Description |
|---|---|---|---|
| category | Text | No | Lowercase ASCII category label. |
| amount | Integer | No | Nonnegative integer amount. |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| category | Text | No | — |
| record_count | Integer | No | — |
| total_amount | Integer | No | — |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
- For this exercise, assume the input table has between 0 and 100 rows.
- Category labels contain 1 to 10 lowercase ASCII letters.
- Amounts are integers from 0 through 1000000, inclusive.
- Neither column is NULL. The table has no primary key, and repeated rows are allowed.
More Intuit Online Assessment questions
- Employee Promotion OpportunitiesOA · Seen Oct 2026
- Next Pascal Row CoefficientOA · Seen Oct 2026
- Parse Router LogsOA · Seen Oct 2026
- Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
- Maximum Square-Free DivisorOA · Seen Oct 2026
- Two Tribes from Taller-Person CountsOA · Seen Oct 2026
- Shortest Path from an Encoded GraphOA · Seen Sep 2026
- Oldest and Youngest EmployeesOA · Seen Sep 2026
- Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
- Submask Sum QueriesOA · Seen Sep 2026
Similar questions at other companies
- Students Scoring Above AverageCapstone Investment Advisors · OA
- Bond Interest Summary Above 3%Wells Fargo · OAWells Fargo 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
- First Duplicate Transaction Within Ten MinutesLenskart · OA