Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Event Scheduling App – Conflicts and Sorting
00:00
5 left

Event Scheduling App – Conflicts and Sorting

MediumPython

Problem

Take-home: given a JSON file of events (title, start time, end time), build a simple app that lists the events sorted by start time and marks which events conflict in time with others; explain the algorithm choice and time/space complexity. Due in 3 days.

Asked in the take-home project stage. Offered as an alternative to the algorithm phone screen; followed by a call with a Facebook engineer to discuss the approach.

Input and Output

Implement def mark_conflicting_events(events):. Each event is a dictionary with string fields title, start_time, and end_time, using ISO 8601 timestamps. Return copied event dictionaries sorted by start_time, adding boolean conflicts. Two events conflict when one starts before the other ends. Events touching at an endpoint do not conflict.

Example: [A 09:00-10:00, B 09:30-11:00] returns both with conflicts: true. Non-overlapping events return false.

Constraints

  • 1 <= len(events) <= 100000
  • Each event contains title, start_time, and end_time
  • Timestamps are valid ISO 8601 values in the same timezone
  • start_time is earlier than end_time
  • Events that share an endpoint do not conflict

Function Signature

def mark_conflicting_events(events):
Interviewer

Your question is Event Scheduling App – Conflicts and Sorting. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
Sign up free to run your codeLog inLn 2
Run your code to see test output here.