Counting Six Character Recovery Codes With a Letter and a Digit
Last updated: November 29, 2026
Quick Overview
Account recovery codes are 6 characters drawn from 26 lowercase letters and 10 digits, and policy requires at least one letter and at least one digit. How many valid codes exist, what fraction of all strings is that, and how many guesses does a random attacker need for a 1% success chance?
Meta
November 29, 20260
0
0 solved
Account recovery codes are 6 characters drawn from 26 lowercase letters and 10 digits, and policy requires at least one letter and at least one digit. How many valid codes exist, what fraction of all strings is that, and how many guesses does a random attacker need for a 1% success chance?
Account security at Meta involves sizing code spaces against brute force with rate limits, and this question checks combinatorial counting tied to a security decision. The interviewer wants inclusion-exclusion done correctly and a sensible translation into attacker effort.
What the Interviewer Expects
- Counts total strings as 36 to the 6th
- Subtracts all-letter and all-digit strings with no overlap issue
- Gets 1,866,866,560 valid codes
- Converts to a guess budget for a target success probability
- Comments on whether the composition rule actually helps security
Key Topics to Cover
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
- How does the count change if codes must contain at least two digits?
- Does the composition rule increase or decrease entropy compared with unrestricted codes?
- How many attempts per hour can you allow if a code lives 15 minutes and risk must stay below one in a million?
- How would you count codes with no repeated character?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Browse Statistics QuestionsSample Answer
Clarify
Alphabet: 36 symbols (26 letters, 10 digits), length 6, order matters, repetition allowed. Valid means at least one letter and at least one digit. The attacker guesses uniformly at random among valid ...
Approach
Complement: a string is invalid if it has no digit (all letters) or no letter (all digits). These two sets are disjoint for length at least 1, so inclusion-exclusion has no overlap term....