InterviewLegend

Warm-Ups, Strings & SQL

Alex Chen40 min readGuide updated
In this lesson
  • Write Fibonacci both ways and explain why plain recursion slows down
  • Print a star pyramid and reverse each word of a sentence in place
  • Query the second highest salary and employees with no manager, NULLs included
  • Solve Longest Substring Without Repeating Characters with a sliding window
  • Answer the core Java questions that follow each problem

Bank of America's live technical interview is short and mostly about fundamentals. The most detailed account from the last year comes from an India campus drive for Software Engineering apprentices, interviewed on 28 November 2025. Round one ran 30 minutes on Webex. After a self-introduction and a project walkthrough, the interviewer asked for three small programs, a few core Java questions and two SQL queries.

Round two was the same afternoon, close to 50 minutes long, and HR phoned to book it within ten minutes of round one. Its one coding problem was Longest Substring Without Repeating Characters. The candidate called the core Java section after it "a rapid-fire conceptual marathon", and one project got a deep dive. A Hyderabad engineer who accepted an offer in November 2025 describes the same split, with round one on DSA plus SQL and round two on fundamentals.

All six problems from those rounds are below in runnable Python, each with the Java questions that sat next to it. None of them is hard. Speed and clean code count for a lot here, and so does knowing what Java does underneath your answer.

The Bank of America angle
Write the plain version fast, then expect "why". Thirty minutes held a self-introduction, a project, three programs, core Java and two queries. Get each warm-up right on the first pass and give its complexity in one sentence. The minutes you save go to the Java and SQL questions that come straight after.

What the Bank of America technical interview looks like

  • Round one: 30 minutes on Webex. November 2025 campus drive: introduction and project, three small programs, core Java, then two SQL queries.
  • Round two: About 50 minutes. One DSA problem, implemented and explained, then a long core Java rapid fire and one project in depth.
  • Difficulty: Easy, plus one medium. The warm-ups are first-year programs. Longest Substring Without Repeating Characters is LeetCode medium.
  • Language: Java for the follow-ups. No 2025 account names a required language, but India rounds that year kept asking about Java strings, collections and HashMap.

Other 2025 India reports fit this picture. A November 2025 candidate described basic OOP, "some medium-level DSA" and deep questions on the projects in their resume, easy to medium overall. In Mumbai, a Software Engineer II hired in April 2025 had two technical rounds on collections and core Java, including the internal working of a HashMap. And a Hyderabad engineer with three years of experience was asked in September 2025 about Java 8 features and one medium Java streams question.

US loops have looked different. Two New York candidates in November 2025 had no coding at all, so if you're interviewing in the US, read the process overview before you drill these.

Fibonacci has five reports from 2016 to November 2025, and the second highest salary has four from 2021 to November 2025. Few live-round questions at Bank of America repeat more. The other four come from the same November 2025 rounds, and they show how a round is built: small programs first, one real algorithm problem, SQL alongside.

Asked at Bank of America

These are the Bank of America technical interview questions from November 2025. The three warm-ups and the two queries are from round one, and the sliding-window problem is from round two. Each runs in the editor, including the SQL, which is written as a Python function over the table's rows so it can be graded. The query sits in each solution. Write it on paper first, the way the round asks for it.

Fibonacci, iteratively and recursively

Fibonacci has turned up in Bank of America live rounds for nearly ten years. A US Global Technology phone screen in September 2016 asked for a recursive function in a shared doc, and a Houston conference interview that November asked for the first five numbers. A 2019 India campus round wanted the series printed recursively, and a Hyderabad round in 2023 asked for the series. The November 2025 campus drive asked for it both iteratively and recursively.

1

Fibonacci Series Iterative and Recursive

EasySignature problem
Problem
Return the first n numbers of the Fibonacci series as a list. The series starts with 0 and 1, and every number after that is the sum of the two before it.

If n is 0, return an empty list. Inputs go up to n = 50, so the later numbers don't fit in a 32-bit integer.
Inputn = 5Output[0, 1, 1, 2, 3]

Each number from the third on is the sum of the two before it: 0 + 1, 1 + 1, 1 + 2.

How this uses the pattern

Keep the last two numbers in two variables. Each step appends the older one and moves both forward by one.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Fibonacci Series Iterative and Recursive

