Reported September 2026
IBM

Customer Resource Usage Analysis

Reported by candidates from IBM's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live IBM OA. Under 2s to a working solution.
Founder's read

The IBM Customer Resource Usage Analysis question, reported in September 2026, hides its trick in one sentence: apply the threshold before rounding. It's a SQL problem, so no algorithm here. You join customers to site_metrics, average three columns per customer, filter, round, and sort by email. The statement even says to use exact decimals and round halves away from zero. If your mind goes blank on the HAVING clause, StealthCoder runs invisibly during the live OA as a safety net. Most people lose points on the filter order, not the join.

The problem

A web-hosting provider tracks resource usage for every customer's sites. Using the customers and site_metrics tables, create a report with email, average_cpu_usage, average_memory_usage, and average_disk_usage.
Compute each average across all metric rows belonging to that customer.
Include a customer only when at least one unrounded average is strictly greater than 50.
Round each returned average to two decimal places.
Order rows by email ascending.
For this exercise, customer IDs and emails are unique, every metric row references a customer, and all values are non-null. Customers without metric rows are omitted. Calculate with exact decimals, apply the threshold before rounding, and round halfway values away from zero.
In MySQL and PostgreSQL, write a query over the supplied tables. In Pandas, implement customer_resource_report(customers, site_metrics) and return a DataFrame with the four result columns in the stated order.

Tables
customers: id PK (Integer), email (Text)
site_metrics: customer_id (Integer), cpu_usage (Decimal), memory_usage (Decimal), disk_usage (Decimal)

Constraints
0 <= customers.length <= 1000
0 <= site_metrics.length <= 100000
Customer IDs are signed 32-bit integers and are unique.
Email values are nonempty and unique.
CPU, memory, and disk usage are exact decimals from 0 through 100, with at most two fractional digits.
Every metric row references an existing customer, and no table cell is null.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The pattern is join, GROUP BY, HAVING, then ROUND in the SELECT. Join customers to site_metrics on id = customer_id, group by id and email, and compute AVG for cpu_usage, memory_usage and disk_usage. In HAVING, use the raw averages with OR: AVG(cpu_usage) > 50 OR AVG(memory_usage) > 50 OR AVG(disk_usage) > 50. Only then wrap each average in ROUND(..., 2) in the SELECT list. The classic pitfall is filtering on rounded values, so 50.004 gets rounded to 50.00 and wrongly excluded or included. Another trap is using a LEFT JOIN, which would keep customers with no metrics. The statement says to omit them, so an inner join is right. Decimal columns keep the math exact, so don't cast to float. Order by email ascending. If you blank on any of this during the live OA, StealthCoder can supply the query as a hedge.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Customer Resource Usage Analysis cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass IBM's OA.

IBM reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Customer Resource Usage Analysis FAQ

How hard is the IBM Customer Resource Usage Analysis question really?+

It's easy to medium. There's no tricky logic, just a join, grouping and a filter. The difficulty is in the details: filtering before rounding, using OR across three averages, and omitting customers without metrics. If you know HAVING, you can finish it quickly.

What's the main trick in this query?+

Apply the threshold to the unrounded averages in HAVING, then round only in the SELECT. The statement says strictly greater than 50 on unrounded values. Filtering on rounded values changes which customers appear, and that's the most likely reason a submission fails hidden tests.

Should I use INNER JOIN or LEFT JOIN here?+

Use INNER JOIN. The problem says customers without metric rows are omitted. A LEFT JOIN would produce NULL averages for them, and those rows would fail the greater-than-50 check anyway. The inner join is cleaner and says what you mean.

Do I need to worry about rounding differences between MySQL and PostgreSQL?+

Yes, a little. The statement asks for exact decimals and halves rounded away from zero. ROUND on DECIMAL or NUMERIC values in both engines does that. Avoid casting to float, because binary floating point can nudge a value like 2.675 the wrong way.

How do I prepare for this in 48 hours?+

Write the query from scratch two or three times on a small sample. Practice GROUP BY with HAVING, ROUND placement, and ORDER BY. Then test edge cases: an average of exactly 50, a customer with one row, and an empty table. That covers nearly everything this question can throw at you.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with IBM.

OA at IBM?
Invisible during screen share
Get it