Party Time by Town and Quiet Gaps by City
Updated
Problem statement
All parties occur during one day represented by integer minutes 0..1440.
Each string in parties has partyId start end for a half-open interval [start,end). Each string in geography has partyId town city state.
- For each town, union all of its party intervals and report total party minutes.
- For each city, union all party intervals and report every positive quiet gap between consecutive merged blocks. Do not include time before the city's first party or after its last party.
Return town lines first in town-name order as TOWN name minutes, then city lines in city-name order as CITY name gapStart-gapEnd,..., or NONE when there is no internal gap.
Function
summarizePartyTime(parties: String[], geography: String[]) → String[]Examples
Example 1
parties = ["p1 60 120","p2 100 180","p3 240 300"]geography = ["p1 North Metro CA","p2 North Metro CA","p3 South Metro CA"]return = ["TOWN North 120","TOWN South 60","CITY Metro 180-240"]North's overlapping parties merge to [60,180). Metro has one quiet gap before the South party.
Example 2
parties = ["a 0 30","b 30 60"]geography = ["a X C S","b X C S"]return = ["TOWN X 60","CITY C NONE"]Touching intervals form one continuous block.
Example 3
parties = ["a 10 20","b 40 50","c 0 5"]geography = ["a T1 C1 S","b T1 C1 S","c T2 C2 S"]return = ["TOWN T1 20","TOWN T2 5","CITY C1 20-40","CITY C2 NONE"]Outputs are grouped and sorted by geographic name.
Constraints
1 <= parties.length == geography.length <= 200000.- Party IDs are unique and appear once in each input.
0 <= start < end <= 1440.- Names contain no whitespace.
More Scale AI Phone Screen questions
- Four-Player Trick-Taking Card Game SimulationOA · PHONE SCREEN · Seen Aug 2026
- Task Processor: Dependencies and DeadlinesPHONE SCREEN · Seen Aug 2026
- Best Poker Category with a JokerPHONE SCREEN · ONSITE INTERVIEW · Seen Jun 2026
- Free Time for Every Meeting RoomPHONE SCREEN · Seen Apr 2026
- Free Windows Between Busy IntervalsOA · PHONE SCREEN · Seen Apr 2026
- Order Queries by Shortest Processing TimePHONE SCREEN · Seen Apr 2026
- Party Windows and Dead Zone TimePHONE SCREEN · Seen Oct 2025
- Overlap Duration of Two Time IntervalsPHONE SCREEN · Seen Jun 2025
- Multi-Head Attention BlockPHONE SCREEN · Seen Mar 2025
- Top-K SamplerPHONE SCREEN · Seen Mar 2025
Similar questions at other companies
- Merchant Capacity Interval MergeDoorDash · PHONE SCREENDoorDash interview questions
- Highlight and Rank Overlapping CitationsHarvey · PHONE SCREEN · ONSITE INTERVIEWHarvey interview questions
- Merge Collinear Point SegmentsApplied Intuition · PHONE SCREENApplied Intuition interview questions
- Lab and Consultation Appointment MatchingAssort Health · PHONE SCREENAssort Health interview questions
- Unique Active Pins by Time SegmentPinterest · ONSITE INTERVIEWPinterest interview questions
- Peak Process MemoryNutanix · ONSITE INTERVIEWNutanix interview questions
- Calendar Event System with Pagination and IntersectionLead Bank · ONSITE INTERVIEWLead Bank interview questions
- Top Error Types in a Time WindowNotion · ONSITE INTERVIEWNotion interview questions
- Worker Management with Promotions and Double-Paid TimeInstacart · ONSITE INTERVIEWInstacart interview questions
- Worker Management (Promotion Track), Part 4: Full-Shift Double PayAirbnb · OAAirbnb interview questions
Scale AI interview experiences
- Scale AI OA: What It Tests (2026)
- Scale AI Forward Deployed Engineer Debugging Round: 1 Experience
- Scale AI ML Research Engineering Intern Interviews: 1 Experience
- Scale AI SWE Intern Debugging Interview: 9 Experiences
- Scale AI New Grad SWE and MLE Question Bank
- Scale AI New Grad SWE Poker Screen and Onsite: 1 Experience