Percentage of Letter in String
A easy-tier problem at 74% community acceptance, tagged with String. Reported in interviews at American Express and 0 others.
You're staring at a string and a letter. Count how many times that letter appears as a percentage of the total. It sounds trivial, and it is, but American Express asks it, and easy problems can trip you up in live assessments if you overthink them or miss edge cases. The trick isn't the algorithm; it's staying calm and handling empty strings, case sensitivity, and off-by-one errors without blanking. If this one appears on your OA and you freeze, StealthCoder solves it invisibly in seconds.
Companies that ask "Percentage of Letter in String"
Percentage of Letter in String is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop.
Get StealthCoderThe pattern is straightforward: iterate through the string, count matches for your target letter, divide by string length, multiply by 100. The real gotcha is edge cases. What if the string is empty. What if the letter never appears. What if the input is case-sensitive or case-insensitive. Most candidates miss the empty-string divide-by-zero trap or assume case-insensitive matching when the problem doesn't say so. The obvious approach works fine here; there's no hidden optimization. What breaks candidates is careless implementation, not the concept. On a live assessment, this should take two minutes. If you're stuck past that, StealthCoder is your safety net to move forward.
Pattern tags
You know the problem.
Make sure you actually pass it.
Percentage of Letter in String recycles across companies for a reason. It's easy-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Percentage of Letter in String interview FAQ
Is this problem actually asked at American Express, or is it just listed in some database?+
Yes, American Express has confirmed it. The acceptance rate is 74.5%, which is high, so most people who attempt it solve it. That doesn't mean it's harmless; it gets asked at real onsites and online assessments. Underestimating easy problems is how candidates waste time or make careless errors.
What's the most common pitfall candidates hit on this problem?+
Forgetting to handle the empty string case. You'll divide by zero if you're not careful. Also, assuming case-insensitive when the problem says case-sensitive, or vice versa. Read the constraints once, code once, move on.
Do I need any fancy data structures or algorithms?+
No. A single loop and two counters are enough. If you're reaching for a hash map or regex, you're overthinking it. String manipulation, nothing more. Time complexity is O(n); space is O(1).
Is this problem still asked, or has American Express moved on to harder stuff?+
It's still asked. Easy problems don't go away; companies use them as warm-ups or early-stage filters. You'll see it in phone screens and online assessments. The high acceptance rate means it's a green light if you nail it; a mistake means you look careless.
How does this relate to real string interview patterns?+
It tests fundamental string iteration and edge-case handling. Once you master this, you're ready for harder string problems like anagrams, substrings, and transformations. It's a baseline check that you can code without bugs.
Want the actual problem statement? View "Percentage of Letter in String" on LeetCode →