Apple Coding Interview Question: Find employees assigned to more than one project

17 Views
No Comments

CoderPad provides a basic SQL sandbox with the following schema.

You can also use commands like show tables and desc <table_name>.

employees

  • id (int)
  • first_name (varchar)
  • last_name (varchar)
  • salary (int)
  • department_id (int)

departments

  • id (int)
  • name (varchar)

projects

  • id (int)
  • title (varchar)
  • start_date (date)
  • end_date (date)
  • budget (int)

employees_projects

  • project_id (int)
  • employee_id (int)

Identify the employee IDs that have more than 1 project.

This SQL question asks you to find employee IDs that appear in more than one project assignment. The core idea is to group rows in the employees_projects junction table by employee_id, count the number of associated projects, and then filter the groups with HAVING COUNT(*) > 1. It is a straightforward aggregation problem focused on many-to-many relationships.

END
 0