Java and Spring

Proxies, transactions, the JVM memory model and what Spring Boot does at startup.

252 questions18 topics4 levels76 must‑knowFree, no account

Your progress

L1 · 0 of 105L2 · 0 of 84L3 · 0 of 56L4 · 0 of 7

Level 1 · 105 questions. Begin with what gets asked in the first ten minutes. Levels 2 to 4 build on it.

Start with Level 1
Level 1First ten minutesTwo-sentence answers to what gets asked first.105 questions · 15 topics

Apache Kafka interview questions

  1. 1.1What is the difference between at-most-once, at-least-once and exactly-onceMust‑know3 min

Basic versus Bearer authentication

  1. 2.1What is the difference between authentication and authorization?Must‑know4 min

Core Java fundamentals interview questions

  1. 3.1How do try-catch-finally and try-with-resources work?Must‑know1 min
  2. 3.2Is Java pass-by-value or pass-by-reference?Must‑know1 min
  3. 3.3What are the four principles of object-oriented programming in Java?Must‑know2 min
  4. 3.4What are the JDK, the JRE and the JVM, and how does Java code run?Must‑know1 min
  5. 3.5What are the main collection types, List, Set, Map and Queue, and when do you use each?Must‑know1 min
  6. 3.6What do the access modifiers and the static keyword mean?Must‑know1 min
  7. 3.7What is the difference between == and equals(), and why must hashCode() match equals()?Must‑know2 min
  8. 3.8What is the difference between an interface and an abstract class?Must‑know1 min
  9. 3.9What is the difference between checked and unchecked exceptions?Must‑know1 min
  10. 3.10What is the difference between Comparable and Comparator?Must‑know1 min
  11. 3.11What is the difference between final, finally and finalize?2 min
  12. 3.12What is the difference between method overloading and method overriding?Must‑know1 min
  13. 3.13What is the difference between primitives and wrapper classes, and what is autoboxing?Must‑know2 min
  14. 3.14Why is String immutable, and when do you use StringBuilder or StringBuffer?Must‑know2 min

Hibernate Entity States - Transient Persistent Detached Removed

  1. 4.1What states can a Hibernate entity be in, and what exactly does each one mean?Must‑know3 min

Java Streams interview questions

  1. 5.1anyMatch versus allMatch versus noneMatchMust‑know2 min
  2. 5.2Can a Stream be reused?1 min
  3. 5.3Combine two lists into one2 min
  4. 5.4Common elements between two lists1 min
  5. 5.5Count character frequency in a stringMust‑know1 min
  6. 5.6Count word frequency in a sentence1 min
  7. 5.7Employees earning above average salary1 min
  8. 5.8filter versus map1 min
  9. 5.9Find duplicate elements in a list2 min
  10. 5.10Find maximum and minimum1 min
  11. 5.11findFirst versus findAny1 min
  12. 5.12First repeated character1 min
  13. 5.13Group employees by departmentMust‑know1 min
  14. 5.14groupingBy versus partitioningBy1 min
  15. 5.15Intermediate versus terminal operationsMust‑know1 min
  16. 5.16Join strings with a delimiter, prefix, and suffix2 min
  17. 5.17Longest string in a list1 min
  18. 5.18map versus flatMapMust‑know1 min
  19. 5.19Names starting with a given character1 min
  20. 5.20Partition numbers into even and odd1 min
  21. 5.21Remove duplicates using Streams1 min
  22. 5.22Salary sum and average2 min
  23. 5.23Sort employees by salary1 min
  24. 5.24Sort strings by length with a tie-breaker2 min
  25. 5.25Stream versus CollectionMust‑know1 min

Linked list coding interview questions in Java

  1. 6.1How do you find the middle node of a linked list in one pass?1 min
  2. 6.2How do you reverse a singly linked list, iteratively and recursively?3 min

Modern Java interview questions

  1. 7.1How does Optional help avoid null checks?Must‑know1 min
  2. 7.2What are functional interfaces and lambdas?Must‑know2 min
  3. 7.3What are records and when should you use them?Must‑know4 min
  4. 7.4What are sequenced collections?1 min
  5. 7.5What are switch expressions?1 min
  6. 7.6What are text blocks?1 min
  7. 7.7What is pattern matching for instanceof?1 min
  8. 7.8What is the difference between default and static methods in interfaces?1 min
  9. 7.9What is the difference between List.of() and Arrays.asList()?1 min
  10. 7.10What is the difference between map() and flatMap()?Must‑know1 min
  11. 7.11What is the difference between Thread, Runnable and Callable?Must‑know2 min
  12. 7.12What is var and where can you use it?1 min
  13. 7.13Which new String methods came in Java 11?1 min
  14. 7.14Why were private interface methods added?1 min

