← Capital One Interview Insights

Capital One·Software Engineer·Online Assessment (OA)·Junior

Junior
May 2026

Summary

Pretty quick Capital One screening for a software engineer role. One coding question, nothing that required much thought, and it was over.

Questions Asked (1)

Q1

Given a list of integers, return the count of numbers that have an even number of digits.

Algorithms & Data Structures
Author's notes

Solved it pretty much immediately.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints (e.g., input size, integer range) and then propose a solution that iterates through the list, counts the digits of each number, and increments a counter if the digit count is even. Discuss time and space complexity, and consider edge cases like zero and negative numbers.

Pro tip: Mention that you can avoid string conversion by using a loop to count digits, which is more efficient and shows deeper understanding. Also, proactively discuss how you would handle negative numbers by taking absolute value.

1. Clarify the problem

Ask questions to confirm details: What is the range of integers? Can numbers be negative? Should zero be considered as having 1 digit (odd) or 0 digits (even)? What is the expected input size?

2. Outline the approach

Explain that you will iterate through each number, compute its digit count, check if it's even, and maintain a counter. Mention that digit count can be found by converting to string or by repeatedly dividing by 10.

3. Discuss implementation details

Describe how to handle negative numbers (use absolute value) and zero (special case). If using division, handle zero separately. If using string, be aware of the minus sign.

4. Analyze complexity

State that the time complexity is O(n * d) where n is the number of elements and d is the average number of digits, which is effectively O(n) for fixed-size integers. Space complexity is O(1) if not using extra space.

5. Test with examples

Walk through a small example, such as [12, 345, 2, 6, 7896], and show that 12 (2 digits, even), 345 (3, odd), 2 (1, odd), 6 (1, odd), 7896 (4, even) yields count 2. Also test edge cases like [0] and [-12].

Key Points to Mention

  • Handling negative numbers by taking absolute value
  • Special case for zero (1 digit, odd)
  • Two methods for counting digits: string conversion vs. division loop
  • Time complexity O(n) and space complexity O(1)
  • Edge cases: empty list, single element, all even/odd digit counts
  • Potential follow-up: optimize for large numbers or streaming input

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.