Maximize vacation streak with PTO

Quick Overview

This question evaluates proficiency in algorithmic problem-solving with arrays, specifically reasoning about consecutive subarray computations, linear-time scanning techniques, and the ability to analyze time and space complexity.

Maximize vacation streak with PTO

Company: Meta

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

##### Question Given an array of characters containing 'w' (workday) and 'h' (holiday) and an integer n representing the number of PTO days you can convert from workdays, design an algorithm to find the maximum possible length of consecutive days off (holidays plus converted PTO days). Explain the time and space complexity and outline a sliding-window solution.

Quick Answer: This question evaluates proficiency in algorithmic problem-solving with arrays, specifically reasoning about consecutive subarray computations, linear-time scanning techniques, and the ability to analyze time and space complexity.

|Home/Coding & Algorithms/Meta
Meta logo
Meta
Aug 4, 2025, 10:55 AM
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
12
0
Question

Given an array of characters containing 'w' (workday) and 'h' (holiday) and an integer n representing the number of PTO days you can convert from workdays, design an algorithm to find the maximum possible length of consecutive days off (holidays plus converted PTO days). Explain the time and space complexity and outline a sliding-window solution.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...