Question bank › Strings
Dsa Strings Easy

Reversed Vowel Count

Write a program that reads a string and counts the number of vowels that appear in reverse order. The string may contain uppercase and lowercase letters, spaces, and punctuation. Print the count of vowels that match their reverse positions in the input string. For example, in the string 'A man, a plan, a canal, Panama', the vowels in reverse order are 'amaaaana', which matches the positions: 'a' at index 0 matches 'a' at index 35, 'a' at index 1 matches 'a' at index 30, etc. Input Format: A single line of text containing the input string. Output Format: An integer representing the count of vowels that match the criteria. Example: Input: A man, a plan, a canal, Panama Output: 5

Key concepts

stringscountingtwo-pointer

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.