Skip to content

Visa coding questions

Practice Visa coding questions in the style candidates report for online assessments and technical interviews. Focus: hashing, streams, intervals, correctness under retries.

Item Typical expectation
Problems 1-3 coding tasks depending on drive
Skills hashing, streams, intervals, correctness under retries
Languages Java, C++, Python (confirm invite)
Bar Correctness first, then complexity

Question 1: Subarray sum equals k (ledger)

Section titled “Question 1: Subarray sum equals k (ledger)”
Show approach

Approach: Prefix sum hash map.

Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
// fill logic
}

Complexity: State time/space before coding. Test empty input and single-element cases.

Question 2: Merge overlapping settlement windows

Section titled “Question 2: Merge overlapping settlement windows”
Show approach

Approach: Sort + merge intervals.

from collections import defaultdict
def solve(arr):
# fill logic
return arr

Complexity: State time/space before coding. Test empty input and single-element cases.

Question 3: Design hit counter (last 5 minutes)

Section titled “Question 3: Design hit counter (last 5 minutes)”
Show approach

Approach: Bucketed timestamps.

Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
// fill logic
}

Complexity: State time/space before coding. Test empty input and single-element cases.

Question 4: Detect duplicate transaction IDs in window W

Section titled “Question 4: Detect duplicate transaction IDs in window W”
Show approach

Approach: Queue + set eviction.

from collections import defaultdict
def solve(arr):
# fill logic
return arr

Complexity: State time/space before coding. Test empty input and single-element cases.

Question 5: First unique transaction in a stream

Section titled “Question 5: First unique transaction in a stream”
Show approach

Approach: Queue + frequency map.

Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
// fill logic
}

Complexity: State time/space before coding. Test empty input and single-element cases.

Question 6: Minimum transfers to settle balances

Section titled “Question 6: Minimum transfers to settle balances”
Show approach

Approach: Backtracking on non-zero balances.

from collections import defaultdict
def solve(arr):
# fill logic
return arr

Complexity: State time/space before coding. Test empty input and single-element cases.

Question 7: Sliding window maximum (spend spikes)

Section titled “Question 7: Sliding window maximum (spend spikes)”
Show approach

Approach: Deque of indices.

Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
// fill logic
}

Complexity: State time/space before coding. Test empty input and single-element cases.

Day Drill
Mon Arrays + hashing (2 problems)
Tue Two pointers / sliding window
Wed Stacks / strings
Thu Trees or graphs basics
Fri Timed mock (2 problems / 90 min)
Sat Re-solve Friday misses cold
Sun Light CS theory + rest
  1. Coding before reading constraints
  2. Passing samples but failing hidden tests
  3. Silent complexity (cannot explain Big-O in interview)
  4. Switching languages mid-prep
  5. Never practicing on the real OA editor style

Mastercard · PayPal · Stripe · PhonePe · American Express · Google