Customer Order Fees
Updated
Problem statement
Calculate the total order fees for every customer.
customers(customer_id, customer_name)lists customers.orders(order_id, customer_id, side, amount)lists their orders. The side isBUYorSELL.
A BUY order pays 0.01% of its amount. A SELL order pays 0.015%. Sum the exact, unrounded fees for each customer, then round that customer's total to two decimal places, with exact halfway values rounded up.
Return customer_id, customer_name and total_fees, ordered by increasing customer ID. Include customers with no orders and report 0.00 for them. Customers with the same name remain separate.
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.
customers
| Column | Type | Nullable | Description |
|---|---|---|---|
| customer_idPK | Integer | No | — |
| customer_name | Text | No | — |
orders
| Column | Type | Nullable | Description |
|---|---|---|---|
| order_idPK | Integer | No | — |
| customer_id | Integer | No | — |
| side | Text | No | — |
| amount | Decimal | No | — |
Foreign key: customer_id → customers(customer_id)
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| customer_id | Integer | No | — |
| customer_name | Text | No | — |
| total_fees | Decimal | No | — |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
- Customer IDs and order IDs are unique within their tables.
- Each order references an existing customer and has side BUY or SELL.
- For this exercise, assume 0 <= amount <= 1000000000, with at most 12 decimal places.
- For this exercise, assume at most 100000 customers and 1000000 orders. Customer names are nonempty text of at most 100 characters.
- Use exact decimal arithmetic; round once after each customer's fee total is summed.
Source note: Original OA report excerpt. The source note explains the schema, grouping, and rounding rules added for practice.
More Adobe Online Assessment questions
- Base Unit ConversionsOA · Seen Nov 2026
- Rotate an Array In PlaceOA · PHONE SCREEN · Seen Aug 2026
- Top-Funded Villages and ProjectsOA · Seen Aug 2026
- Count Parent Nodes With a Target SumOA · Seen Aug 2026
- Largest Binary Number by ConcatenationOA · Seen Aug 2026
- Count Events by CategoryOA · Seen Aug 2026
- Graph M-ColoringOA · Seen Aug 2026
- Hall of Shifting TilesOA · Seen Aug 2026
- K-th Ancestor Subtree Preorder QueryOA · Seen Aug 2026
- Maze ReachabilityOA · Seen Aug 2026
Similar questions at other companies
- Prepare Taxi Driver Classification DataBoston Consulting Group · OABoston Consulting Group interview questions
- Hedge Inventory with Return CovarianceMillennium · OAMillennium interview questions
- Last Object Exit TimeIBM · OAIBM interview questions
- Count Prime Values in SubtreesVisa · OAVisa interview questions
- Minimum Rounds to Complete All TasksInfosys · OAInfosys interview questions
- Server Upgrade PlanningWells Fargo · OAWells Fargo interview questions
- Capping Portfolio WeightsCapstone Investment Advisors · OA
- Gaussian Naive Bayes Classifier (Machine Learning OA)Pinterest · OAPinterest interview questions
- Bold Play to Reach a GoalSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Count Subarrays with a Perfect-Square ProductMicrosoft · OAMicrosoft interview questions
Adobe interview experiences
- Adobe New Grad OA: Unit Conversion and Code Review: 1 Experience
- Adobe Web, QA, DevOps, ML Roles: 13 Experiences (Part 3 of 3)
- Adobe SWE Interviews, Level Unknown: 25 Experiences (Part 2 of 3)
- Adobe Interviews, Level Unknown: 38 Experiences (Part 1 of 3)
- Adobe New Grad MTS Interview Questions: 7 Experiences
- Adobe ML/Research Intern Interviews: 12 Experiences (Part 4 of 4)