PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Google

Solve meeting-room scheduling and shortest paths

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in interval scheduling and resource allocation as well as shortest-path computation in weighted directed graphs, emphasizing event ordering, efficient priority structures and graph traversal techniques.

  • medium
  • Google
  • Coding & Algorithms
  • Software Engineer

Solve meeting-room scheduling and shortest paths

Company: Google

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

You are asked to solve two algorithmic problems. ## Part A: Meeting-room scheduling (intervals) You are given an array of meeting time intervals `intervals`, where each interval is `[start, end)` with `0 <= start < end`. 1. **Attend-all check**: Return `true` if a single person can attend all meetings (i.e., no overlaps), else `false`. 2. **Minimum rooms**: Return the minimum number of conference rooms required to host all meetings. 3. **Room assignment / most-used room (optional extension)**: You have `n` rooms labeled `0..n-1`. Schedule meetings in start-time order using the lowest-index available room; if none are available at a meeting’s start, delay the meeting until the earliest room becomes free (preserving meeting duration). Return the room index that hosted the most meetings (tie → smallest index). ### Constraints (assume) - `1 <= intervals.length <= 2e5` - Times are integers up to `1e9` ## Part B: Shortest path in a weighted directed graph Given a weighted **directed** graph with `V` nodes labeled `0..V-1` and `E` edges. Each edge is `(u, v, w)` with `w > 0`. - Input: `V`, edge list, `source s`, `target t`. - Output: the shortest distance from `s` to `t` (and optionally the actual path). If `t` is unreachable, return `-1`. ### Constraints (assume) - `1 <= V <= 2e5`, `0 <= E <= 2e5` - Weights are positive integers.

Quick Answer: This question evaluates proficiency in interval scheduling and resource allocation as well as shortest-path computation in weighted directed graphs, emphasizing event ordering, efficient priority structures and graph traversal techniques.

Related Interview Questions

  • Solve Rooms and Top-K Streams - Google (medium)
  • Find Containing Range - Google (medium)
  • Rearrange Tasks With Cooldown - Google (medium)
  • Implement Employee Management and Expression Evaluation - Google (medium)
  • Solve Three Array and Matrix Path Problems - Google (medium)
Google logo
Google
Jan 6, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
7
0
Loading...

You are asked to solve two algorithmic problems.

Part A: Meeting-room scheduling (intervals)

You are given an array of meeting time intervals intervals, where each interval is [start, end) with 0 <= start < end.

  1. Attend-all check : Return true if a single person can attend all meetings (i.e., no overlaps), else false .
  2. Minimum rooms : Return the minimum number of conference rooms required to host all meetings.
  3. Room assignment / most-used room (optional extension) : You have n rooms labeled 0..n-1 . Schedule meetings in start-time order using the lowest-index available room; if none are available at a meeting’s start, delay the meeting until the earliest room becomes free (preserving meeting duration). Return the room index that hosted the most meetings (tie → smallest index).

Constraints (assume)

  • 1 <= intervals.length <= 2e5
  • Times are integers up to 1e9

Part B: Shortest path in a weighted directed graph

Given a weighted directed graph with V nodes labeled 0..V-1 and E edges. Each edge is (u, v, w) with w > 0.

  • Input: V , edge list, source s , target t .
  • Output: the shortest distance from s to t (and optionally the actual path). If t is unreachable, return -1 .

Constraints (assume)

  • 1 <= V <= 2e5 , 0 <= E <= 2e5
  • Weights are positive integers.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Google•More Software Engineer•Google Software Engineer•Google Coding & Algorithms•Software Engineer Coding & Algorithms
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.