FastPrepMaximum Meetings from Start Times and Durations
Problems/Maximum Meetings from Start Times and Durations

Maximum Meetings from Start Times and Durations

Morgan Stanley logoMorgan Stanley● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Morgan Stanley online assessment for a full-time role. The author gives starting times and durations, and asks for the most meetings one person can attend. The author links the standard activity-selection problem. Here the finish time is start plus duration. We follow that problem's strict rule that the next start must be after the previous finish. We chose the limits, positive durations, what happens for empty input, and the function interface.

Our version is about 90% the same as the reported question.

Meeting i starts at start[i] and has duration duration[i]. Its finish time is start[i]+duration[i]. Return the maximum number of meetings one person can attend in full.

For this exercise, a selected meeting must start strictly after the previous selected meeting finishes. Equality is not allowed: intervals sharing an endpoint cannot both be selected. All durations are positive. You may select meetings in any order that obeys this rule.

Return 0 for empty input. Return only the maximum count, and leave both input arrays unchanged.

Function

maxMeetings(start: int[], duration: int[]) → int

Examples

Example 1

start = [1,3,0,5,8,5]duration = [1,1,6,2,1,4]return = 4

The intervals are [1,2],[3,4],[0,6],[5,7],[8,9],[5,9]. Selecting indices 0,1,3,4 gives four compatible meetings. Exhaustive subset review confirms no fifth can be added.

Example 2

start = [1,3,5]duration = [2,2,2]return = 2

The intervals are [1,3],[3,5],[5,7]. Neighboring intervals touch and cannot both be selected. Choosing the first and third is valid because 5>3, so the maximum count is 2.

Constraints

  • For this exercise, assume 0 <= start.length <= 2000.
  • For this exercise, assume 0 <= duration.length <= 2000.
  • start and duration have equal length.
  • Every start time is between 0 and 1000000, inclusive.
  • Every duration is between 1 and 1000000, inclusive.

More Morgan Stanley Online Assessment questions

  • Three-Resource 0/1 KnapsackOA · Seen Sep 2026
  • Maximum Concurrent ProcessesOA · ONSITE INTERVIEW · Seen Sep 2026
  • Maximum Total of Nonadjacent RatingsOA · Seen Jul 2026
  • Count Shipment SchedulesOA · Seen Apr 2026
  • Delete and EarnOA · Seen Apr 2026
  • Interleave Array HalvesOA · Seen Apr 2026
  • Get Patch SequenceOA · Seen Feb 2025
  • String Subsequences 🐳OA · Seen Mar 2024
  • Binary Tree Level OrderOA · Seen Feb 2024
  • Merge IntervalsOA · Seen Feb 2024

Similar questions at other companies

  • Minimum Satellite Data Transfer IterationsHSBC · OAHSBC interview questions
  • Minimum Cost to Select People for Skill QuotasVisa · OAVisa interview questions
  • Get Maximum EventsAmazon · OA
  • Maximize Wall HitsOpenAI · OAOpenAI interview questions
  • Find Niceness 🌺Goldman Sachs · OAGoldman Sachs interview questions
  • Maximum Length Pair ChainInMobi · ONSITE INTERVIEWInMobi interview questions
  • Find Minimum TimeAlphaSense · OA
  • Find Minimum TimeBlackRock · OABlackRock interview questions
  • Maximum Easy Tasks After RearrangingIBM · OAIBM interview questions
  • Maximum Escape Game ScoreMicrosoft · OAMicrosoft interview questions

Interview reports that mention this question

  • Morgan Stanley Apprenticeship and Tech Interviews: 6 Experiences

Morgan Stanley interview experiences

  • Morgan Stanley New Grad Technology Analyst: 2 Experiences
  • Morgan Stanley Intern Oldest Loops: 5 Experiences (Part 5 of 5)
  • Morgan Stanley Intern OOP Loops: 5 Experiences (Part 4 of 5)
  • Morgan Stanley Intern Earlier Loops: 5 Experiences (Part 3 of 5)
  • Morgan Stanley Intern Tech Rounds: 5 Experiences (Part 2 of 5)
All Morgan Stanley interview questionsSee Morgan Stanley hiring insights
Saved
class Solution {
    public int maxMeetings(int[] start, int[] duration) {
        // Write your code here.
    }

}
Checking account…