PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Google

Count Special Index Pairs

Last updated: Apr 22, 2026

Quick Overview

This question evaluates understanding of parity, combinatorial counting, and array index manipulation, focusing on reasoning about even/odd products and index parity constraints.

  • medium
  • Google
  • Coding & Algorithms
  • Data Engineer

Count Special Index Pairs

Company: Google

Role: Data Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Given an integer array `nums` of length `n`, count the number of index pairs `(i, j)` such that: - `0 <= i < j < n` - `nums[i] * nums[j]` is even - `j - i` is odd Return the total number of such special pairs. A product is even if at least one of the two numbers is even.

Quick Answer: This question evaluates understanding of parity, combinatorial counting, and array index manipulation, focusing on reasoning about even/odd products and index parity constraints.

Related Interview Questions

  • Solve Rooms and Top-K Streams - Google (medium)
  • Find Containing Range - Google (medium)
  • Rearrange Tasks With Cooldown - Google (medium)
  • Solve Three Array and Matrix Path Problems - Google (medium)
  • Implement Employee Management and Expression Evaluation - Google (medium)
Google logo
Google
Jan 26, 2025, 12:00 AM
Data Engineer
Technical Screen
Coding & Algorithms
1
0

Given an integer array nums of length n, count the number of index pairs (i, j) such that:

  • 0 <= i < j < n
  • nums[i] * nums[j] is even
  • j - i is odd

Return the total number of such special pairs.

A product is even if at least one of the two numbers is even.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Google•More Data Engineer•Google Data Engineer•Google Coding & Algorithms•Data Engineer Coding & Algorithms
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.