Reported March 2024
Zscalerstring

Count Sentences

Reported by candidates from Zscaler's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Zscaler OA. Under 2s to a working solution.
Founder's read

Zscaler sent you a Count Sentences problem in March. It's a string parsing question that sounds trivial but trips people up on edge cases. The OA wants to see if you actually think through punctuation rules or just regex and ship it. This is a string manipulation problem, and StealthCoder will catch you if you blank on the sentence terminator logic during the live assessment.

Pattern and pitfall

Count Sentences is a deceptive pattern recognition problem disguised as parsing. The trick isn't the counting itself. It's understanding what terminates a sentence. Period, question mark, exclamation point are the obvious ones, but you need to handle whitespace, edge cases like abbreviations (U.S., Dr., etc.), and consecutive punctuation marks. Most candidates overcomplicate with regex or miss that you need to count sentences bounded by punctuation and whitespace, not just punctuation frequency. The pattern is string iteration with careful state tracking. StealthCoder functions as a safety net if you freeze on the exact definition of a sentence boundary during the timed OA.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Count Sentences cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Zscaler's OA.

Zscaler reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Count Sentences FAQ

What counts as a sentence terminator for Zscaler's version?+

Almost certainly period, question mark, and exclamation point. The real test is whether you handle U.S.-style abbreviations and sequences like '...' correctly. Assume a sentence ends only when one of these punctuation marks is followed by a space or end of string.

Do I need to validate that sentences have content?+

Likely yes. An empty string or just punctuation should return 0. Verify with the test cases early. Most versions require at least one non-punctuation character per sentence to count it.

How do I handle multiple punctuation marks in a row?+

Treat them as a single sentence terminator. '!!!' or '?.' ends one sentence, not three. The key is to increment your count only once per terminator sequence, then skip whitespace to find the next sentence start.

Is this problem still in rotation at Zscaler or outdated?+

It was reported in March 2024, so it's current. String problems rotate in and out, but basic parsing questions like this stay live because they're quick and expose weak fundamentals fast.

Can I solve this in under 10 minutes?+

Yes, if you avoid overthinking. Don't try to be clever with regex. Iterate through the string once, track state, increment on punctuation plus whitespace or end-of-string. Edge case testing takes longer than the core logic.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Zscaler.

OA at Zscaler?
Invisible during screen share
Get it