Virtual Card Transaction Validator
Reported by candidates from Capital One's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
The Capital One OA reported in October 2026 hands you a Virtual Card Transaction Validator, and it looks almost insulting. Five parameters, one boolean back. No loops, no data structures. That's the trap. Easy problems get rushed, and the rushed solution misses the boundary that fails a hidden test. If you've got an invite and you're expecting a grind, this one tests whether you read the spec to the letter. If you blank or second-guess a comparison under the clock, StealthCoder is the invisible safety net running during the live assessment.
The problem
Determine whether a transaction may be authorized for a virtual card. A transaction is valid exactly when the card is active, transactionDay is no later than expirationDay, the amount is positive, and the amount does not exceed remainingLimit. Function isVirtualCardTransactionValid(active: boolean, expirationDay: int, transactionDay: int, remainingLimit: int, amount: int) → boolean Examples Example 1 active = true expirationDay = 30 transactionDay = 20 remainingLimit = 500 amount = 120 return = true The active card has not expired and has enough remaining limit. Example 2 active = true expirationDay = 30 transactionDay = 31 remainingLimit = 500 amount = 120 return = false The transaction occurs after the expiration day. Example 3 active = false expirationDay = 30 transactionDay = 20 remainingLimit = 500 amount = 120 return = false An inactive card cannot authorize a transaction. Constraints 0 <= transactionDay, expirationDay <= 10^9. 0 <= remainingLimit <= 10^9. -10^9 <= amount <= 10^9.
Reported by candidates. Source: FastPrep
Pattern and pitfall
There's no algorithm here. It's four conditions joined with AND, and the whole game is getting each comparison exactly right. Active must be true. transactionDay <= expirationDay, so a transaction on the expiration day is valid, and using strict less-than breaks it. amount > 0, so zero and negative amounts are invalid, and the constraints explicitly allow negatives down to -10^9. amount <= remainingLimit, so spending exactly the remaining limit is valid. The common pitfall is only checking the limit and forgetting that a negative amount is always under it. Another is off-by-one on the day check. Values reach 10^9, so nothing overflows a 32-bit int in these comparisons, but don't add or subtract them anyway. Return the single boolean expression directly. If your head goes foggy mid-assessment, StealthCoder can read the prompt and hand you the clean one-liner.
If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.
You can drill Virtual Card Transaction Validator 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. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Capital One's OA.
Capital One reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Virtual Card Transaction Validator FAQ
How hard is the Capital One Virtual Card Transaction Validator really?+
It's very easy in terms of logic. It's four boolean conditions. The difficulty is purely in boundary handling: equal days, zero amount, negative amount, and exact-limit spends. Candidates lose points by skimming, not by lacking skill.
What's the trick to this problem?+
There isn't a clever trick. Translate each sentence of the spec into one comparison and join them with AND. Use <= for the day check, > 0 for the amount, and <= for the limit. Then test the boundaries by hand.
Which edge cases should I test before submitting?+
Test transactionDay equal to expirationDay (valid), amount equal to 0 (invalid), a negative amount (invalid), amount equal to remainingLimit (valid), remainingLimit of 0 with a positive amount (invalid), and active false with everything else perfect.
Do I need to worry about integer overflow?+
Not if you only compare. All values fit within roughly 10^9, which is inside a 32-bit signed int. Overflow only becomes a risk if you add or multiply values, so don't compute things like remainingLimit - amount. Just compare directly.
How do I prepare for this in 48 hours?+
Don't over-prep this exact problem. Practice reading specs slowly and turning each rule into code. Write small validation functions and test each boundary on purpose. Then spend the rest of your time on harder array and hash map problems, since OAs usually mix difficulty.