FastPrepCount Buggy and Bug-Free Submissions per Employee
Problems/Count Buggy and Bug-Free Submissions per Employee

Count Buggy and Bug-Free Submissions per Employee

The Walt Disney Company logoThe Walt Disney Company● MediumFULLTIMEONSITE INTERVIEW
QuestionConstraints

Problem statement

Source note: The report gives employee and code-submission tables and asks for names with buggy and bug-free submission counts, ordered by employee name. This practice makes zero-submission employees explicit, uses non-null boolean flags, keeps duplicate names separate by employee ID and adds an ID tie-break. The tables and examples are illustrative practice data. About 90% of the reported query scope is represented, as an editorial estimate.

Return each employee’s name, number of buggy code submissions and number of bug-free code submissions. Sort by employee name ascending, then employee ID ascending to break ties.

For this exercise, every employee must appear, including those with no submissions; their two counts are zero. Join employees.id to code_submissions.employee_id. A true has_bug flag means buggy and false means bug-free. Flags are non-null, and every submission row counts once regardless of timestamp.

Group by employee identity, not name or department. Two employees with the same name remain two rows. Return columns employee_name, buggy_count and bug_free_count, in that order. Compare the simple ASCII names in case-sensitive ASCII order.

Table schema

MySQLPostgreSQLPandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

employees

One row per employee; names and departments may repeat.

ColumnTypeNullableDescription
idPKIntegerNoEmployee identifier.
nameTextNoEmployee name.
departmentTextNoDepartment, not an aggregation key.

code_submissions

Every row counts as one code submission.

ColumnTypeNullableDescription
submission_idPKIntegerNoUnique submission identifier.
employee_idIntegerNoEmployee owning this submission.
submitted_atTimestampNoWhole-second UTC submission time; not a filter.
has_bugBooleanNoTrue is buggy; false is bug-free. No null flags.

Foreign key: employee_id → employees(id)

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
employee_nameTextNoEmployee name; duplicate names retain distinct employee rows.
buggy_countIntegerNoNumber of this employee’s submissions with true has_bug.
bug_free_countIntegerNoNumber of this employee’s submissions with false has_bug.

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • All columns are non-null and each table follows its declared primary and foreign keys.
  • has_bug is a boolean; no unknown or null flag occurs.
  • Names and departments may repeat. Practice names use simple ASCII letters.
  • submitted_at is a whole-second UTC timestamp and does not restrict which submissions count.

More The Walt Disney Company problems

  • Find All Paths for a Name in a File SystemPHONE SCREEN · Seen Nov 2026
  • Resizable Array-Backed Integer SetPHONE SCREEN · Seen Sep 2026
  • Shortest Path with Directional Move CostsPHONE SCREEN · Seen Sep 2026
All The Walt Disney Company interview questionsSee The Walt Disney Company hiring insights