FastPrepMeetup Schedule πŸ“†
Problems/Meetup Schedule πŸ“†

Meetup Schedule πŸ“†

WeRide logoWeRide● MediumINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

A start-up owner wants to meet investors to raise money. Investor i is available from day firstDay[i] to day lastDay[i], and both of those days count. The owner can hold at most one meeting per day, and each investor needs only one meeting. Return the largest number of meetings the owner can hold.

For example, take firstDay = [1, 2, 3, 3, 3] and lastDay = [2, 3, 4, 4, 4]. Only days 1 to 4 are available to anyone, so at most 4 meetings fit, and the answer is 4.

Complete the function maxMeetings in the editor.

maxMeetings has the following parameters:

  1. int[] firstDay: the first day each investor is available
  2. int[] lastDay: the last day each investor is available

The function returns an int: the maximum number of meetings that can be held.

Function

maxMeetings(firstDay: int[], lastDay: int[]) β†’ int

Examples

Example 1

firstDay = [1, 2, 3, 3, 3]lastDay = [2, 3, 4, 4, 4]return = 4

There are 5 investors, numbered 0 to 4.

  • Investor 0 is available on days 1 to 2.
  • Investor 1 is available on days 2 to 3.
  • Investors 2, 3 and 4 are available on days 3 to 4.

Days 1, 2, 3 and 4 are the only days anyone is free, so at most 4 meetings fit. The owner can reach 4: investor 0 on day 1, investor 1 on day 2, investor 2 on day 3 and investor 3 on day 4. Investor 4 has no free day left, so the answer is 4.

Constraints

  • 1 ≀ n ≀ 105, where n is the length of firstDay and lastDay
  • 1 ≀ firstDay[i] ≀ lastDay[i] ≀ 109

More WeRide interview questions

  • Drawing EdgeOA Β· Seen Aug 2026
  • Paint the CeilingOA Β· Seen Aug 2026
  • Unequal Block StructureOA Β· Seen Aug 2026
  • Checking Your Route πŸš—OA Β· Seen Mar 2024
  • Long BreakOA Β· Seen Feb 2024

Similar questions at other companies

  • Maximum Compatible Time WindowsIBM Β· OAIBM interview questions
  • Task SchedulingJP Morgan Chase Β· OAJP Morgan Chase interview questions
  • Minimum Markers to Clear Line SegmentsHSBC Β· OAHSBC interview questions
  • Minimum Machines for TasksExpedia Β· OAExpedia interview questions
  • Minimum SegmentsSnowflake Β· OASnowflake interview questions
  • Meeting RoomWeWork Β· OAWeWork interview questions
  • Most Disjoint Intervals From Starts and DurationsDocuSign Β· OADocuSign interview questions
  • University Career FairRoblox Β· OARoblox interview questions
  • Minimum RetailersAmazon Β· OA
  • Calculate Minimum Satellites RequiredGoogle Β· OAGoogle interview questions
All WeRide interview questionsSee WeRide hiring insights
Saved
class Solution {
    public int maxMeetings(int[] firstDay, int[] lastDay) {
        // write your code here
    }

}
Checking account…