InterviewDB Experience

Haiku Substring: Find Substrings Matching a 5-7-5 Syllable Pattern

Interview Experience

Problem A haiku consists of three lines with syllable counts 5, 7, 5. You are given a sequence of words with known syllable counts. Find all contiguous subsequences of words that can be partitioned into three groups with syllable sums 5, 7, and 5 in order. Follow-ups How do you efficiently scan for valid 5-7-5 partitions using prefix sums? What if syllable counts are uncertain and vary by pronunciation — how do you enumerate possibilities? How would you extend this to detect other poetic forms (…

Full Details

🔒

Unlock all Faire questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a faire interview during the onsite round.

It covers the following topics: Coding, Onsite, Strings .