Spring Boot fundamentals interview questions

  1. 8.1Constructor injection, setter injection or field injection: which do you use and why?Must‑know1 min
  2. 8.2How do application.properties, @Value and @ConfigurationProperties work, and how do profiles fit in?Must‑know2 min
  3. 8.3How do you build a simple REST endpoint in Spring Boot?Must‑know2 min
  4. 8.4How do you handle exceptions globally in a Spring Boot REST API?Must‑know2 min
  5. 8.5How do you return the right HTTP status code from a controller?Must‑know1 min
  6. 8.6How do you test a Spring Boot application?1 min
  7. 8.7How do you validate request input in Spring Boot?Must‑know1 min
  8. 8.8What are bean scopes, and what is the default?Must‑know1 min
  9. 8.9What are inversion of control and dependency injection?Must‑know1 min
  10. 8.10What does @SpringBootApplication do?Must‑know1 min
  11. 8.11What does @Transactional do?Must‑know2 min
  12. 8.12What is a Spring bean, and how do @Component, @Service, @Repository and @Bean differ?Must‑know2 min
  13. 8.13What is Spring Boot Actuator used for?1 min
  14. 8.14What is Spring Boot, and how is it different from the Spring Framework?Must‑know2 min
  15. 8.15What is Spring Data JPA, and what does a repository interface give you?Must‑know2 min

Spring Boot internals interview questions

  1. 9.1Difference between @ComponentScan and @SpringBootApplication?Must‑know2 min
  2. 9.2Difference between @RestController and @Controller internally?Must‑know2 min
  3. 9.3Difference between a fat JAR and a normal JAR?Must‑know3 min
  4. 9.4How does Spring Boot decide server port priority?2 min
  5. 9.5How does Spring Boot handle logging by default?3 min
  6. 9.6How does Spring Boot manage dependency versions automatically?2 min
  7. 9.7What happens if application.yml and application.properties both exist?2 min
  8. 9.8What is the real use of CommandLineRunner?2 min
  9. 9.9Why does Spring Boot prefer convention over configuration?2 min
  10. 9.10Why is Spring Boot perfect for microservices?2 min
  11. 9.11Why is Spring Boot preferred for cloud-native apps?2 min

The Scala mindset for Java developers

  1. 10.1What does the same task look like in mutable Java versus immutable Scala?3 min
  2. 10.2What is the core mindset shift from Java to Scala?2 min
  3. 10.3Why do search and data platforms like Zalando's use Scala?3 min

What happens if… — 20 Java interview scenarios

  1. 11.1collect invoked twice on the same stream?1 min
  2. 11.2Component removed from a class another bean Autowires?1 min
  3. 11.3filter then findAny then get finds no match — null or exception?1 min
  4. 11.4Two Employee objects with identical data compared; equals() never overridden?Must‑know1 min
  5. 11.5Word count with Collectors.toMap mapping each word to 1, and a word repeats?Must‑know1 min

Word ladder and maximum subarray in Java

  1. 12.1How do you find the maximum sum of a contiguous subarray?5 min

Zalando Coding Interview Questions (Reported)

  1. 13.1Can you give change for every customer in an ice-cream queue?3 min
  2. 13.2How do you find a contact by a partial phone number?3 min
  3. 13.3How do you sum the two-digit integers in an array?2 min

Zalando interview process and recruiter screen

  1. 14.1How do you answer "Describe a project you are proud of"?Must‑know2 min
  2. 14.2How do you answer "Walk me through your background" and "What are your strengths and accomplishments?"Must‑know2 min
  3. 14.3How do you answer "Why Zalando?"Must‑know2 min
  4. 14.4How do you handle location, relocation, start date and language questions?2 min
  5. 14.5What do candidates report about the coding and system design rounds?5 min
  6. 14.6What does the Zalando software engineer interview process look like?4 min
  7. 14.7What happens in the Zalando recruiter call, and how should you prepare?Must‑know2 min
  8. 14.8Which questions should you ask the recruiter?2 min