Loading...
Click "Run" to execute your code
The Bank of America angle
Asking for both versions is a cue to compare them. The loop runs in linear time with two variables. Plain recursion calls itself twice per number, so its running time grows exponentially and it redoes the same work again and again. Write the loop first, then the recursive one, then say what memoizing it fixes and what it doesn't.
Take it further
Write it recursively without the slowdown. Cache each Fibonacci number the first time you compute it, in a dict or array, so each one is computed once. That brings the recursive version down to linear time. The call stack still grows with n, which is the cost the loop never pays. The worked version is in the solution.

The Java questions near it. Recursion was on the round-two list, so be ready to say what happens when it goes too deep. Each call takes a stack frame, and a deep enough chain throws StackOverflowError, which is an Error and not an Exception. That leads into exception handling, which the November 2025 candidate said was covered in "complete depth". Know checked against unchecked, and what finally does when the try block returns.

Print a pyramid pattern

The November 2025 campus drive opened round one with "pyramid pattern printing". The usual version is a centred pyramid of stars, one row per level, and that's what is built below. If you're given a different shape, the same row formula adapts.

2

Print a Pyramid Pattern

EasyCommonly asked
Problem
Build a centred pyramid of * with n rows and return it as a list of strings, one per row from the top.

Row i (counting from 1) has 2i - 1 stars, with spaces on the left to centre it under the bottom row. Don't add spaces after the last star. If n is 0, return an empty list.
Inputn = 3Output[" *", " ***", "*****"]

Three rows of 1, 3 and 5 stars, with 2, 1 and 0 spaces in front.

How this uses the pattern

Row i has n - i spaces, then 2i - 1 stars. One loop over the rows is enough.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Print a Pyramid Pattern

Loading...
Click "Run" to execute your code
The Bank of America angle
It's a loop-control check, and speed matters in a 30-minute round. Work out one row out loud: the bottom row has 2n - 1 stars, and every row above loses one star on each side. Say "n - i spaces, 2i - 1 stars", write one loop, and run it on n = 3 before you call it done.
Take it further
Number the rows instead. A common pattern variant replaces the stars with digits that count up to the row number and back down, so row 3 reads 12321. Keep the same spaces, then build the middle from two ranges joined together. The worked version is in the solution.

The Java questions near it. Round one asked about String, StringBuilder and StringBuffer, and a pattern program is the natural place for it. A String can't change, so row += "*" in a loop builds a new string every time. StringBuilder appends into one growing buffer. StringBuffer does the same with synchronized methods, so it's safe to share across threads and a little slower. In a single-threaded loop, use StringBuilder.

Reverse each word of a sentence in place

The second warm-up in November 2025 was a short sentence starting "This is", with every word spelled backwards and the words left in order, so "This" came out as "sihT". It's LeetCode 557. Expect to be asked for it in place, which in Java and Python means working on a character array, since strings can't change.

3

Reverse Each Word in a Sentence

EasyFrequently asked
Problem
Given a sentence, reverse the letters of every word and keep the words in their original order. A word is a run of characters with no space in it.

Keep every space exactly where it was, including leading, trailing and repeated spaces. Work on a character array and swap in place instead of building a list of words.
Inputsentence = "This is Java"Output"sihT si avaJ"

Each word is reversed and the order stays This, is, Java.

How this uses the pattern

Find each word's start and end, then reverse that slice with two pointers moving toward each other.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Reverse Each Word in a Sentence

Loading...
Click "Run" to execute your code
The Bank of America angle
A split, reverse and join one-liner passes the tests, and the interviewer will ask for the version without it. Turn the string into a character array, find the start and end of each word, and swap from both ends toward the middle. Then say why you needed the array at all, because that question about immutable strings is coming either way.
Take it further
Reverse the word order too. For "This is Java" return "Java is This", each word still spelled forward. Reverse the whole array first, which flips the word order and spells every word backwards, then reverse each word again with the same routine. The worked version is in the solution.

The Java questions near it. Why are Java strings immutable? Literals are shared through the string pool, so letting one reference change a value would change it for everyone. Immutability also makes a String safe as a HashMap key and safe to share between threads. That's why the in-place answer starts with toCharArray(). If you're asked for a shortcut, new StringBuilder(word).reverse() does one word.

Second highest salary in SQL

The second highest salary has come up four times, all in India campus rounds, between September 2021 and November 2025. Among SQL questions only joins between two tables come up more. A 2021 candidate called it "fairly easy", and 2023 and November 2025 rounds asked it inside the first technical interview. A 2022 version asked for the second highest salary in one particular department. It's LeetCode 176.

