The Capital One Staff Software Engineer OA contained four Python coding questions covering basic expression evaluation, stateful log processing, matrix transformation, and incremental counting of arithmetic triplets.
Interview Details
Question 1 — Evaluate Arithmetic Equations
You are given four arrays a, b, c and signs. Each element of signs is either "+" or "-". For every index i, determine whether the corresponding equation is correct.
If signs[i] == "+" check a[i] + b[i] == c[i]
If signs[i] == "-" check a[i] - b[i] == c[i]
Return a boolean array containing the result for every equation. For example:
a = [1, 5, 10]
b = [2, 3, 4]
c = [3, 2, 14]
signs = ["+", "-", "+"]
a = [1, 5, 10]
b = [2, 3, 4]
c = [3, 2, 14]
signs = ["+", "-", "+"]
should return [True, True, True]
Question 2 — Find the Branch with the Most Files
You are given a sequence of version-control-style log entries. Each operation is one of "switch branch_name" or "push filename". A switch operation changes the currently active branch. A push operation adds one file to the current branch. After processing all operations, return
Unlock Full Details
Create a free account to unlock this interview experience report.