Zalando technical round: Java, JVM and concurrency

  1. 15.1What are the costs of ArrayList, LinkedList, HashMap and TreeMap, and how do you choose?Must‑know5 min
Level 2Daily jobWhat you use at work every week.84 questions · 16 topics

Apache Kafka interview questions

  1. 1.1How do you guarantee ordering when events for the same entity arrive out of sequence3 min
  2. 1.2How do you make processing idempotent when the same event arrives twiceMust‑know3 min
  3. 1.3How do you stop a repeatedly failing message from blocking a partition2 min
  4. 1.4Kafka consumer crashes after processing but before committing the offsetMust‑know2 min
  5. 1.5When do you retry immediately, use exponential backoff, or send a message to a dead-letter topic4 min
  6. 1.6When would you choose Kafka over RabbitMQ3 min
  7. 1.7When would you choose REST over Kafka for communication between microservicesMust‑know4 min

Basic versus Bearer authentication

  1. 2.1How do Basic and Bearer authentication differ?2 min

Hibernate Entity States - Transient Persistent Detached Removed

  1. 3.1In Spring Boot, what state is an entity in after a @Transactional method commits?4 min
  2. 3.2What is the difference between removed and deleted?2 min
  3. 3.3Which operations move an entity between these four states?5 min

HTTP content negotiation and API responses

  1. 4.1How does HTTP content negotiation select JSON or XML in Spring MVC?5 min

Java coding questions: HashMap from scratch, top-k frequent and seat booking

  1. 5.1How do you return the k most frequent numbers, with the larger number first on a tie?3 min
  2. 5.2Two people book the same seat at the same moment. How do you make sure only one gets it?Must‑know3 min

Java Streams interview questions

  1. 6.1Convert a list of employees to a map by idMust‑know1 min
  2. 6.2Find the highest salary in each departmentMust‑know1 min
  3. 6.3Find the most frequent elementMust‑know2 min
  4. 6.4Find the second-highest salaryMust‑know1 min
  5. 6.5First non-repeated character1 min
  6. 6.6map versus peek1 min
  7. 6.7Move all zeroes to the end or the front2 min
  8. 6.8Nth highest salary1 min
  9. 6.9reduce versus collect1 min
  10. 6.10Sequential versus parallel streams1 min
  11. 6.11Sort a map by its valuesMust‑know2 min
  12. 6.12Top 3 highest salaries1 min
  13. 6.13What is lazy evaluation?Must‑know1 min

Linked list coding interview questions in Java

  1. 7.1How do you reverse a linked list in groups of k?2 min

Modern Java interview questions

  1. 8.1A fixed thread pool of 3 threads gets 10 tasks. How do they run?4 min
  2. 8.2How do virtual threads differ from platform threads?3 min
  3. 8.3How does garbage collection work in the JVM?Must‑know1 min
  4. 8.4How does the String pool work, and how many objects does new String create?3 min
  5. 8.5How is a record different from a traditional class?1 min
  6. 8.6What are deadlock, starvation, livelock and race conditions?Must‑know4 min
  7. 8.7What are sealed classes?2 min
  8. 8.8What are the JVM memory areas?Must‑know1 min
  9. 8.9What are virtual threads?Must‑know2 min
  10. 8.10What is a ThreadLocal and how does it work?9 min
  11. 8.11What is lazy evaluation in streams?1 min
  12. 8.12What is pattern matching for switch?1 min
  13. 8.13What is the difference between Future and CompletableFuture?Must‑know3 min
  14. 8.14What is the difference between synchronized and ReentrantLock?Must‑know8 min
  15. 8.15What is the difference between volatile and AtomicInteger?Must‑know5 min

Senior Java, Spring Boot, microservices and AWS interview questions

  1. 9.1A Kubernetes pod keeps failing. How do you troubleshoot it?4 min
  2. 9.2An API works locally but fails in production. How do you debug it?4 min
  3. 9.3An exception was thrown but the transaction still committed. Why?Must‑know4 min
  4. 9.4How do services get AWS permissions without embedded credentials?Must‑know1 min

