Reported September 2026
Capital Onearray

Check Array Arithmetic Expressions

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

The input size on this Capital One question, reported in September 2026, is the first thing to read, and it's also the reason there's nothing hard here. Arrays go up to 10^5 elements, so you can't do anything quadratic, but you don't need to. It's a single pass over four parallel arrays, checking each index on its own. If your invite says Capital One and you're staring at Check Array Arithmetic Expressions, relax. It's a warm-up with a couple of small traps. StealthCoder sits on your screen as a safety net in case you blank mid-assessment, but this one is mostly about not overthinking.

The problem

You are given three equal-length integer arrays a, b, and c, together with an equal-length character array signs.
Each element of signs is either '+' or '-'. Return a boolean array result of the same length, where result[i] is true exactly when applying signs[i] to a[i] and b[i] produces c[i].
If signs[i] == '+', check whether a[i] + b[i] == c[i].
If signs[i] == '-', check whether a[i] - b[i] == c[i].

Function
checkArithmeticExpressions(a: int[], signs: char[], b: int[], c: int[]) → boolean[]

Examples
Example 1
a = [3,2,-1,4]
signs = ["+","-","-","+"]
b = [2,7,-5,2]
c = [5,5,4,2]
return = [true,false,true,false]
The four checks are 3 + 2 = 5, 2 - 7 != 5, -1 - (-5) = 4, and 4 + 2 != 2.

Constraints
1 <= a.length == b.length == c.length == signs.length <= 10^5
-10^9 <= a[i], b[i], c[i] <= 10^9
Every value in signs is either '+' or '-'.
Every evaluated addition or subtraction fits a signed 32-bit integer.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The pattern is plain array iteration. For each index i, look at signs[i], compute a[i] + b[i] or a[i] - b[i], compare to c[i], and write true or false into the result. That's O(n) time and O(n) space for the output. Brute force isn't even a temptation, because each index is independent. No sorting, no hash map, no prefix tricks. The pitfalls are small. First, the sign is a character, so compare against '+' and not a string in languages that care. Second, watch the types. The constraints say every evaluated result fits in signed 32-bit, but a[i] - b[i] on values near 10^9 can still be risky in some setups, so use a 64-bit integer if you're unsure. Third, keep the output length equal to the input length. If you freeze on the function signature or the parameter order (a, signs, b, c), StealthCoder can hand you the loop as a hedge during the live OA.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Check Array Arithmetic Expressions 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. If you're reading this with an OA window open, you're who this was built for.

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. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Check Array Arithmetic Expressions FAQ

How hard is Check Array Arithmetic Expressions really?+

Easy. It's one loop over parallel arrays with a branch on the sign. If you can write a for loop and an if statement, you can solve it. The only real risk is a careless mistake, like mixing up the parameter order or mishandling negative numbers.

What's the trick to this Capital One question?+

There isn't one. Each index is independent, so you evaluate a[i] plus or minus b[i] and compare to c[i]. The work is reading carefully: the parameters come in the order a, signs, b, c, and the result is a boolean array matching the input length.

Do I need to worry about integer overflow?+

The constraints guarantee every evaluated addition or subtraction fits a signed 32-bit integer, so you're mostly safe. If you want zero doubt, cast to a 64-bit type before computing. It costs nothing and removes the whole question in languages with fixed-width ints.

What time and space complexity should I state?+

O(n) time because you visit each index once, and O(n) space for the result array. Auxiliary space beyond the output is O(1). With n up to 10^5, that's comfortably fast, and anything slower than linear would be unnecessary.

How do I prepare for this in 48 hours?+

Don't cram this exact problem. Practice simple array loops with a conditional, and edge cases like negatives and the largest values. Then spend your time on the harder problems an OA tends to pair with an easy one, since this one is the quick win.

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