HashMap, threads and streams, then why
Java interviews pair a DSA round with a deep dive that keeps asking how things work underneath: collections internals, concurrency, the JVM and Java 8 streams. Get an approach and working Java from a screenshot, and first-person explanations for the conceptual follow-ups.
Two kinds of Java interview
Which one you get depends more on the company than the job title.
Banks and product companies
Goldman Sachs, JPMorgan, Morgan Stanley, Walmart, PayPal
An online assessment, then DSA on CoderPad or HackerRank, a Java deep dive, an LLD such as an LRU cache, and sometimes a code review round. Goldman Sachs says its campus Superday is typically two to five interviews.
Goldman Sachs Careers (opens in a new tab); Reddit, 2025 (opens in a new tab); LeetCode Discuss, 2025 (opens in a new tab); interviewexperiences.in, 2025 (opens in a new tab)
Service companies
TCS, Infosys, Cognizant
Mostly conversational questions on core Java, Java 8, Spring Boot and microservices, with short live programs: filter a list with a stream, reverse a string without built-ins, find the second max. Fresher rounds like Cognizant’s GenC run about 25 to 30 minutes.
LeetCode Discuss, 2025 (opens in a new tab); GeeksforGeeks, 2025 (opens in a new tab); Java Guides on Medium, 2025 (opens in a new tab); LinkedIn, 2026 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)
How a Java loop runs
The full sequence at a bank or product company. Service-company interviews usually compress this into one or two conversational rounds.
Online assessment
Two DSA problems on HackerRank before any live round, at Goldman Sachs and JPMorgan. Goldman Sachs Careers (opens in a new tab); LeetCode Discuss, 2025 (opens in a new tab)
With Assisted Voice: Assisted Voice is built for the live rounds that follow, not timed assessments.
Live DSA in Java
About 60 min
Typically two problems with a complexity discussion. Goldman Sachs may run one or two CoderPad rounds. Reddit, 2025 (opens in a new tab); interviewexperiences.in, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab)
With Assisted Voice: Capture each problem for an approach and working Java.
Core Java deep dive
HashMap internals, exceptions, multithreading, Comparable vs Comparator, and sometimes spotting bugs in a snippet. Goldman Sachs calls it Software Engineering Practices. LeetCode Discuss, 2025 (opens in a new tab); interviewexperiences.in, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)
With Assisted Voice: Press the answer shortcut for an explanation in the first person, then say it your way.
Java LLD
About 60 min
An LRU cache with a thread-safety discussion, or a class design like snake and ladder with patterns. Reddit, 2025 (opens in a new tab); LeetCode Discuss, 2025 (opens in a new tab); interviewexperiences.in, 2025 (opens in a new tab)
With Assisted Voice: The Code tab gives you a class structure and code to build from.
Spring Boot and design
For experienced roles: bean lifecycle, auto-configuration, transactions and resilience, then a scalable system design. LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); interviewexperiences.in, 2025 (opens in a new tab)
With Assisted Voice: The Diagram tab draws the services and data flow for the design half.
Code review
45–50 min
Seen at JPMorgan: review production-style Java or Spring Boot code for bugs and bad practices. LeetCode Discuss, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)
With Assisted Voice: Capture the code on screen, and the next answer takes it into account.
Hiring manager
A project deep dive, values questions, and sometimes production scenarios like a deadlocked batch job. LeetCode Discuss, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab)
With Assisted Voice: Answers draw on your resume, so project details stay consistent.
Every topic is a chain of follow-ups
Interviewers start with a definition and keep asking why. A Barclays candidate said the round rewarded reasoning over memorised answers. Reddit, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab)
Collections internals
Goldman Sachs, Morgan Stanley, JPMorgan, Barclays, Cognizant
- How does HashMap work internally?
- What happens when two keys land in the same bucket?
- When does a bucket turn into a tree, and why?
- HashMap, ConcurrentHashMap or Hashtable: which and why?
LeetCode Discuss, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Taro, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)
Multithreading
Goldman Sachs, JPMorgan, Morgan Stanley, PayPal, Oracle
- What’s the difference between start() and run()?
- wait(), sleep() and join(): when do you use each?
- What does volatile guarantee, and what doesn’t it?
- Print odd and even numbers from two threads, in turn.
LeetCode Discuss, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Taro, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Desi QnA, 2025 (opens in a new tab)
Streams and Java 8+
TCS, Infosys, Cognizant, Barclays
- map() or flatMap()?
- What is Optional for?
- Find the second-highest salary with a stream.
- Now do it per department.
Medium, 2025 (opens in a new tab); Java Guides on Medium, 2025 (opens in a new tab); LinkedIn, 2026 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); InterviewLift, 2026 (opens in a new tab)
OOP and design
Goldman Sachs, Morgan Stanley, JPMorgan
- How do you make a class immutable?
- What if it holds a mutable list?
- Singleton or Decorator here, and why?
- Walk me through SOLID with your own code.
LeetCode Discuss, 2025 (opens in a new tab); LeetCode Discuss, 2025 (opens in a new tab); Glassdoor, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Taro, 2025 (opens in a new tab)
JVM and memory
JPMorgan, Morgan Stanley, Goldman Sachs
- Heap, stack and metaspace: what lives where?
- Where do string literals go?
- CMS or G1, and what changed?
Medium, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Taro, 2025 (opens in a new tab)
Spring Boot, three years and up
JPMorgan, Goldman Sachs, TCS, Cognizant
- Walk me through the bean lifecycle.
- How does auto-configuration decide what to load?
- What does @Transactional actually do?
- How would you add circuit breakers and idempotent APIs?
Reddit, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab); Java Guides on Medium, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab)
The stream question that trips people up
“Find the second-highest salary” is reported across Java interviews, often followed by “now per department”. The quick version skips one element, so when two people share the top salary it returns the top salary again. LinkedIn, 2025 (opens in a new tab); InterviewLift, 2026 (opens in a new tab)
Experienced developers say stream questions are where they stumble, because they rarely write streams at work. Reddit, 2025 (opens in a new tab); LinkedIn, 2026 (opens in a new tab)
salaries.stream() .sorted(Comparator.reverseOrder()) .skip(1) .findFirst();salaries.stream() .distinct() .sorted(Comparator.reverseOrder()) .skip(1) .findFirst();Formats reported at companies
| Company | Format reported | Source |
|---|---|---|
| Goldman SachsAssociate, 2025 | HackerRank assessment, CoderPad DSA rounds, then a Superday of DSA, Software Engineering Practices (Java internals, buggy snippets, projects), design and a hiring manager. | Goldman Sachs Careers (opens in a new tab); interviewexperiences.in, 2025 (opens in a new tab); Medium, 2025 (opens in a new tab) |
| JPMorgan ChaseSD2, Bangalore, 2024–25 | One candidate had an assessment, then three rounds of about 50 minutes on HackerRank: system design, behavioural, and DSA with code review. Another had a Spring Boot code review round. | LeetCode Discuss, 2025 (opens in a new tab); LinkedIn, 2025 (opens in a new tab) |
| Morgan StanleyAssociate, 2025 | DSA plus a snake-and-ladder LLD, then a design of your own project plus DSA, then a hiring manager on Java 17, a deadlocked batch job and Kafka. | LeetCode Discuss, 2025 (opens in a new tab) |
| BarclaysBA4 developer, 2025 | A technical discussion on core Java, collections internals, streams and concurrency with a small coding scenario, then a values-based round. | Medium, 2025 (opens in a new tab) |
| Walmart Global TechSenior engineer, India, 2025 | A 60-minute DSA round, a 60-minute Java and LLD round (LRU cache with locking trade-offs), HLD and a hiring manager. | Reddit, 2025 (opens in a new tab); interviewexperiences.in, 2025 (opens in a new tab) |
| TCS, Infosys, CognizantExperienced Java roles, 2025 | Mostly Q&A on core Java, Java 8, Spring Boot and microservices, with short live programs. | Java Guides on Medium, 2025 (opens in a new tab); LinkedIn, 2026 (opens in a new tab); LinkedIn, 2025 (opens in a new tab) |
Questions candidates were asked
- Explain how HashMap works internally: hashing, buckets, equals and hashCode, collisions
- How do you make a class immutable when it holds a mutable list?
- Checked vs unchecked exceptions, and is try-finally without catch legal?
- Comparable vs Comparator, then sort a list of objects by a field
- Implement an LRU cache, then make it thread-safe
- Make three threads run in a fixed order, or print odd and even numbers from two threads
Where candidates slip
- Reciting definitions without the trade-offs behind them.
- Missing edge cases in “easy” problems: assuming one duplicate, or not handling null and invalid input.
- One candidate’s shaky answer on volatile in a code review round.
- Stream questions under time pressure, especially without daily stream use.
- In one 60-minute round, an LRU cache plus Java questions left no time to finish.
Usually a DSA round solved in Java, then a Java deep dive: HashMap and ConcurrentHashMap internals, multithreading, exceptions, immutability and Java 8 streams. Experienced roles add Spring Boot, microservices and a design round.
Keep preparing
- DSA coding roundsHow the coding round is graded, step by step.
- SDE 2 interviewsMachine coding and LLD rounds in detail.
- System design roundsFor the design half of senior Java loops.
- Backend developer questionsCommon questions with sample answers.
- Goldman Sachs interviewsQuestions and process for Goldman roles.
- JPMorgan Chase interviewsQuestions and process for JPMorgan roles.
Sources
Last reviewed . Candidate reports are paraphrased, and formats vary by team, location and year.
- Prepare: studentsGoldman Sachs Careers (opens in a new tab)
- Walmart Global Tech India interview experience, backend SSE (r/leetcode)Reddit, 2025 (opens in a new tab)
- Java 8 and Spring Boot interview questions, part 1 (r/developersIndia)Reddit, 2025 (opens in a new tab)
- Facing problems with Java 8 Stream API interviews (r/developersIndia)Reddit, 2025 (opens in a new tab)
- How do you gauge candidates for Java positions? (r/java)Reddit, 2025 (opens in a new tab)
- Goldman Sachs interview experience, AssociateLeetCode Discuss, 2025 (opens in a new tab)
- JPMorgan Chase Java Developer SD2, Bangalore (offer)LeetCode Discuss, 2025 (opens in a new tab)
- Morgan Stanley interview experience, AssociateLeetCode Discuss, 2025 (opens in a new tab)
- Cognizant GenC Next, second technical interview (November 2025)LeetCode Discuss, 2025 (opens in a new tab)
- Cognizant GenC (Java) campus placement 2025GeeksforGeeks, 2025 (opens in a new tab)
- JPMorganChase Senior Java Developer interview questionsGlassdoor, 2025 (opens in a new tab)
- Goldman Sachs Associate interview experience (2.3 years)interviewexperiences.in, 2025 (opens in a new tab)
- Goldman Sachs: recent interview experiences, consolidatedMedium, 2025 (opens in a new tab)
- Goldman Sachs Java backend interview: 5 roundsMedium, 2025 (opens in a new tab)
- My interview experience with Goldman Sachs (Java backend)LinkedIn, 2025 (opens in a new tab)
- My JPMorgan Java interview journey: 4 rounds, 1 offerLinkedIn, 2025 (opens in a new tab)
- Java developer (5+ years) questions asked at JPMorgan ChaseLinkedIn, 2025 (opens in a new tab)
- Morgan Stanley senior Java developer interview (Mumbai)Taro, 2025 (opens in a new tab)
- Barclays BA4 software developer interview (selected)Medium, 2025 (opens in a new tab)
- Walmart SWE 3interviewexperiences.in, 2025 (opens in a new tab)
- PayPal SE3 interview experience, February 2025interviewexperiences.in, 2025 (opens in a new tab)
- PayPal interview experience, SDE-1 (Java backend)LinkedIn, 2025 (opens in a new tab)
- Real Java backend developer interview at TCSJava Guides on Medium, 2025 (opens in a new tab)
- My Infosys interview experience, Java Spring Boot senior developerLinkedIn, 2026 (opens in a new tab)
- Java backend L1 interview at Cognizant (3 years)LinkedIn, 2025 (opens in a new tab)
- Oracle OCI SMTS interview experience, December 2025Desi QnA, 2025 (opens in a new tab)
- Java 8 programming questions asked nowadays (second-highest salary)LinkedIn, 2025 (opens in a new tab)
- Group employees by department and find the second-highest distinct salaryInterviewLift, 2026 (opens in a new tab)
Answer the follow-up after the follow-up
Your first 30 minutes are free. After that it’s $5 an hour, pay as you go, with no subscription.
Start free — 30 minutes, no card