Easy Problems & Java Follow-ups
- Solve Same Tree and Valid Parentheses fast, then list the edge cases unprompted
- Take a change request on your own code and prove it with JUnit regression tests
- Answer the Java questions on collections, type erasure, exceptions and functional interfaces
- Write element frequencies with streams and move zeros in place, as asked in 2025
A recent Deutsche Bank onsite was light on algorithms and heavy on everything around them. It was an August 2025 Software Engineer loop with two technical rounds of an hour each with two interviewers. Each round gave one LeetCode-easy problem. Same Tree came up in one and Valid Parentheses in the other. Once the code worked, the candidate wrote normal and edge test cases.
The candidate wrote Java, and that shaped the rest of the hour. There was no second problem. The interviewers asked for changes to the code on the screen, then moved on to large inputs, Java collections, generics and type erasure, checked and unchecked exceptions, and JUnit. Below are both problems, a change request like the ones they asked for, and the Java answers to have ready. The lesson closes with a 2025 Associate Java round that asked for element frequencies with streams and for moving zeros in place.
How the Deutsche Bank technical interview runs
Expect your round to differ in the details, but the shape is this. You get a short problem and solve it in the language you chose. Then you list test cases, ordinary ones first and the edges after. For two trees that means two empty trees, one empty tree, and equal values in a different shape. For a bracket string it means the empty string, a lone closing bracket and openers that never close.
From there the hour depends on your language. For the Java candidate, every follow-up grew out of the code they had just written: change it for a new rule, say how it copes with huge inputs, justify each collection. The language questions came after that, and the JUnit part included regression tests for the change.
A third round was billed as behavioural and turned out to be mostly technical. It went through past projects and debugging, and asked whether and how the candidate uses AI tools. Prepare that as a topic. Nothing suggests AI help is allowed during the live coding itself, so plan to code without it.
Write code you'd be happy to change. Use clear names and one small helper per idea, and skip the clever one-liners. The second half of the hour is spent editing that code in front of two people, and tidy code turns each change request into a two-line edit.
Asked at Deutsche Bank
Both problems come from that August 2025 onsite, and each was the only problem in its round. The runnable versions below are something like what was asked. Each walkthrough ends with the JUnit tests you'd write next, since the tests were part of the round. Tree inputs are level-order arrays with null for a missing child.
Same Tree
Same Tree
Problem
true if they are the same tree and false otherwise. Two trees are the same when they have the same shape and every pair of matching nodes holds the same value.Each tree arrives as a level-order array with
null for a missing child, so [1,null,2] is a root of 1 with only a right child of 2. Build both trees from their arrays, then compare them. An empty array is an empty tree.Same shape, and the same value at every position.
Compare the two roots, then recurse on the left pair and the right pair. Two missing nodes match. One missing node, or two values that differ, ends it with false.
Same Tree
Click "Run" to execute your code
Integer value compared with == would break this.StackOverflowError in Java, and Python stops at its recursion limit of about a thousand frames. Keep an explicit stack of node pairs and loop instead. Worked through below.Valid Parentheses
Valid Parentheses
Problem
()[]{}, return true if its brackets are valid and false otherwise.A string is valid when every opening bracket is closed by a bracket of the same kind, and brackets close in the right order, so the most recently opened one closes first. Every closing bracket needs an opening bracket before it. The empty string is valid.
Each pair opens and closes before the next one starts.
Push each opening bracket on a stack. A closing bracket must match the top of the stack, which you pop. At the end the stack must be empty.
Valid Parentheses
Click "Run" to execute your code
((. In Java the collection is a natural question. Use ArrayDeque as the stack and say why. Stack extends Vector and synchronizes every call, and its own Javadoc recommends Deque instead.Change requests on your own code
Once the code passed, the interviewers asked for a change to meet a new requirement, then for regression tests. The exact change wasn't given, so practise one of the kind they like. Something like: the bracket checker now runs over real source text, has to skip every other character, and must report the index of the first error so a person can fix it.
The smallest edit wins. Push indexes onto the stack instead of characters, add one branch that skips anything that isn't a bracket, and return the bad closer's index, or the earliest index still open at the end. Say which lines change before you type. Then keep every old test: a valid string should now return -1, and that's your regression check.
The Java questions around your code
The rest of each onsite round went on Java itself. Keep the answers short and tie each one back to the code on the screen. These are the topics the interviewers covered, with the answer you want to give.
Which collection, and why? The bracket stack wants ArrayDeque behind the Deque interface. A closer-to-opener lookup is a HashMap or Map.of. Counts in first-seen order need LinkedHashMap, and sorted keys need TreeMap, which pays O(log n) per operation for the ordering. Name the cost you're trading every time.
Generics and type erasure. Generic types are checked at compile time and erased at runtime, so List and List share one runtime class. That's why you can't write new T(), new T[n] or instanceof List. Two overloads that differ only in a type argument won't compile either, because they erase to the same signature. Type arguments must be objects, so a Map boxes every key and count.
Checked or unchecked exceptions? Checked exceptions such as IOException must be caught or declared, and they suit failures a caller can plan for. Unchecked ones extend RuntimeException and usually mean a bug. IllegalArgumentException for bad input is one, and so is the NoSuchElementException that ArrayDeque.pop() throws on an empty deque. Never catch one only to swallow it, since the failure then disappears without a trace.
JUnit. One behaviour per test, a name that reads as a sentence, and assertEquals(expected, actual) in that order. For a change request, keep the old tests and add new ones for the new rule. The old tests passing again is the regression check. @ParameterizedTest keeps a long list of edge cases short.
The Associate Java backend round (2025)
An August 2025 Associate Java backend interview in Pune, for a candidate with three years of experience, had a different mix. The first round ran on Microsoft Teams. It worked through a long list of Java 8, Spring, REST and testing questions, with two small coding tasks inside it. The candidate was selected and told the second round would be face to face in the office.
Element frequencies with streams
Element Frequencies With Streams
Problem
[value, count] pairs in the order each value first appears.An empty list returns an empty list. Values can be negative or zero.
Each value is listed once, with its count.
Count into a map that remembers insertion order, then turn each entry into a pair.
Element Frequencies With Streams
Click "Run" to execute your code
groupingBy with Collectors.counting(). Two details are worth saying out loud. A plain groupingBy makes no promise about order, so pass a LinkedHashMap constructor as the map factory when order matters. And counting() produces a Long, so the map is a Map. Starting from an int[], you need .boxed() before you can collect.Comparator built from Map.Entry.comparingByValue().reversed() , then thenComparing(Map.Entry.comparingByKey()). The same round asked about Comparator as a functional interface, so expect to explain that line. Worked through below.Move zeros to the end in place
Move Zeroes In Place
Problem
0 to the end while the other values keep their original order. Do it by changing the array itself, with no second array.Return the same array once it's rearranged, so the tests can check it.
The non-zero values keep their order, and both zeros move to the end.
Keep a write index for where the next non-zero value belongs. Scan with a read index and swap each non-zero value back to the write index.
Move Zeroes In Place
Click "Run" to execute your code
assertArrayEquals is the JUnit check, since assertEquals on two arrays compares references.The Java 8 questions in that round
The same 2025 round ran through a list of Java 8 questions around the two coding tasks. One asked for the return type of Predicate. Another, in the candidate's words, was "Why comparable is not functional interface when comparator is". Both have short, exact answers.
What is a functional interface? An interface with exactly one abstract method, so a lambda or a method reference can stand in for it. Default and static methods don't count, and neither do methods that Object already declares. @FunctionalInterface is optional, but with it the compiler rejects a second abstract method.
What does Predicate return? Predicate has one abstract method, boolean test(T t), so it returns a primitive boolean. The neighbours are worth naming too. Function maps a value to a result, Consumer returns nothing, and Supplier takes nothing.
Why is Comparator a functional interface when Comparable isn't? Comparator is annotated @FunctionalInterface. It declares equals as well as compare, but equals comes from Object, so compare is its one abstract method. Comparable also has a single abstract method, compareTo, and a lambda would compile against it. It carries no annotation because a class implements it on itself, comparing this with another object. A lambda sits outside the objects it compares, which is exactly what Comparator describes.
Common questions
What coding questions does Deutsche Bank ask in the technical interview?
An August 2025 onsite gave one LeetCode-easy problem an hour (Same Tree in one round, Valid Parentheses in the other), followed by test cases and follow-ups on the code. A 2025 Associate Java round asked for element frequencies with streams and for moving zeros in place. Older rounds lean on classics like linked lists, sorting and SQL, and each has its own lesson in this guide.
What are Deutsche Bank Java developer interview questions like?
Practical and close to the code. Expect to change your own solution for a new requirement and defend your collection choices. Generics and type erasure come up, along with checked versus unchecked exceptions and JUnit tests for the change. The 2025 backend round added streams, functional interfaces, Predicate and the Comparable versus Comparator question.
Do I have to code in Java?
No. You choose your language in the online test and the live rounds, and candidates have used C++ and Python too. Java is where the follow-ups go when you pick it, so only choose it if you can answer the questions in this lesson without notes.
Can I use AI tools in the coding round?
Assume not. The only AI rule on Deutsche Bank's careers pages covers the recorded video interview, where they ask you not to use AI tools. Nothing suggests AI help is allowed in live coding either, so practice without it. AI does come up as a topic. In the 2025 onsite the behavioural round asked whether and how the candidate uses AI tools, so have a plain, honest answer ready.
Key Takeaways
- ✓The August 2025 onsite gave one LeetCode-easy problem an hour, then test cases, then Java change requests on your own code.
- ✓Write normal and edge test cases before anyone asks, and keep them as JUnit regression tests when the code changes.
- ✓Prepare two-sentence answers on collections, type erasure, checked versus unchecked exceptions and Java 8 functional interfaces.
Deutsche Bank interview guideKnow what Deutsche Bank asks before you walk in.
28 coding · 5 system design · 29 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.