PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Expedia

Count vowel-only substrings with all vowels

Last updated: May 14, 2026

Quick Overview

This question evaluates string-processing and algorithm design skills, specifically the use of sliding-window/two-pointer techniques and linear-time algorithmic optimization for counting substrings, and falls under the Coding & Algorithms domain with an emphasis on practical application rather than purely conceptual theory.

  • Medium
  • Expedia
  • Coding & Algorithms
  • Software Engineer

Count vowel-only substrings with all vowels

Company: Expedia

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Given a lowercase English string s, return the number of contiguous substrings that ( 1) consist only of vowels from the set {a, e, i, o, u}, and ( 2) contain each of the five vowels at least once. Constraints: 1 <= |s| <= 200000. Design an O(n) time solution using a sliding-window/two-pointer approach with O( 1) extra space. Explain how you handle consonants that break windows, repeated vowels, and long runs of vowels. Provide code and analyze time and space complexity.

Quick Answer: This question evaluates string-processing and algorithm design skills, specifically the use of sliding-window/two-pointer techniques and linear-time algorithmic optimization for counting substrings, and falls under the Coding & Algorithms domain with an emphasis on practical application rather than purely conceptual theory.

Related Interview Questions

  • Solve three interview coding problems - Expedia (hard)
Expedia logo
Expedia
Aug 9, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
8
0

Given a lowercase English string s, return the number of contiguous substrings that (

  1. consist only of vowels from the set {a, e, i, o, u}, and (
  2. contain each of the five vowels at least once. Constraints: 1 <= |s| <= 200000. Design an O(n) time solution using a sliding-window/two-pointer approach with O(
  3. extra space. Explain how you handle consonants that break windows, repeated vowels, and long runs of vowels. Provide code and analyze time and space complexity.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

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