4

Second Highest Salary

EasySignature problem
Problem
You're given the rows of an Employee table as employees, a list of [id, salary] pairs. Return the second highest distinct salary.

Equal salaries count once, so with salaries 300, 300 and 200 the answer is 200. If there's no second distinct salary, return null (None in Python), the NULL the SQL query gives back.
Inputemployees = [[1, 100], [2, 200], [3, 300]]Output200

The distinct salaries from the top are 300, 200 and 100.

How this uses the pattern

In SQL this is the largest salary below the largest. In code, track the top two distinct values in one pass.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Second Highest Salary

Loading...
Click "Run" to execute your code
The Bank of America angle
This question is short enough that the follow-ups are the real test. Write the MAX below a MAX query first, then the LIMIT and OFFSET version wrapped so an empty result comes back as NULL. Be ready for "now the third highest" and for the department version from 2022. DENSE_RANK handles both, so be ready to say why it beats ROW_NUMBER.
Take it further
Every department at once. The 2022 ask was one department, which is a WHERE clause on the same query. The step after that is every department in one query: DENSE_RANK with PARTITION BY department, then keep rank 2. In code, group the salaries by department and take the second distinct value in each group. The worked version is in the solution.

The Java questions near it. JDBC was on the round-two list, and it's the bridge between this query and Java. Run it through a PreparedStatement with a ? placeholder for anything that comes from a user, such as the department name. The driver sends the value separately from the SQL text, which blocks SQL injection, and the database can reuse the compiled statement.

Employees with no manager in SQL

The second query in round one, November 2025, was "employees with no manager", with no table described. The usual schema is one Employee table where each row points to its manager's id, and the top of the hierarchy points to nothing. So the question is really about NULL, and how SQL treats it differently from every other value.

5

Employees With No Manager

EasyCommonly asked
Problem
You're given the rows of an Employee table as employees, a list of [id, name, manager_id] rows. An employee with no manager has manager_id set to null (None in Python).

Return the names of every employee with no manager, in order of id. Rows can arrive in any order.
Inputemployees = [[1, "Asha", null], [2, "Ravi", 1], [3, "Meera", 1]]Output["Asha"]

Only Asha has no manager. Ravi and Meera report to her.

How this uses the pattern

In SQL it's WHERE manager_id IS NULL ORDER BY id. In code, sort by id and keep the rows whose manager is None.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Employees With No Manager

Loading...
Click "Run" to execute your code
The Bank of America angle
The trap is WHERE manager_id = NULL. It runs without an error and returns nothing, because any comparison with NULL is unknown, never true. Write IS NULL and say why in a sentence. An interviewer may also ask what "no manager" means. A manager_id that points to someone who has left is a different query, and it's the follow-up below.
Take it further
Employees whose manager left. Return employees whose manager_id is set but matches no row in the table. Self-join with LEFT JOIN from the employee to the manager on e.manager_id = m.id, then keep rows where m.id IS NULL and e.manager_id IS NOT NULL. The worked version is in the solution.

The Java questions near it. NULL crosses into Java through JDBC too. ResultSet.getInt("manager_id") returns 0 for a NULL column, which looks like a real id. Call wasNull() right after, or read it with getObject into an Integer that can hold null. A boxed Integer that is null throws NullPointerException the moment it's unboxed into an int.

Longest Substring Without Repeating Characters

Round two in November 2025 had one DSA problem, LeetCode 3, and the candidate "implemented the solution and explained the complete approach" before the Java questions started. It's the only named LeetCode medium in a Bank of America live round from the last year, and a fair guide to the level when a round has one real algorithm question.

6

Longest Substring Without Repeating Characters

MediumCommonly asked
Problem
Given a string s, return the length of the longest substring that has no repeated character. A substring is a run of characters next to each other.

The string can hold letters, digits, symbols and spaces. An empty string has an answer of 0.
Inputs = "abcabcbb"Output3

"abc" is the longest run with no repeat.

How this uses the pattern

Grow a window to the right. When the new character is already inside the window, move the left edge just past its last position.

Write it here, or go full screen with the problem, hints and solution beside the editor.

Longest Substring Without Repeating Characters

