PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates understanding of interval scheduling and related algorithmic concepts, including complexity analysis, handling of boundary conditions, and management of large input sizes.

  • medium
  • Morgan Stanley
  • Coding & Algorithms
  • Data Scientist

Compute maximum non-overlapping meetings

Company: Morgan Stanley

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Assume you are given a list of meeting time intervals for a single person. Each meeting i is represented by a pair of integers [start_i, end_i], where 0 <= start_i < end_i, and all times are in the same unit. You can attend at most one meeting at any given time, and you must attend a meeting for its entire duration if you choose it. Meetings that touch at a boundary (for example, one ends at time t and another starts at time t) do not overlap and can both be attended. Write a function that, given the list of intervals, returns the maximum number of meetings you can attend by selecting a subset of non-overlapping intervals. You may assume: - 1 <= n <= 2 * 10^5 - |start_i|, |end_i| <= 10^9 Clarify the algorithmic problem and return the maximum count of meetings; implementation details are not required here.

Quick Answer: This question evaluates understanding of interval scheduling and related algorithmic concepts, including complexity analysis, handling of boundary conditions, and management of large input sizes.

Return the maximum number of full meetings that can be attended when boundary-touching meetings are allowed.

Constraints

  • Inputs are provided as Python literals matching the function signature.
  • Return a deterministic exact-match result.

Examples

Input: ([[0,30],[5,10],[10,20]],)

Expected Output: 2

Explanation: Choose two short meetings.

Input: ([[1,2],[2,3],[3,4]],)

Expected Output: 3

Explanation: Touching boundaries allowed.

Input: ([],)

Expected Output: 0

Explanation: No meetings.

Hints

  1. Choose a representation that makes the core operation simple.
  2. Handle empty and boundary inputs before the main algorithm.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Implement Factorial and Squares - Morgan Stanley (medium)
  • How do you escape the circle? - Morgan Stanley (medium)
  • Compute win probability in coin-toss game - Morgan Stanley (easy)
  • Compute minimal cost to merge numbers - Morgan Stanley (Medium)
  • Count decodings of a digit string - Morgan Stanley (Medium)