Spring Boot internals interview questions

  1. 10.1Difference between @EnableAutoConfiguration and @Import?2 min
  2. 10.2Difference between a @Configuration class and a normal class?Must‑know3 min
  3. 10.3How did Spring Boot remove XML configuration almost completely?2 min
  4. 10.4How does Spring Boot auto-create a DataSource?2 min
  5. 10.5How does Spring Boot detect embedded Tomcat automatically?3 min
  6. 10.6How does Spring Boot handle exception translation?5 min
  7. 10.7How does Spring Boot handle externalized configuration?9 min
  8. 10.8How does Spring Boot load profile-specific configurations?Must‑know4 min
  9. 10.9What happens if two beans of the same type exist without @Qualifier?Must‑know2 min
  10. 10.10What happens internally when you add spring-boot-starter-web?Must‑know3 min
  11. 10.11What happens when you exclude an auto-configuration class?2 min

The Scala mindset for Java developers

  1. 11.1How do immutability and actors remove most classic concurrency problems?3 min
  2. 11.2When is Scala overkill and plain Java the better choice?3 min

What happens if… — 20 Java interview scenarios

  1. 12.1API loads one hundred thousand rows and returns them in one response?2 min
  2. 12.2Fetch one hundred orders, call getItems on each?Must‑know1 min
  3. 12.3LEFT JOIN orders, then WHERE order status equals PAID?Must‑know1 min
  4. 12.4New payment method added; PaymentService is a giant if-else on type?1 min
  5. 12.5Request fails three services deep, independent logs, no correlation ID?3 min
  6. 12.6Stream.concat of two lists then sorted, and one list contains null?1 min
  7. 12.7Thread 1 locks A then B; thread 2 locks B then A, concurrently?Must‑know1 min
  8. 12.8Two employees tie for top salary; second highest via ORDER BY salary DESC LIMIT 1 OFFSET 1?3 min
  9. 12.9Two threads print 1–100 (odd/even) with no synchronization?2 min

Word ladder and maximum subarray in Java

  1. 13.1How do you find the length of the shortest word ladder?4 min

Zalando Coding Interview Questions (Reported)

  1. 14.1How do you build the longest string from AA, BB and AB without three in a row?3 min
  2. 14.2How do you compute the time covered by a set of intervals?3 min
  3. 14.3How do you explain merge sort, and can it run in constant extra space?4 min
  4. 14.4How does Dijkstra's shortest-path algorithm work?3 min
  5. 14.5How does flood fill work, and how do you implement it?3 min
  6. 14.6What coding patterns show up in reported Zalando problems, and how should you solve them?5 min

Zalando interview process and recruiter screen

  1. 15.1How do you answer "What are your salary expectations?"2 min
  2. 15.2What do the hiring-manager round and the Founding Mindset assess?2 min

Zalando technical round: Java, JVM and concurrency

  1. 16.1How do you find two numbers that sum to k in a rotated sorted array?3 min
  2. 16.2What is a bounded blocking queue, and how do ArrayBlockingQueue, LinkedBlockingQueue and Semaphore compare?8 min
  3. 16.3What is a trie, and how would you code prefix autocomplete in Java?4 min
  4. 16.4When do ReadWriteLock and BlockingQueue help?7 min
  5. 16.5Why do balanced search trees matter, and when do you pick TreeMap over HashMap?3 min
  6. 16.6Why prefer immutable objects, and how is an unmodifiable view different from an immutable copy?3 min
Level 3SeniorProduction trade-offs and failure modes.56 questions · 9 topics

Apache Kafka interview questions

  1. 1.1A Kafka consumer's lag is huge but the pod looks healthy. What do you do3 min
  2. 1.2How do you handle growing consumer lag when producers outpace consumers4 min
  3. 1.3How do you keep compatibility when a producer changes the event schema while older consumers are still running2 min
  4. 1.4How do you publish events reliably when you update the database and send to Kafka5 min
  5. 1.5What happens to in-flight work when a new consumer joins and partitions are reassigned4 min
  6. 1.6Why can one hot partition stall a consumer group, and how do you fix it2 min

Java coding questions: HashMap from scratch, top-k frequent and seat booking

  1. 2.1How do you implement your own HashMap?4 min

Java Streams interview questions

  1. 3.1How are exceptions handled in Streams?2 min
  2. 3.2When should you avoid parallelStream?1 min

