FastPrepInvalid Transactions
Problems/Invalid Transactions

Invalid Transactions

Bloomberg LP logoBloomberg LP● MediumNEW GRADFULLTIMEPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report names a well-known problem in a Bloomberg campus-recruiting question bank. It says many questions may be changed slightly, but it does not say what changed, and it does not say the input is sorted. We used the standard version with unsorted input. Our version is about 70% the same as the reported question.

Given transactions, return every invalid string unchanged and in input order.

Each string has the form name,time,amount,city.

A transaction is invalid if either condition holds:

  • amount > 1000.
  • Another transaction has the same name and a different city, and their times differ by at most 60 minutes.

Both transactions in such a pair are invalid.

Function

invalidTransactions(transactions: String[]) → List<String>

Examples

Example 1

transactions = ["alice,20,800,mtv","alice,50,1200,mtv"]return = ["alice,50,1200,mtv"]

Only the second transaction is invalid because its amount exceeds 1000. Both transactions are in the same city, so the first is valid.

Example 2

transactions = ["alice,20,800,mtv","alice,50,100,beijing"]return = ["alice,20,800,mtv","alice,50,100,beijing"]

The two transactions share a name, differ in city, and are 30 minutes apart, so both are invalid.

Example 3

transactions = ["alice,90,100,beijing","bob,100,100,mtv","alice,20,800,mtv"]return = []

Alice's transactions are 70 minutes apart, and Bob has only one transaction. All transactions are valid, so the result is empty.

Constraints

  • 1 <= transactions.length <= 1000.
  • Each row has exactly four comma-separated fields.
  • name and city contain 1 through 20 lowercase English letters.
  • 0 <= time <= 1000.
  • 0 <= amount <= 2000.

More Bloomberg LP Onsite Interview questions

  • Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent WordsONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Decode StringPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Minimum Replacements to Make Two Strings AnagramsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026

Similar questions at other companies

  • Group AnagramsAmazon Web Services · ONSITE INTERVIEWAmazon Web Services interview questions
  • Linked Merchants Within Two HopsStripe · PHONE SCREENStripe interview questions
  • Query Log MatchDatadog · PHONE SCREEN · ONSITE INTERVIEWDatadog interview questions
  • Shortest Uncommon SubstringAirbnb · ONSITE INTERVIEWAirbnb interview questions
  • Longest Consecutive Login StreakAmazon · ONSITE INTERVIEW
  • Group AnagramsWorkday · PHONE SCREEN
  • Apply Operations to Make a String EmptyFlexport · PHONE SCREENFlexport interview questions
  • Group AnagramsMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Group AnagramsEPAM · PHONE SCREENEPAM interview questions
  • Underline Shortest Unique SubstringsMoveworks · PHONE SCREENMoveworks interview questions

Interview reports that mention this question

  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP hiring insights
Saved
class Solution {
    public List<String> invalidTransactions(String[] transactions) {
        // Write your code here.
    }

}
Checking account…