Return Duplicate Records
Updated
Problem statement
The records table contains two columns: category and amount. Return every distinct pair that appears more than once in the table. Return each qualifying pair once, without an occurrence-count column.
For this exercise, assume two pairs are equal when both corresponding values are equal, including two NULL values. Return the columns category and amount in that order.
Sort by category ascending, with NULL first, then by amount ascending, again with NULL first. An empty table or a table without repeated pairs produces no result 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.
records
| Column | Type | Nullable | Description |
|---|---|---|---|
| category | Text | Yes | Lowercase ASCII category label, or NULL. |
| amount | Integer | Yes | Integer amount, or NULL. |
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| category | Text | Yes | — |
| amount | Integer | Yes | — |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
- For this exercise, assume the table contains between 0 and 100 rows.
- A non-null category contains 1 to 10 lowercase ASCII letters.
- A non-null amount is an integer from -10000 to 10000, inclusive.
- Both columns may contain NULL. The table has no primary key, so 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