FastPrepDifference between Even- and Odd-Index Sums
Problems/Difference between Even- and Odd-Index Sums

Difference between Even- and Odd-Index Sums

ZipRecruiter logoZipRecruiter● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter new-grad OA report describes an integer array limited to [-100,100] and adding up by even and odd indices. Zero-based indexing and subtracting odd from even settle what the transcription left out. Our version is about 88% the same as the reported question.

Using zero-based indexing, sum values at even indices and values at odd indices. Return evenSum - oddSum.

Function

indexParityDifference(values: int[]) → int

Examples

Example 1

values = [1,2,3,4]return = -2

Even-index sum four minus odd-index sum six gives negative two.

Example 2

values = [7]return = 7

Index zero contributes to the even sum.

Constraints

  • 0 <= values.length <= 100000
  • -100 <= values[i] <= 100

More ZipRecruiter Online Assessment questions

  • Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024

Similar questions at other companies

  • Total Cost Against the Lowest Earlier PricePayPal · OAPayPal interview questions
  • Count Valid Square PairsAuxoAI · OA
  • Picked Player Who LostSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Server InvestmentRippling · OARippling interview questions
  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Next Pascal Row CoefficientIntuit · OAIntuit interview questions
  • Unique Integers That Sum to ZeroNVIDIA · OANVIDIA interview questions
  • Count Multiples of Three with Two SevensHudson River Trading · OAHudson River Trading interview questions
  • Diagonal Bounce TraversalAutodesk · OAAutodesk interview questions
  • Maximum Student-Teacher DistanceChubb · OAChubb interview questions

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public int indexParityDifference(int[] values) {
        // Write your code here.
    }

}
Checking account…