FastPrepWeekend Appointments for Consular Services Rescheduling

Weekend Appointments for Consular Services Rescheduling

McKinsey & Company logoMcKinsey & Company● EasyFULLTIMEOA

Problem statement

A consular-services dashboard needs to identify appointments scheduled on weekends so that staff can reschedule them to working days. List all appointments whose scheduled date falls on Saturday or Sunday.

Appointment data

The appointments table contains one row per appointment:

ColumnTypeMeaning
emailtextEmail address of the user who made the appointment.
scheduled_appointmentdateThe appointment's scheduled calendar date.

Required result

  • email: the appointment's email address, unchanged.
  • scheduled_appointment: the English day name Saturday or Sunday.

Include only weekend appointments. Sort by email ascending. For this exercise, email ordering is case-sensitive ASCII order, and equal emails are ordered by the output day name ascending: Saturday before Sunday.

Keep one result row for every matching appointment, including duplicate rows. If no appointment is on a weekend, return an empty result with these two columns. The task only identifies the appointments; do not choose new dates or modify the input.

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.

appointments

ColumnTypeNullableDescription
emailTextNoUnchanged user email address.
scheduled_appointmentDateNoScheduled calendar date without a time or timezone.

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
emailTextNo—
scheduled_appointmentTextNo—

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

Constraints

  • 0 <= number of appointments <= 2000.
  • Both columns are non-null.
  • Email values are nonempty ASCII strings of at most 254 characters. Preserve their spelling and case.
  • Scheduled dates are valid Gregorian calendar dates from 2000-01-01 through 2100-12-31. They contain no time or timezone component.
  • The input is not necessarily sorted, and multiple rows may contain the same email or date.

More McKinsey & Company problems

See McKinsey & Company hiring insights