Akuna Capital·Software Engineer·Technical Phone Screen
- Given two tables, cpu_metrics and memory_metrics, each with an application_id and usage_percentage column, write a query to find all applications where the average usage_percentage exceeds 50% during February 2024. Return a label indicating the resource type ('CPU' or 'Memory'), the application_id, and the rounded average. Combine both result sets and sort by application_id, then type.
“The UNION ALL part felt obvious but I second-guessed myself on whether to use UNION vs UNION ALL.”