Bank of America 2024 Papers
Previous year papers with coding questions
Practice Bank of America placement paper coding questions with detailed solutions. Access Bank of America OA coding problems in Java, Python.
This page contains Bank of America coding questions from Bank of America OA placement papers with detailed solutions.
Bank of America OA Coding Section:
Solution (Java):
class BankAccountManager { Map<String, Double> accounts = new HashMap<>(); Map<String, List<Transaction>> history = new HashMap<>();
public boolean transfer(String from, String to, double amount) { if (!accounts.containsKey(from) || !accounts.containsKey(to)) { return false; }
double fromBalance = accounts.get(from); if (fromBalance < amount) return false;
accounts.put(from, fromBalance - amount); accounts.put(to, accounts.get(to) + amount);
history.putIfAbsent(from, new ArrayList<>()); history.putIfAbsent(to, new ArrayList<>()); history.get(from).add(new Transaction("DEBIT", amount)); history.get(to).add(new Transaction("CREDIT", amount));
return true; }
public double getBalance(String accountId) { return accounts.getOrDefault(accountId, 0.0); }}Time Complexity: O(1) per transaction
Bank of America 2024 Papers
Previous year papers with coding questions
Bank of America Main Page
Complete Bank of America placement guide
Practice Bank of America coding questions regularly!