Virtual Card Transaction Validator
Updated
Problem statement
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) → booleanExamples
Example 1
active = trueexpirationDay = 30transactionDay = 20remainingLimit = 500amount = 120return = trueThe active card has not expired and has enough remaining limit.
Example 2
active = trueexpirationDay = 30transactionDay = 31remainingLimit = 500amount = 120return = falseThe transaction occurs after the expiration day.
Example 3
active = falseexpirationDay = 30transactionDay = 20remainingLimit = 500amount = 120return = falseAn inactive card cannot authorize a transaction.
Constraints
0 <= transactionDay, expirationDay <= 10^9.0 <= remainingLimit <= 10^9.-10^9 <= amount <= 10^9.
More Capital One Onsite Interview questions
- Digit-Coded Card ValidationONSITE INTERVIEW · Seen Nov 2026
- Sort ColorsONSITE INTERVIEW · Seen Oct 2026
- Banking System with Top ActivityONSITE INTERVIEW · Seen Sep 2026
- Transaction Event StoreONSITE INTERVIEW · Seen Jul 2026
- Shortest Path in an Unweighted GraphONSITE INTERVIEW · Seen Jul 2026
- Duplicate Transactions Within 60 SecondsONSITE INTERVIEW · Seen May 2026
- LRU CachePHONE SCREEN · ONSITE INTERVIEW · Seen May 2026
- Cashback TrackerONSITE INTERVIEW · Seen Nov 2025
- Reverse a StringOA · ONSITE INTERVIEW · Seen Oct 2025
- Most Cost-Effective MachineONSITE INTERVIEW · Seen Sep 2025
Similar questions at other companies
- Christmas Tree with N TiersVerily · ONSITE INTERVIEW
- Ring Buffer OperationsAmazon · ONSITE INTERVIEW
- Count Distinct Underwriting PII ValuesAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
- Bounded Word Guess SolverAtlassian · ONSITE INTERVIEWAtlassian interview questions
- Generate an Unbiased Bit from a Biased CoinGoogle · ONSITE INTERVIEWGoogle interview questions
- Insert After a Linked-List NodeAMD · ONSITE INTERVIEWAMD interview questions
- Document Edit EventsClickUp · ONSITE INTERVIEW
- Apply Overridden Integer TransformsOptimus Information · ONSITE INTERVIEWOptimus Information interview questions
- Basic String Compression with Length GuardNew Relic · PHONE SCREEN · ONSITE INTERVIEW
- Copy File Bytes with Partial WritesMicrosoft · ONSITE INTERVIEWMicrosoft interview questions