Letter Case Permutation
A medium-tier problem at 75% community acceptance, tagged with String, Backtracking, Bit Manipulation. Reported in interviews at Yelp and 0 others.
Letter Case Permutation is a medium-difficulty string problem with a 75% acceptance rate, asked at Yelp and other companies during their online assessments. You're given a string with letters and digits, and you need to generate all possible combinations by swapping the case of each letter while keeping digits unchanged. The problem looks straightforward until you realize you need to handle exponential output: a 10-character string with 5 letters produces 32 different permutations. Most candidates either over-complicate it with nested loops or miss the bit-manipulation trick that makes the solution elegant. If this problem hits your live OA and you blank on the pattern, StealthCoder surfaces a working solution invisible to the proctor in seconds.
Companies that ask "Letter Case Permutation"
Letter Case Permutation 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. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know.
Get StealthCoderThe trap here is thinking you need nested recursion or complex state tracking. The real insight is that each letter is a binary choice: uppercase or lowercase. Bit manipulation solves this cleanly: iterate from 0 to 2^(number of letters) - 1, and use each bit to decide whether the letter at that position is uppercase or lowercase. Backtracking also works, but it's slower and easier to miswrite under pressure. Candidates often forget to identify which characters are actually letters first, or they mutate the input string incorrectly. The acceptance rate of 75% suggests most people get a solution working, but a chunk miss the optimal approach or have off-by-one bugs in their loop bounds. This is exactly the kind of problem where the difference between 'passes test cases' and 'passes with clean code' comes down to pattern recognition. StealthCoder is your hedge if you freeze on which technique to reach for.
Pattern tags
You know the problem.
Make sure you actually pass it.
Letter Case Permutation recycles across companies for a reason. It's medium-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. Made by a working FAANG engineer who treats the OA the way companies treat hiring: as a game with rules you should know. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Letter Case Permutation interview FAQ
Is backtracking or bit manipulation expected here?+
Both work, but bit manipulation is cleaner and faster. You map each number 0 to 2^(letter count)-1 to a unique permutation. Backtracking is more intuitive but requires careful state management. At Yelp and similar companies, either passes, but interviewers notice when you choose the optimal one.
What's the main gotcha candidates miss?+
Forgetting to identify letters vs digits first. Many iterate over the entire string and try to toggle case on digits, which breaks. You need to extract letter positions upfront, then use your bit or backtracking logic to build permutations. Off-by-one errors in loop bounds are common too.
How many test cases should I expect?+
Expect edge cases: empty string, string with no letters (only digits), single letter, mixed case input, and longer strings (8-12 characters). The 75% acceptance rate suggests the test suite is fair but catches careless implementations. Time limit is usually generous since output size dominates.
Does this problem relate to other backtracking patterns?+
Yes. It shares DNA with Permutations and Combinations problems: you're exploring a search space systematically. But the bit-manipulation approach decouples it from classic backtracking, making it unique. Understanding both techniques helps you recognize when to use each in future problems.
Will I see this at other companies besides Yelp?+
The data shows Yelp, but mid-tier tech companies and startups ask string permutation variants frequently. It's not a top-tier FAANG staple, but it appears often enough in OAs that it's worth drilling the pattern. The 75% rate suggests it's a reliable filter question.
Want the actual problem statement? View "Letter Case Permutation" on LeetCode →