PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates proficiency in numeric digit analysis and parity-based counting, testing the competency to reason about decimal representations of integers within the Coding & Algorithms domain at a practical application level. It is commonly asked to assess basic algorithmic thinking, efficient iteration and counting skills, and careful handling of edge cases in technical interviews.

  • Capital One
  • Coding & Algorithms
  • Software Engineer

Count Numbers With Odd Zeros

Company: Capital One

Role: Software Engineer

Category: Coding & Algorithms

Interview Round: Technical Screen

Given an array `a` of non-negative integers, count how many elements contain an odd number of digit `'0'` in their decimal representation. Notes: - Treat the number `0` as having one zero digit. - Do not count leading zeros, since the numbers are given as integers. Example: - Input: `a = [20, 11, 10, 10070, 7]` - Output: `3` Explanation: - `20` contains 1 zero - `11` contains 0 zeros - `10` contains 1 zero - `10070` contains 3 zeros - `7` contains 0 zeros So there are 3 numbers with an odd number of zeros.

Quick Answer: This question evaluates proficiency in numeric digit analysis and parity-based counting, testing the competency to reason about decimal representations of integers within the Coding & Algorithms domain at a practical application level. It is commonly asked to assess basic algorithmic thinking, efficient iteration and counting skills, and careful handling of edge cases in technical interviews.

Given an array `a` of non-negative integers, return how many elements contain an odd number of digit `'0'` in their decimal representation. Important rules: - Treat the number `0` as having one zero digit. - Do not count leading zeros, since the values are given as integers. Example: - `a = [20, 11, 10, 10070, 7]` - `20` has 1 zero, `11` has 0, `10` has 1, `10070` has 3, `7` has 0 - So the answer is `3`.

Constraints

  • 0 <= len(a) <= 100000
  • 0 <= a[i] <= 1000000000

Examples

Input: ([20, 11, 10, 10070, 7],)

Expected Output: 3

Explanation: 20 has 1 zero, 10 has 1 zero, and 10070 has 3 zeros. These are the three numbers with an odd zero count.

Input: ([],)

Expected Output: 0

Explanation: An empty array contains no numbers, so the count is 0.

Input: ([0],)

Expected Output: 1

Explanation: The number 0 is treated as having one zero digit, which is odd.

Input: ([1010, 909, 123, 1000],)

Expected Output: 2

Explanation: 1010 has 2 zeros, 909 has 1, 123 has 0, and 1000 has 3. Only 909 and 1000 have an odd number of zeros.

Input: ([5, 70, 700, 7000, 0],)

Expected Output: 3

Explanation: 70 has 1 zero, 700 has 2, 7000 has 3, and 0 has 1. The numbers 70, 7000, and 0 qualify.

Hints

  1. Process each number digit by digit and count how many times digit 0 appears. Remember that the number 0 itself should count as one zero.
  2. You only need to know whether the zero count is odd or even, so you can track parity instead of storing the full count.
Last updated: Jun 7, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Solve Four Coding Assessment Tasks - Capital One (medium)
  • Write SQL using joins and window functions - Capital One (medium)
  • Review Preprocessing Code and Tests - Capital One (easy)
  • Remove nodes with a given value - Capital One (medium)
  • Solve multiple algorithmic interview questions - Capital One (hard)