Reported May 2026
Capital Onecounting

Count Numbers with Even Number of Digits

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

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

Capital One asked this in May 2026, and it's a straightforward digit-counting problem. You're given an array of integers and need to count how many have an even number of digits. The trick is handling the digit count correctly: convert to a string, check its length, skip the negative sign if present. This is a warm-up problem, not a trap. If you blank during the live OA, StealthCoder will feed you the pattern in seconds.

The problem

Complete the function below. The function receives the full standard input as a single string and must return the exact standard output lines for the described problem. Original prompt Problem Given an integer array nums (each number may have multiple digits and can include 0), return the count of elements whose number of digits in base-10 is even. The number of digits of x is the length of its decimal representation. For example, 7 has 1 digit, 12 has 2 digits, and 0 has 1 digit. Input An integer array nums Output An integer: the count of numbers with an even number of digits Constraints (typical) 1 <= len(nums) <= 1e5 0 <= nums[i] <= 1e9 Examples Input: [12, 345, 2, 6, 7896] → Output: 2 Input: [555, 901, 482, 1771] → Output: 1 Input: [0, 10, 100, 1000] → Output: 2 Input: [8] → Output: 0 Input: [22, 33, 4444, 5, 666666] → Output: 3 Function Description Complete solveOneCountEvenDigitNumbers. It has one parameter, String input, containing the full stdin payload. Return the stdout payload as an array of lines, without trailing newline characters. The returned string must match the expected standard output for the sample input. Use the limits and requirements stated in the prompt.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The pattern is simple: iterate the array, convert each number to a string (or use math to count digits), check if the length is even, and increment a counter. The gotcha is negative numbers: the problem doesn't mention them, but if they appear, strip the minus sign before counting. For zero, it has 1 digit, so it counts as odd. Most candidates solve this in under a minute. The only real edge case is ensuring you're counting decimal digits, not doing bit manipulation or other overthinking. StealthCoder is your hedge if you second-guess yourself on the digit-counting logic during the actual assessment.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Count Numbers with Even Number of Digits 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. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

Get StealthCoder

Related leaked OAs

⏵ The honest play

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

Capital One reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Count Numbers with Even Number of Digits FAQ

How do I count digits without converting to a string?+

Use math: take the absolute value, then repeatedly divide by 10 and count iterations. Or use a logarithm. Both work, but string conversion is cleaner and faster to code under time pressure. String approach is safer.

Does this problem care about negative numbers?+

The problem statement doesn't mention negatives, and the constraints show 0 <= nums[i], so all numbers are non-negative. Don't add complexity. Assume the input is always non-negative.

What counts as even digits: 2, 4, 6, 8, or something else?+

Even digits means the count of digits is even. So 12 has 2 digits (even), 345 has 3 digits (odd), 4444 has 4 digits (even). You're counting the length, not checking if the digits themselves are even numbers.

Is this problem asked often, or is it a one-off?+

This is a LeetCode easy and shows up in screening rounds often. It's a filter to make sure you can read a problem, iterate, and count. Expect it. If Capital One used it, other banks likely did too.

How do I prepare in 24 hours if I'm weak on this?+

You don't need prep. Read the problem once, code it once, test on the examples. If you can't solve this in 5 minutes, the issue is panic, not knowledge. Do one mock OA to build confidence, then trust yourself.

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

OA at Capital One?
Invisible during screen share
Get it