InterviewDB Experience

Employees SQL: Query an HR Database to Report Headcount, Salaries, and Departmental Summaries

Interview Experience

Problem You have two tables: Query 1: For each department, return the department name, headcount, average salary (rounded to 2 decimals), and the highest-paid employee's name. Query 2: Find employees who earn more than their direct manager. Follow-ups Rewrite Query 1 in standard SQL (no vendor-specific KEEP ... DENSE_RANK). Departments with no employees should still appear -- is your join correct? Add a column showing each employee's salary percentile within their department. How would you index…

Full Details

🔒

Unlock all Square/Block questions

Full insider details, leaked discussions, and candidate experiences.

or every company, $100/year →

About This Question

This is a candidate experience report from a square/block interview.

It covers the following topics: Data Scientist, Sql .