IBM Software Engineer Interview Experience — PostgreSQL Averages and HAVING for Resource Usage

IBM·Software Engineer·Aug 2026
Online Assessmentmedium

Write a PostgreSQL query to identify customers whose websites have excessively high average resource usage.
Table schemas:

  1. The customers table contains id (INT, primary key) and email (VARCHAR(255)).
  2. The site_metrics table contains customer_id (INT, foreign key), cpu_usage (DECIMAL(5,2)), memory_usage (DECIMAL(5,2)), and disk_usage (DECIMAL(5,2)).
    Specific requirements:
  3. The report must show customers whose average usage exceeds 50% for any resource: CPU, memory, or disk.
  4. The result must include email, average_cpu_usage (average CPU usage, rounded to 2 decimal places), average_memory_usage (average memory usage, rounded to 2 decimal places), and average_disk_usage (average disk usage, rounded to 2 decimal places).
  5. Sort the results by email in ascending order (ASC).
  6. Filtering logic: First calculate each customer's average usage across all websites, then select customers for whom average_cpu_usage > 50 or average_memory_usage > 50 or average_disk_usage > 50. That means using HAVING to filter the aggregated results, rather than using WHERE during the JOIN to filter individual records.

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
IBM
Role
Software Engineer
Rounds
Online Assessment
Difficulty
medium
Interview date
Aug 2026
Questions from this interview
1 question

Real IBM interview experiences

First-hand reports from IBM candidates — the rounds, the questions they were asked, and how it went.

All 15 IBM interview experiences