Java and Spring
Proxies, transactions, the JVM memory model and what Spring Boot does at startup.
Your progress
L1 · 0 of 105L2 · 0 of 84L3 · 0 of 56L4 · 0 of 7
Next
Level 1 · 105 questions. Begin with what gets asked in the first ten minutes. Levels 2 to 4 build on it.
Level 1First ten minutesTwo-sentence answers to what gets asked first.
Apache Kafka interview questions
- 1.1What is the difference between at-most-once, at-least-once and exactly-onceMust‑knowReview againNext3 min
Basic versus Bearer authentication
- 2.1What is the difference between authentication and authorization?Must‑knowReview againNext4 min
Core Java fundamentals interview questions
- 3.1How do try-catch-finally and try-with-resources work?Must‑knowReview againNext1 min
- 3.2Is Java pass-by-value or pass-by-reference?Must‑knowReview againNext1 min
- 3.3What are the four principles of object-oriented programming in Java?Must‑knowReview againNext2 min
- 3.4What are the JDK, the JRE and the JVM, and how does Java code run?Must‑knowReview againNext1 min
- 3.5What are the main collection types, List, Set, Map and Queue, and when do you use each?Must‑knowReview againNext1 min
- 3.6What do the access modifiers and the static keyword mean?Must‑knowReview againNext1 min
- 3.7What is the difference between == and equals(), and why must hashCode() match equals()?Must‑knowReview againNext2 min
- 3.8What is the difference between an interface and an abstract class?Must‑knowReview againNext1 min
- 3.9What is the difference between checked and unchecked exceptions?Must‑knowReview againNext1 min
- 3.10What is the difference between Comparable and Comparator?Must‑knowReview againNext1 min
- 3.11What is the difference between final, finally and finalize?Review againNext2 min
- 3.12What is the difference between method overloading and method overriding?Must‑knowReview againNext1 min
- 3.13What is the difference between primitives and wrapper classes, and what is autoboxing?Must‑knowReview againNext2 min
- 3.14Why is String immutable, and when do you use StringBuilder or StringBuffer?Must‑knowReview againNext2 min
Hibernate Entity States - Transient Persistent Detached Removed
- 4.1What states can a Hibernate entity be in, and what exactly does each one mean?Must‑knowReview againNext3 min
Java Streams interview questions
- 5.1anyMatch versus allMatch versus noneMatchMust‑knowReview againNext2 min
- 5.2Can a Stream be reused?Review againNext1 min
- 5.3Combine two lists into oneReview againNext2 min
- 5.4Common elements between two listsReview againNext1 min
- 5.5Count character frequency in a stringMust‑knowReview againNext1 min
- 5.6Count word frequency in a sentenceReview againNext1 min
- 5.7Employees earning above average salaryReview againNext1 min
- 5.8filter versus mapReview againNext1 min
- 5.9Find duplicate elements in a listReview againNext2 min
- 5.10Find maximum and minimumReview againNext1 min
- 5.11findFirst versus findAnyReview againNext1 min
- 5.12First repeated characterReview againNext1 min
- 5.13Group employees by departmentMust‑knowReview againNext1 min
- 5.14groupingBy versus partitioningByReview againNext1 min
- 5.15Intermediate versus terminal operationsMust‑knowReview againNext1 min
- 5.16Join strings with a delimiter, prefix, and suffixReview againNext2 min
- 5.17Longest string in a listReview againNext1 min
- 5.18map versus flatMapMust‑knowReview againNext1 min
- 5.19Names starting with a given characterReview againNext1 min
- 5.20Partition numbers into even and oddReview againNext1 min
- 5.21Remove duplicates using StreamsReview againNext1 min
- 5.22Salary sum and averageReview againNext2 min
- 5.23Sort employees by salaryReview againNext1 min
- 5.24Sort strings by length with a tie-breakerReview againNext2 min
- 5.25Stream versus CollectionMust‑knowReview againNext1 min
Linked list coding interview questions in Java
- 6.1How do you find the middle node of a linked list in one pass?Review againNext1 min
- 6.2How do you reverse a singly linked list, iteratively and recursively?Review againNext3 min
Modern Java interview questions
- 7.1How does Optional help avoid null checks?Must‑knowReview againNext1 min
- 7.2What are functional interfaces and lambdas?Must‑knowReview againNext2 min
- 7.3What are records and when should you use them?Must‑knowReview againNext4 min
- 7.4What are sequenced collections?Review againNext1 min
- 7.5What are switch expressions?Review againNext1 min
- 7.6What are text blocks?Review againNext1 min
- 7.7What is pattern matching for instanceof?Review againNext1 min
- 7.8What is the difference between default and static methods in interfaces?Review againNext1 min
- 7.9What is the difference between List.of() and Arrays.asList()?Review againNext1 min
- 7.10What is the difference between map() and flatMap()?Must‑knowReview againNext1 min
- 7.11What is the difference between Thread, Runnable and Callable?Must‑knowReview againNext2 min
- 7.12What is var and where can you use it?Review againNext1 min
- 7.13Which new String methods came in Java 11?Review againNext1 min
- 7.14Why were private interface methods added?Review againNext1 min
Spring Boot fundamentals interview questions
- 8.1Constructor injection, setter injection or field injection: which do you use and why?Must‑knowReview againNext1 min
- 8.2How do application.properties, @Value and @ConfigurationProperties work, and how do profiles fit in?Must‑knowReview againNext2 min
- 8.3How do you build a simple REST endpoint in Spring Boot?Must‑knowReview againNext2 min
- 8.4How do you handle exceptions globally in a Spring Boot REST API?Must‑knowReview againNext2 min
- 8.5How do you return the right HTTP status code from a controller?Must‑knowReview againNext1 min
- 8.6How do you test a Spring Boot application?Review againNext1 min
- 8.7How do you validate request input in Spring Boot?Must‑knowReview againNext1 min
- 8.8What are bean scopes, and what is the default?Must‑knowReview againNext1 min
- 8.9What are inversion of control and dependency injection?Must‑knowReview againNext1 min
- 8.10What does @SpringBootApplication do?Must‑knowReview againNext1 min
- 8.11What does @Transactional do?Must‑knowReview againNext2 min
- 8.12What is a Spring bean, and how do @Component, @Service, @Repository and @Bean differ?Must‑knowReview againNext2 min
- 8.13What is Spring Boot Actuator used for?Review againNext1 min
- 8.14What is Spring Boot, and how is it different from the Spring Framework?Must‑knowReview againNext2 min
- 8.15What is Spring Data JPA, and what does a repository interface give you?Must‑knowReview againNext2 min
Spring Boot internals interview questions
- 9.1Difference between @ComponentScan and @SpringBootApplication?Must‑knowReview againNext2 min
- 9.2Difference between @RestController and @Controller internally?Must‑knowReview againNext2 min
- 9.3Difference between a fat JAR and a normal JAR?Must‑knowReview againNext3 min
- 9.4How does Spring Boot decide server port priority?Review againNext2 min
- 9.5How does Spring Boot handle logging by default?Review againNext3 min
- 9.6How does Spring Boot manage dependency versions automatically?Review againNext2 min
- 9.7What happens if application.yml and application.properties both exist?Review againNext2 min
- 9.8What is the real use of CommandLineRunner?Review againNext2 min
- 9.9Why does Spring Boot prefer convention over configuration?Review againNext2 min
- 9.10Why is Spring Boot perfect for microservices?Review againNext2 min
- 9.11Why is Spring Boot preferred for cloud-native apps?Review againNext2 min
The Scala mindset for Java developers
- 10.1What does the same task look like in mutable Java versus immutable Scala?Review againNext3 min
- 10.2What is the core mindset shift from Java to Scala?Review againNext2 min
- 10.3Why do search and data platforms like Zalando's use Scala?Review againNext3 min
What happens if… — 20 Java interview scenarios
- 11.1collect invoked twice on the same stream?Review againNext1 min
- 11.2Component removed from a class another bean Autowires?Review againNext1 min
- 11.3filter then findAny then get finds no match — null or exception?Review againNext1 min
- 11.4Two Employee objects with identical data compared; equals() never overridden?Must‑knowReview againNext1 min
- 11.5Word count with Collectors.toMap mapping each word to 1, and a word repeats?Must‑knowReview againNext1 min
Word ladder and maximum subarray in Java
- 12.1How do you find the maximum sum of a contiguous subarray?Review againNext5 min
Zalando Coding Interview Questions (Reported)
- 13.1Can you give change for every customer in an ice-cream queue?Review againNext3 min
- 13.2How do you find a contact by a partial phone number?Review againNext3 min
- 13.3How do you sum the two-digit integers in an array?Review againNext2 min
Zalando interview process and recruiter screen
- 14.1How do you answer "Describe a project you are proud of"?Must‑knowReview againNext2 min
- 14.2How do you answer "Walk me through your background" and "What are your strengths and accomplishments?"Must‑knowReview againNext2 min
- 14.3How do you answer "Why Zalando?"Must‑knowReview againNext2 min
- 14.4How do you handle location, relocation, start date and language questions?Review againNext2 min
- 14.5What do candidates report about the coding and system design rounds?Review againNext5 min
- 14.6What does the Zalando software engineer interview process look like?Review againNext4 min
- 14.7What happens in the Zalando recruiter call, and how should you prepare?Must‑knowReview againNext2 min
- 14.8Which questions should you ask the recruiter?Review againNext2 min
Zalando technical round: Java, JVM and concurrency
- 15.1What are the costs of ArrayList, LinkedList, HashMap and TreeMap, and how do you choose?Must‑knowReview againNext5 min
Level 2Daily jobWhat you use at work every week.
Apache Kafka interview questions
- 1.1How do you guarantee ordering when events for the same entity arrive out of sequenceReview againNext3 min
- 1.2How do you make processing idempotent when the same event arrives twiceMust‑knowReview againNext3 min
- 1.3How do you stop a repeatedly failing message from blocking a partitionReview againNext2 min
- 1.4Kafka consumer crashes after processing but before committing the offsetMust‑knowReview againNext2 min
- 1.5When do you retry immediately, use exponential backoff, or send a message to a dead-letter topicReview againNext4 min
- 1.6When would you choose Kafka over RabbitMQReview againNext3 min
- 1.7When would you choose REST over Kafka for communication between microservicesMust‑knowReview againNext4 min
Basic versus Bearer authentication
- 2.1How do Basic and Bearer authentication differ?Review againNext2 min
Hibernate Entity States - Transient Persistent Detached Removed
- 3.1In Spring Boot, what state is an entity in after a @Transactional method commits?Review againNext4 min
- 3.2What is the difference between removed and deleted?Review againNext2 min
- 3.3Which operations move an entity between these four states?Review againNext5 min
HTTP content negotiation and API responses
- 4.1How does HTTP content negotiation select JSON or XML in Spring MVC?Review againNext5 min
Java coding questions: HashMap from scratch, top-k frequent and seat booking
- 5.1How do you return the k most frequent numbers, with the larger number first on a tie?Review againNext3 min
- 5.2Two people book the same seat at the same moment. How do you make sure only one gets it?Must‑knowReview againNext3 min
Java Streams interview questions
- 6.1Convert a list of employees to a map by idMust‑knowReview againNext1 min
- 6.2Find the highest salary in each departmentMust‑knowReview againNext1 min
- 6.3Find the most frequent elementMust‑knowReview againNext2 min
- 6.4Find the second-highest salaryMust‑knowReview againNext1 min
- 6.5First non-repeated characterReview againNext1 min
- 6.6map versus peekReview againNext1 min
- 6.7Move all zeroes to the end or the frontReview againNext2 min
- 6.8Nth highest salaryReview againNext1 min
- 6.9reduce versus collectReview againNext1 min
- 6.10Sequential versus parallel streamsReview againNext1 min
- 6.11Sort a map by its valuesMust‑knowReview againNext2 min
- 6.12Top 3 highest salariesReview againNext1 min
- 6.13What is lazy evaluation?Must‑knowReview againNext1 min
Linked list coding interview questions in Java
- 7.1How do you reverse a linked list in groups of k?Review againNext2 min
Modern Java interview questions
- 8.1A fixed thread pool of 3 threads gets 10 tasks. How do they run?Review againNext4 min
- 8.2How do virtual threads differ from platform threads?Review againNext3 min
- 8.3How does garbage collection work in the JVM?Must‑knowReview againNext1 min
- 8.4How does the String pool work, and how many objects does new String create?Review againNext3 min
- 8.5How is a record different from a traditional class?Review againNext1 min
- 8.6What are deadlock, starvation, livelock and race conditions?Must‑knowReview againNext4 min
- 8.7What are sealed classes?Review againNext2 min
- 8.8What are the JVM memory areas?Must‑knowReview againNext1 min
- 8.9What are virtual threads?Must‑knowReview againNext2 min
- 8.10What is a ThreadLocal and how does it work?Review againNext9 min
- 8.11What is lazy evaluation in streams?Review againNext1 min
- 8.12What is pattern matching for switch?Review againNext1 min
- 8.13What is the difference between Future and CompletableFuture?Must‑knowReview againNext3 min
- 8.14What is the difference between synchronized and ReentrantLock?Must‑knowReview againNext8 min
- 8.15What is the difference between volatile and AtomicInteger?Must‑knowReview againNext5 min
Senior Java, Spring Boot, microservices and AWS interview questions
- 9.1A Kubernetes pod keeps failing. How do you troubleshoot it?Review againNext4 min
- 9.2An API works locally but fails in production. How do you debug it?Review againNext4 min
- 9.3An exception was thrown but the transaction still committed. Why?Must‑knowReview againNext4 min
- 9.4How do services get AWS permissions without embedded credentials?Must‑knowReview againNext1 min
Spring Boot internals interview questions
- 10.1Difference between @EnableAutoConfiguration and @Import?Review againNext2 min
- 10.2Difference between a @Configuration class and a normal class?Must‑knowReview againNext3 min
- 10.3How did Spring Boot remove XML configuration almost completely?Review againNext2 min
- 10.4How does Spring Boot auto-create a DataSource?Review againNext2 min
- 10.5How does Spring Boot detect embedded Tomcat automatically?Review againNext3 min
- 10.6How does Spring Boot handle exception translation?Review againNext5 min
- 10.7How does Spring Boot handle externalized configuration?Review againNext9 min
- 10.8How does Spring Boot load profile-specific configurations?Must‑knowReview againNext4 min
- 10.9What happens if two beans of the same type exist without @Qualifier?Must‑knowReview againNext2 min
- 10.10What happens internally when you add spring-boot-starter-web?Must‑knowReview againNext3 min
- 10.11What happens when you exclude an auto-configuration class?Review againNext2 min
The Scala mindset for Java developers
- 11.1How do immutability and actors remove most classic concurrency problems?Review againNext3 min
- 11.2When is Scala overkill and plain Java the better choice?Review againNext3 min
What happens if… — 20 Java interview scenarios
- 12.1API loads one hundred thousand rows and returns them in one response?Review againNext2 min
- 12.2Fetch one hundred orders, call getItems on each?Must‑knowReview againNext1 min
- 12.3LEFT JOIN orders, then WHERE order status equals PAID?Must‑knowReview againNext1 min
- 12.4New payment method added; PaymentService is a giant if-else on type?Review againNext1 min
- 12.5Request fails three services deep, independent logs, no correlation ID?Review againNext3 min
- 12.6Stream.concat of two lists then sorted, and one list contains null?Review againNext1 min
- 12.7Thread 1 locks A then B; thread 2 locks B then A, concurrently?Must‑knowReview againNext1 min
- 12.8Two employees tie for top salary; second highest via ORDER BY salary DESC LIMIT 1 OFFSET 1?Review againNext3 min
- 12.9Two threads print 1–100 (odd/even) with no synchronization?Review againNext2 min
Word ladder and maximum subarray in Java
- 13.1How do you find the length of the shortest word ladder?Review againNext4 min
Zalando Coding Interview Questions (Reported)
- 14.1How do you build the longest string from AA, BB and AB without three in a row?Review againNext3 min
- 14.2How do you compute the time covered by a set of intervals?Review againNext3 min
- 14.3How do you explain merge sort, and can it run in constant extra space?Review againNext4 min
- 14.4How does Dijkstra's shortest-path algorithm work?Review againNext3 min
- 14.5How does flood fill work, and how do you implement it?Review againNext3 min
- 14.6What coding patterns show up in reported Zalando problems, and how should you solve them?Review againNext5 min
Zalando interview process and recruiter screen
- 15.1How do you answer "What are your salary expectations?"Review againNext2 min
- 15.2What do the hiring-manager round and the Founding Mindset assess?Review againNext2 min
Zalando technical round: Java, JVM and concurrency
- 16.1How do you find two numbers that sum to k in a rotated sorted array?Review againNext3 min
- 16.2What is a bounded blocking queue, and how do ArrayBlockingQueue, LinkedBlockingQueue and Semaphore compare?Review againNext8 min
- 16.3What is a trie, and how would you code prefix autocomplete in Java?Review againNext4 min
- 16.4When do ReadWriteLock and BlockingQueue help?Review againNext7 min
- 16.5Why do balanced search trees matter, and when do you pick TreeMap over HashMap?Review againNext3 min
- 16.6Why prefer immutable objects, and how is an unmodifiable view different from an immutable copy?Review againNext3 min
Level 3SeniorProduction trade-offs and failure modes.
Apache Kafka interview questions
- 1.1A Kafka consumer's lag is huge but the pod looks healthy. What do you doReview againNext3 min
- 1.2How do you handle growing consumer lag when producers outpace consumersReview againNext4 min
- 1.3How do you keep compatibility when a producer changes the event schema while older consumers are still runningReview againNext2 min
- 1.4How do you publish events reliably when you update the database and send to KafkaReview againNext5 min
- 1.5What happens to in-flight work when a new consumer joins and partitions are reassignedReview againNext4 min
- 1.6Why can one hot partition stall a consumer group, and how do you fix itReview againNext2 min
Java coding questions: HashMap from scratch, top-k frequent and seat booking
- 2.1How do you implement your own HashMap?Review againNext4 min
Java Streams interview questions
- 3.1How are exceptions handled in Streams?Review againNext2 min
- 3.2When should you avoid parallelStream?Review againNext1 min
Modern Java interview questions
- 4.1How do virtual threads improve scalability?Review againNext1 min
- 4.2How do you investigate frequent GC pauses?Review againNext5 min
- 4.3How do you optimize memory usage in a Java application?Review againNext3 min
- 4.4How do you troubleshoot high CPU in a Java service?Review againNext3 min
- 4.5How would you handle thousands of concurrent API requests?Review againNext3 min
- 4.6How would you migrate an application from Java 8 to Java 21?Review againNext2 min
- 4.7What are scoped values?Review againNext1 min
- 4.8What are strong, soft, weak and phantom references, and when can the GC collect each?Review againNext8 min
- 4.9What is JPMS, the Java module system?Review againNext1 min
- 4.10What is structured concurrency?Review againNext1 min
- 4.11What is the difference between ExecutorService and ForkJoinPool?Review againNext2 min
- 4.12What JVM and platform improvements do you get by moving to Java 17?Review againNext2 min
Senior Java, Spring Boot, microservices and AWS interview questions
- 5.1A business transaction spans multiple databases. How do you keep it consistent?Review againNext7 min
- 5.2CPU is high but request volume is flat. How do you investigate?Review againNext5 min
- 5.3ECS, EKS, Lambda or EC2 for Java workloads: how do you choose?Review againNext1 min
- 5.4How do ThreadLocal, static collections and lingering references cause memory retention?Review againNext7 min
- 5.5How do you build a highly concurrent app without running out of platform threads?Review againNext2 min
- 5.6How do you deploy with zero downtime when the DB change is backward-incompatible?Review againNext2 min
- 5.7How do you design event-driven flows with SQS, SNS, EventBridge and Lambda?Review againNext1 min
- 5.8How do you evolve Kafka message schemas with many consumer versions?Review againNext2 min
- 5.9How do you handle dynamic authorization when permissions change at runtime across services?Review againNext2 min
- 5.10How do you publish events reliably when you update the DB and send to Kafka?Review againNext1 min
- 5.11How do you run Spring Boot highly available on AWS across multiple AZs?Review againNext1 min
- 5.12How do you stop an unstable shared downstream from causing cascading failures?Review againNext6 min
- 5.13How is ConcurrentHashMap thread-safe, and where does it stop helping?Review againNext2 min
- 5.14Kafka consumer lag keeps rising, but CPU and DB look normal. Why?Review againNext3 min
- 5.15Latency spikes now and then, and you suspect connection pool exhaustion. What do you do?Review againNext4 min
- 5.16What is your API gateway strategy for auth, rate limiting, routing and tenant isolation?Review againNext2 min
Spring Boot internals interview questions
- 6.1How does Spring Boot decide which auto-configuration to apply?Review againNext4 min
- 6.2How does Spring Boot integrate with Actuator internally?Review againNext3 min
- 6.3How does Spring Boot load application.properties internally?Review againNext3 min
- 6.4How would you upgrade a service to Spring Boot 4, and where does AI help?Review againNext6 min
- 6.5What are the most common Spring Boot performance mistakes?Review againNext4 min
- 6.6What happens internally when you hit a REST endpoint?Review againNext5 min
- 6.7What is the complete lifecycle of a Spring Bean?Review againNext2 min
- 6.8What is the exact startup flow of a Spring Boot application?Review againNext3 min
- 6.9What is the role of SpringFactoriesLoader?Review againNext3 min
What happens if… — 20 Java interview scenarios
- 7.1Controller returns a JPA entity with a lazy OneToMany?Review againNext2 min
- 7.2Kafka consumer crashes after processing but before committing the offset?Review againNext2 min
- 7.3Remove the API gateway; frontend calls all six services directly?Review againNext1 min
- 7.4Service calls an external API with no timeout and the API hangs?Review againNext2 min
- 7.5Transactional method writes a file, then the DB update fails?Review againNext1 min
- 7.6User logs out but their JWT has not expired?Review againNext2 min
Zalando Coding Interview Questions (Reported)
Zalando technical round: Java, JVM and concurrency
- 9.1How do JVM class loaders work, and what do ClassNotFoundException and NoClassDefFoundError tell you?Review againNext5 min
- 9.2How do you size and configure a thread pool for a backend service?Review againNext5 min
- 9.3What is the Java Memory Model, and what does happens-before guarantee?Review againNext3 min
Level 4InternalsHow it works underneath, and at scale.
Java Streams interview questions
- 1.1How does distinct work?Review againNext1 min
- 1.2How does sorted work internally?Review againNext1 min
Modern Java interview questions
- 2.1How do G1 and ZGC compare?Review againNext1 min
- 2.2How does ConcurrentHashMap work internally?Review againNext3 min
- 2.3How does the Stream API work internally?Review againNext1 min
- 2.4What is Generational ZGC?Review againNext1 min
Senior Java, Spring Boot, microservices and AWS interview questions
Each card is a topic. Columns go from Level 1 to Level 4; the outlined card is where you are.