Modern Java interview questions

  1. 4.1How do virtual threads improve scalability?1 min
  2. 4.2How do you investigate frequent GC pauses?5 min
  3. 4.3How do you optimize memory usage in a Java application?3 min
  4. 4.4How do you troubleshoot high CPU in a Java service?3 min
  5. 4.5How would you handle thousands of concurrent API requests?3 min
  6. 4.6How would you migrate an application from Java 8 to Java 21?2 min
  7. 4.7What are scoped values?1 min
  8. 4.8What are strong, soft, weak and phantom references, and when can the GC collect each?8 min
  9. 4.9What is JPMS, the Java module system?1 min
  10. 4.10What is structured concurrency?1 min
  11. 4.11What is the difference between ExecutorService and ForkJoinPool?2 min
  12. 4.12What JVM and platform improvements do you get by moving to Java 17?2 min

Senior Java, Spring Boot, microservices and AWS interview questions

  1. 5.1A business transaction spans multiple databases. How do you keep it consistent?7 min
  2. 5.2CPU is high but request volume is flat. How do you investigate?5 min
  3. 5.3ECS, EKS, Lambda or EC2 for Java workloads: how do you choose?1 min
  4. 5.4How do ThreadLocal, static collections and lingering references cause memory retention?7 min
  5. 5.5How do you build a highly concurrent app without running out of platform threads?2 min
  6. 5.6How do you deploy with zero downtime when the DB change is backward-incompatible?2 min
  7. 5.7How do you design event-driven flows with SQS, SNS, EventBridge and Lambda?1 min
  8. 5.8How do you evolve Kafka message schemas with many consumer versions?2 min
  9. 5.9How do you handle dynamic authorization when permissions change at runtime across services?2 min
  10. 5.10How do you publish events reliably when you update the DB and send to Kafka?1 min
  11. 5.11How do you run Spring Boot highly available on AWS across multiple AZs?1 min
  12. 5.12How do you stop an unstable shared downstream from causing cascading failures?6 min
  13. 5.13How is ConcurrentHashMap thread-safe, and where does it stop helping?2 min
  14. 5.14Kafka consumer lag keeps rising, but CPU and DB look normal. Why?3 min
  15. 5.15Latency spikes now and then, and you suspect connection pool exhaustion. What do you do?4 min
  16. 5.16What is your API gateway strategy for auth, rate limiting, routing and tenant isolation?2 min

Spring Boot internals interview questions

  1. 6.1How does Spring Boot decide which auto-configuration to apply?4 min
  2. 6.2How does Spring Boot integrate with Actuator internally?3 min
  3. 6.3How does Spring Boot load application.properties internally?3 min
  4. 6.4How would you upgrade a service to Spring Boot 4, and where does AI help?6 min
  5. 6.5What are the most common Spring Boot performance mistakes?4 min
  6. 6.6What happens internally when you hit a REST endpoint?5 min
  7. 6.7What is the complete lifecycle of a Spring Bean?2 min
  8. 6.8What is the exact startup flow of a Spring Boot application?3 min
  9. 6.9What is the role of SpringFactoriesLoader?3 min

What happens if… — 20 Java interview scenarios

  1. 7.1Controller returns a JPA entity with a lazy OneToMany?2 min
  2. 7.2Kafka consumer crashes after processing but before committing the offset?2 min
  3. 7.3Remove the API gateway; frontend calls all six services directly?1 min
  4. 7.4Service calls an external API with no timeout and the API hangs?2 min
  5. 7.5Transactional method writes a file, then the DB update fails?1 min
  6. 7.6User logs out but their JWT has not expired?2 min

Zalando Coding Interview Questions (Reported)

  1. 8.1How would you implement a search box that suggests results on every keystroke?3 min

Zalando technical round: Java, JVM and concurrency

  1. 9.1How do JVM class loaders work, and what do ClassNotFoundException and NoClassDefFoundError tell you?5 min
  2. 9.2How do you size and configure a thread pool for a backend service?5 min
  3. 9.3What is the Java Memory Model, and what does happens-before guarantee?3 min
Level 4InternalsHow it works underneath, and at scale.7 questions · 3 topics

Java Streams interview questions

  1. 1.1How does distinct work?1 min
  2. 1.2How does sorted work internally?1 min

Modern Java interview questions

  1. 2.1How do G1 and ZGC compare?1 min
  2. 2.2How does ConcurrentHashMap work internally?3 min
  3. 2.3How does the Stream API work internally?1 min
  4. 2.4What is Generational ZGC?1 min

Senior Java, Spring Boot, microservices and AWS interview questions

  1. 3.1Walk through Spring bean lifecycle internals, custom init and post-processing.1 min