Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Coding Interview Mix

MediumPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Coding Interview Mix. Start with the requirements on the right.

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.

Problem

Tell me about the coding interview mix you expect, including LeetCode-style questions and discussion of your projects.

For the LeetCode-style portion, implement an interval-merging algorithm. Given a list of integer intervals [start, end], return a new list containing all overlapping or touching intervals merged together.

Function contract: def merge_intervals(intervals): accepts a list of interval lists and returns a list of merged interval lists.

Constraints

  • 0 <= intervals.length <= 1000
  • Each interval contains exactly two integers
  • start <= end for every interval
  • -10^9 <= start, end <= 10^9
  • The output must be sorted by interval start

Function Signature

def merge_intervals(intervals):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output