Video summary

Java Interview Questions 🔥 | Top 80 Most Asked | Core Java, Spring Boot, Microservices | 1–10 Yrs

Main summary

Key takeaways

Technology

Summary — Java Interview Questions (Core Java, Spring Boot, Microservices, Multithreading)

Scope

A compact interview-prep walkthrough (PDF with ~100 questions) covering core Java fundamentals up to Spring Boot and microservices patterns for 1–10 years experience. The presenter references a Java interview playlist and separate deep-dive videos for many topics.


Key technical concepts & short explanations (answers / interview tips included)

1. JVM / JRE / JDK

  • JDK: development kit (compiler, debugger, JRE, tools).
  • JRE: runtime (libraries + JVM).
  • JVM: executes bytecode, handles GC, memory, platform independence.
  • Typical flow: .java → javac → .class (bytecode) → JVM executes.

2. Class loader & parent delegation

  • JVM subsystem that loads classes at runtime (Bootstrap, Extension/Platform, Application loaders).
  • Parent-delegation improves security and prevents duplicate class loads.

3. Basic language items

  • System.out.println: System is a final class, out is a static PrintStream, println is a method.
  • public static void main(String[] args): public (visible), static (callable without an object), void (no return); args are command-line parameters.

4. Spring Cloud Config / dynamic refresh

  • Config Server (git-backed) + clients.
  • Use spring-cloud-config + @RefreshScope (and actuator /refresh) to reload properties at runtime without restart.

5. Memory leaks & OOM

  • Common causes: unclosed resources, static references, listeners, wrong references.
  • Fixes: close resources, use weak references, analyze heap dumps (jvisualvm, JProfiler, MAT), add logging/monitoring.
  • Prefer try-with-resources over finalize (deprecated).

6. OOP basics

  • Four pillars: encapsulation, inheritance, polymorphism (overloading/overriding), abstraction.
  • Interview tip: emphasize maintainability and reuse.

7. Exceptions

  • throw vs throws.
  • Checked exceptions: compile-time enforced.
  • Unchecked exceptions: runtime (RuntimeException).
  • Best practices: custom exceptions, exception propagation, order multiple catch blocks (child before parent), avoid swallowing exceptions — log and use global handlers.
  • Note finally: executes for cleanup but can be affected if it itself throws.

8. Language specifics

  • final / finally / finalize differences.
  • == vs .equals().
  • String immutability: reasons include security and caching (string pool).
  • transient prevents serialization of fields.
  • Marker interfaces: Serializable, Cloneable.

9. Collections and concurrency

  • HashMap internals: compute hash → bucket; resize doubles capacity at threshold; collisions handled via linked list, promoted to tree (red-black) when needed.
    • Returning a constant hashCode causes collisions and severe performance degradation.
  • ConcurrentHashMap: thread-safe alternative, no ConcurrentModificationException while iterating, finer-grained locking, disallows null keys.
  • ArrayList vs LinkedList: ArrayList = dynamic array (fast random access); LinkedList = doubly-linked (cheaper insert/remove at ends).
  • Comparable vs Comparator: Comparable = natural ordering (compareTo); Comparator = custom/multi-field ordering (compare).
  • Thread-safe collections examples: CopyOnWriteArrayList, ConcurrentHashMap.

10. Multithreading & concurrency constructs

  • Creating threads: extend Thread vs implement Runnable (prefer Runnable); Callable returns a value and can throw checked exceptions.
  • Synchronization: synchronized methods/blocks, intrinsic vs explicit locks, volatile for visibility.
  • wait / notify / notifyAll (Object methods) vs Thread.sleep.
  • Deadlock: causes and avoidance (lock ordering, tryLock, avoid nested locks).
  • Executor framework / thread pools (Executors.newFixedThreadPool), resource management.

11. Memory model & GC

  • Stack vs Heap: stack per thread, heap shared.
  • Metaspace replaced PermGen (Java 8+).
  • Generational GC: young/old generations; minor vs major GC.
  • Tools: heap dumps, jvisualvm, MAT, profilers; monitoring with Prometheus/Grafana.

12. Spring / Spring Boot essentials

  • Spring Boot = auto-configuration + embedded server + starter dependencies.
  • Use @SpringBootApplication (component scan + enable auto-config + configuration).
  • Dependency Injection / IoC basics; bean stereotypes: @Component, @Service, @Repository (@Repository adds DB exception translation).
  • @Transactional for DB transaction management and rollback.
  • Controller vs @RestController (@RestController = @Controller + @ResponseBody).
  • Global exception handling with @ControllerAdvice and @ExceptionHandler.

13. Microservices fundamentals & patterns

  • Service registry & discovery: Eureka.
  • API Gateway: single entry point (routing, auth).
  • Centralized config: Config Server.
  • Circuit breaker (Resilience4j): open / half-open / closed states to prevent cascading failures and provide fallbacks.
  • Feign client (preferred over RestTemplate; RestTemplate is being deprecated).
  • Saga pattern for distributed transactions (choreography or orchestration).
  • Security: OAuth2, JWT, API Gateway authentication.
  • Asynchronous/event-driven patterns with Kafka; scalability: caching, load balancing, horizontal scaling.

14. JPA / Hibernate

  • JPA = persistence API spec; Hibernate = a common implementation.
  • Eager vs lazy loading.
  • N+1 select problem (avoid with fetch-join / appropriate queries).
  • Locking: optimistic (version-based) vs pessimistic (lock-based).

15. Production troubleshooting & best practices

  • Instrumentation: logs, actuator endpoints, metrics, distributed tracing, Prometheus/Grafana.
  • Operational fixes: graceful rollouts, hotfixes, circuit breakers, retries, caching, scaling, async patterns (Kafka), correct exception handling and HTTP status codes for REST APIs.

Resources & tutorial pointers mentioned

  • PDF with ~100 Java interview questions (presenter’s resource).
  • Channel playlist: Java interview course; individual videos for HashMap internals, final/finally/finalize, == vs equals, and other deep dives.
  • Tools: jvisualvm, JProfiler, Eclipse MAT, Prometheus, Grafana.
  • Contact / coaching: Topmate profile (presenter’s offered help).

Main speaker / sources

  • The video presenter (channel owner) — refers to his Java interview playlist and prior “Namura Java interview questions” video.
  • Content draws on standard Java / Spring / Spring Cloud, Netflix Eureka, Resilience4j, Feign, Kafka, JPA/Hibernate documentation and common industry practices.

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video