FastPrepVirtual Card Transaction Validator
Problems/Virtual Card Transaction Validator

Virtual Card Transaction Validator

Capital One logoCapital One● EasyFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Capital One onsite interview. The report points to checking virtual-card transactions as the main skill. We set the usual case-study rules: the card must be active, the expiration date counts as still valid, the amount must be positive, and the amount must fit in the remaining limit. Our version is about 60% the same as the reported question.

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 = trueexpirationDay = 30transactionDay = 20remainingLimit = 500amount = 120return = true

The active card has not expired and has enough remaining limit.

Example 2

active = trueexpirationDay = 30transactionDay = 31remainingLimit = 500amount = 120return = false

The transaction occurs after the expiration day.

Example 3

active = falseexpirationDay = 30transactionDay = 20remainingLimit = 500amount = 120return = false

An 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

Interview reports that mention this question

  • Capital One Experienced Engineer Power Day and OA: 6 Experiences

Capital One interview experiences

  • Capital One Coding OA Questions: 3 Experiences
  • Capital One New Grad OA Questions: 14 Experiences (Part 2 of 2)
  • Capital One TDP Agentic Round (AI Coding): 7 Experiences
  • Capital One SWE Power Day, Level Not Reported: 6 Experiences
  • Capital One TIP Intern OA and Power Day: 13 Experiences
All Capital One interview questionsSee Capital One hiring insights
Saved
class Solution {
    public boolean isVirtualCardTransactionValid(boolean active, int expirationDay, int transactionDay, int remainingLimit, int amount) {
        // Write your code here.
    }
}
Checking account…