Loading...
Click "Run" to execute your code
The Bank of America angle
The November 2025 candidate explained the complete approach, so plan to talk as much as you type. Start with the brute force over every substring, give its cost, then move to the sliding window and say that the map stores each character's last index. Name the case that breaks a careless version, "abba", where the left edge must never move backwards. A detail-oriented interviewer will ask you to trace it.
Take it further
Return the substring itself. Keep the start index of the best window alongside its length, and update both whenever the window beats the record. Slice it out at the end. The worked version is in the solution, and the cost doesn't change.

The Java questions near it. Your Java answer uses a HashMap, so the collections questions start there. A Mumbai engineer hired in April 2025 was asked how a HashMap works inside, and the round-two list included the Collections Framework. Have the answer ready in four parts. hashCode() chooses a bucket in an array, and equals() finds the key inside it. Since Java 8, a crowded bucket becomes a tree instead of a linked list. The table doubles once it's 75% full.

The core Java rapid fire

After the coding, round two in November 2025 ran through core Java at speed, and round one had a shorter version. A 2025 lateral loop in Hyderabad went deeper on the same ground, with Java 8 and 17 features and a streams question. These are the topics that came up, with the answer each one usually wants.

TopicWhere it came upHave this ready
JVM, JDK and JRERound two, November 2025The JDK holds the compiler and tools, the JRE runs programs, and the JVM executes bytecode inside it
Overloading and overridingRound two, November 2025; Hyderabad, September 2025Overloading is chosen at compile time by parameters. Overriding is chosen at runtime by the object. A static main can be hidden but never overridden
Inheritance and abstractionRound one, November 2025Why Java has no multiple inheritance of classes (the diamond problem), and how interfaces with default methods cover the need
String, StringBuilder, StringBufferBoth rounds, November 2025Immutable and pooled, mutable and fast, mutable and synchronized
ExceptionsRound two, November 2025Checked against unchecked, try-with-resources, and what finally does around a return
Multithreading and synchronizationRound two, November 2025synchronized against volatile, and why ConcurrentHashMap beats a synchronized HashMap
SerializationRound two, November 2025Serializable, transient fields, and why serialVersionUID matters when a class changes
Collections and HashMapRound two, November 2025; Mumbai, April 2025List against Set against Map, then the HashMap internals from the problem above
Java 8 and streamsHyderabad, September 2025Lambdas, Optional, and a stream that filters, groups and collects, written without a loop

For streams, drill the second highest salary. salaries.stream().distinct().sorted(Comparator.reverseOrder()).skip(1).findFirst() returns an Optional, which is the Java answer to the SQL NULL. The November 2025 candidate also had a full project deep dive in round two: their contribution, the architecture, the tools and how they built it. Prepare one project you can draw from memory.

Common questions

What questions does Bank of America ask in the technical interview?

Mostly fundamentals. The newest detailed round, from November 2025, asked for a pyramid pattern, each word of a sentence reversed, Fibonacci both ways, the second highest salary and employees with no manager. A second round opened with Longest Substring Without Repeating Characters. Core Java questions followed the code in both rounds.

How many technical rounds are there for freshers?

In India campus drives, usually one or two after the HireVue, then HR. Whether you get a second one depends on the interviewer. The November 2025 drive had two, about 30 and 50 minutes, on the same afternoon. The process overview covers the other paths.

Do I have to code in Java?

No candidate describes a fixed language, and the online assessment lets you pick. But the 2025 follow-ups in India were about Java, from strings to HashMap internals to streams. If Java isn't your main language, still prepare the core Java topics above, because the interviewer may ask them anyway.

Is there SQL in the Bank of America technical interview?

Yes, inside the same round as the coding. The second highest salary has four reports from 2021 to November 2025, and joins between two tables have five from 2019 to 2024. Joins and duplicate rows are in SQL: Joins, Join Counts & Query Tuning.

Key Takeaways

  • ✓November 2025 round one was 30 minutes: three warm-ups, core Java and two SQL queries. Write each warm-up correctly on the first pass.
  • ✓Fibonacci and the second highest salary are among the most repeated live questions. Know two versions of each and their costs.
  • ✓Write IS NULL, never = NULL, and use DENSE_RANK whenever the interviewer changes which salary rank they want.
  • ✓Every problem leads into Java: string immutability, StringBuilder, JDBC and HashMap internals. Prepare those answers alongside the code.
Bank of America interview guide

Know what Bank of America asks before you walk in.

32 coding · 5 system design · 43 behavioral questions

Get Premium$49 a year · Instant access
Or start freeNo card.

Get their questions first.

The HireVue Online AssessmentHad your Bank of America interview?How we research

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.