Java Interview Questions
Java Interview Questions
Core Java
- What is JDK & JVM?
- JDK = JRE + Dev Tools
- JRE = JVM + rt lib
- What is a JIT compilation?
* - what are OOPs features?
*- Abstaction, Encapsulation, Inheritance, Polymarphsm ( AEIP like AEIOU)
- What is abstraction?
- What is Data hiding?
- How does class loading work?
- What is a constructor?
- What is final?
- What is static?
staticmeans class-level, belogns to class, not to object
- What is abstract?
- Why it is not allowed to mark a class static?
*- static means class-level
- Top-level class is already class-level, So static is meaningless
- β Only nested (inner) classes can be static
- Why Strings are immutable in Java?
* - String Vs StringBuffer Vs StringBuilder?
- What is String Pool? How it works?
***-
How many objects will get created for the below code?
String s1 = "hello"; String s2 = new String("world"); -
How many objects?
String s2 = new String("world"); - How to make Heap String object to point to pool object?
- using
intern()method. -
The intern() method moves the string to the string pool (if not already present) and returns a reference to the pooled instance.
-
public class StringInternExample { public static void main(String[] args) { String heapString = new String("Hello"); // Created in heap memory String poolString = heapString.intern(); // Moved to string pool String literalString = "Hello"; // Already in the string pool System.out.println(poolString == literalString); // true, both refer to the same object in the string pool } }
- using
-
What will be the output? Why
String s1 = "hello"; String s2 = new String("hello"); String s3 = "hello"; System.out.println(s1==s2); System.out.println(s1==s3); String s4 = s2.intern(); System.out.println(s1==s4);
-
- Whay is
wrpper pool? How it works?***- it is same like
string poolbut wrapper classes - it stores/creates obejcts in
wrpper poolforWrapper objects - it creates obejcts only if the wrapper object is in
byte rangeie-128 to 127- for char
0 to 127& for booltrue / false
- for char
-
evey wrapper class has itβs own pool
-
Guess the output?
Integer i1 = 127; Integer i2 = new Integer(127); Integer i3 = Integer.valueOf(127); // like string.intern() Integer i4 = 127; System.out.println(i1 == i2); System.out.println(i1 == i3); System.out.println(i1 == i4); System.out.println("----------");
- it is same like
hashCode()vsSystem.identityHashCode()vsObject.hashCode()Object.hashCode()- this returns hashcode based on
memoryaddress - this wonβt consider object state / contents
- this returns hashcode based on
System.identityHashCode()- this internally calls
Object.hashCode(), so returns hashcode based onmemoryaddress
- this internally calls
hashCode()- this methods exists in Object class, can be overriden
- Generally, weβll override this, based on the object state
- such a way, obejcts with some state should retrun same hascode
- if we wonβt override..then internally it calls
Object.hashCode()
- How to make an immutable class?
* - How many ways we can create a object in java?
*- new
- literal eg: ` String s = βabcβ; `
- clone()
- reflection
- Cloning? Shallow Copy Vs Deep Copy?
- for deep copy / or custom clone - implement Clonnable & override clone
- Can we override static menthods? If not why
* - Abstract Class Vs Interface?
- Polymorphism?
- Inheritance?
- Overloading Vs Overriding? or Static Polymorphism Vs Runtime Polymorphism?
*- which is fast?
- can we change the return type in override method in child class?
*- Yes, but only
Covariant return type(same or subclass of parent return type)
- Yes, but only
-
can we change the throwing calls type in override method in child class?
*-
// in Parent method() throws Excepion // in child method() throws IllegalArgumentException
-
- What is Diamond Problem in inheritance in Java?
- Why multiple inheritance is not supported?
- to prevent ambiguity
- Why we should not apply private & abstract together?
* - Why we should not apply static & abstract together?
* - How to execute a piece of code before the main method?
*- Static Block
- What is the order of execution of the following:-
*- constructor, initializers, static initializers, parent constructor, parent initializers, parent static initializers, main method?
- A:- Parent static β Child static β main() β Parent init β Parent constructor β Child init β Child constructor
- What is an exception? Give a few examples. When will they occur?
- Checked Exceptions Vs Un-Checked Exceptions?
* - Thow vs throws?
- What
- Is
catchblock mandatory? - Is
finallyblock mandatory?
- Is
finalvsfinallyvsfinalize- what are default methods?
*- A:- instance methods like ( but not, they canβt access instnace variables )
- can we declare default methods in abstract calss?
- No
- can we override default methods?
- Yes
- if default method is instance method, can it access instance variable
- can we declare instance variables in interface?
- No
- What are Collections in Java? Give a few examples, that you used.
- List Vs Set? [ LinkedList vs HashSet ]
- TreeSet Vs HashSet?
- what is Map?
- How HashSet ( HashMap ) works?
* -
Note: HashSet internaly uses hashMap
- ArrayList vs LinkedList?
- When LinkedList are better over ArrayList?
*** - HashMap vs ConcurrentHashMap
* - How ConcurrentHashMap works?
*- thread-safe, faster
- Uses bucket-level locking
- Multiple threads access safely
- No full map lock
- Stack Vs Queue?
- Why do we need to override hashCode?
- Do we need to override both hashCode and equals? if we are using HashSet to store our object?
*- Yes, hashCode to find the bucket & equals is to check equality check
- Can we use Object as a key in HashMap? [ eg: Employee class object ]?
***- Yes, we can use. But we should use immutable class, else itβll lead to hash collision
- Hash Collision?
- Can we add two objects with the same data/states in HashSet/HashMap? Will it allow all? What is the count?
- Depends on the hashcode implementation,
- so if not implemented, itβll allow duplicates, bcz it compares the address
- default hashcode return the address of the object
- Can we delete/modify an element from a list/collection while iterating using each loop? If not why?
* - How to iterate over the Map?
- HashMap vs LinkedHashMap vs TreeMap?
- HashMap β no order, fastest
- LinkedHashMap β insertion order maintained
- TreeMap β sorted order (ascending)
- HashMap vs SynchronizedMap vs ConcurrentHashMap?
**- HashMap β not thread-safe
- SynchronizedMap β thread-safe (full lock, slow)
- ConcurrentHashMap β thread-safe (bucket-level lock, fast)
- HashMap Vs HashTable?
- HashMap β not thread-safe, allows 1 null key : slower
- Hashtable β thread-safe, NO null key/value : faster
- does Treemap allows null key
- TreeMap does NOT allow null keys
- Uses compareTo() / Comparator β Null cannot be compared β NullPointerException
- Comparable vs Comparator?
*** - Can add any User/class without comparable implementation in TreeMap
- we CANNOT add custom objects to TreeMap without Comparable or Comparator
- Generics?
*- Allows type-safe code
- Compile-time checking, No casting, Clean code
- Benifits: Avoids ClassCastException β Reusable classes & methods
- Type safety + no casting βοΈ
- What is
type erasure?- Generic info removed at runtime
<T>vs<?>difference?<T>= type parameter<?>= unknown type
- Bounded generics (
<? extends T>,<? super T>) ( Lower bounded, Upper bounded) <? extends T>vs<? super T>***- <? extends T> : Accepts T or its child (read-only)
-
<? super T> : Accepts T or its parent (write-safe)
-
class Animal {} class Dog extends Animal {} // List<Dog> dogs = new ArrayList<>(); List<? extends Animal> list = dogs; // <? extends T> (Read-only) Animal a = list.get(0); // allowed, type safe list.add(new Dog()); // β NOT allowed // List<Animal> animals = new ArrayList<>(); List<? super Dog> list = animals; // <? super T> (Write-safe) list.add(new Dog()); // allowed ( write) Object obj = list.get(0); // only Object, Cannot read as Dog
- Can we use
primitive typesin generics?- No, use Wrapper classes
- Generic class vs generic method?
- Class: type at class level
- Method: type at method level
- Why arrays are covariant but generics are not?
- Can we create
generic exception class?- NO
- Difference between
List<Object> & List<?>Object: accepts all?: read-only i.e? extends Object
- Why generics introduced in Java?
- Type safety + no casting βοΈ
- Garbage collection? Types of Garbage collections? How do they work?
*- Memory Management
- types
Serial GCβ Single thread β Small apps
-
Parallel GCβ Multi-threaded β High throughput -
CMS GCβ Low pause time -
G1 GC(Garbage First) β Region-based β Default (Java 9+)
How GC worksMarkreachable objectsSweepunused objectsCompactmemory
-
what is Region-based GC
Meaning:- Heap is divided into
small fixed regions - instead of Young/Old generations.
- Heap is divided into
- Used in:
G1 GC -
How it works: - Each region can be
young / old / free - GC collects
only required regions - Predictable pause time
Benefit:- Better memory utilization
- Low pause time
Region-based GC =
GC works on small heap regionsinstead of whole heap βοΈ -
what are new improvements in GC after java8
-
G1 GC became default(Java 9) β Region-based β Predictable pause time -
ZGC(Java 11+) β Ultra-low pause (<10ms) β Scalable (TB heap) -
Shenandoah GCβ Low latency β Concurrent compaction -
Epsilon GCβ No GC (testing, performance) -
Better heap managementβ Improved compaction β Less fragmentation -
Improved concurrent GCβ Less stop-the-world β Better responsiveness
Post Java8 β
Low latency + scalable + concurrent GCsβοΈ -
- When the static variables are available for garbage collection?
* - How to make object available for garbage collection?
*- de-reference
assign to null - System.gc()
- de-reference
- What is volatile?
*- Ensures visibility of changes across threads
- Prevents cache inconsistency
- volatile = latest value always visible to all threads
- What is transient?
*- Variable not serialized, Skipped during serialization
- What is serialization( deserialization)?
* - what is externalization?
-
In the parent, serialization is implemented but not in the child. Will it work or throws an error? [ Vice-Versa]
- Case 1: Parent implements
Serializable, Child does NOT- Works fine: Child is automatically serializable
- Case 2: Child implements
Serializable, Parent does NOT- Works BUT:
- Parent must have
no-arg constructor - Parent data will NOT be serialized
- Parent must have
- Works BUT:
- Parent serializable β Child auto serializable
- Child serializable β Parent needs default constructor βοΈ else Exception
- Case 1: Parent implements
- Can we overload the main method?
* - What are all the optional modifiers that we can add to the main methods?
- What are all the changes allowed for the main method
finalsynchronizedstrictfp
- strictfp
- same floating-point results
- Ensures precision consistency
- Avoids hardware differences
- Applicable to : class, method
- What are the methods exists in the Object class?
- Enum?
- can Enum have methods?
- Yes
- can Enum have methods?
- How does JVM divide/allocate memory? or Memory types in JVM?
-
JVM memory =
Heap + Stack + Method Area + PC + Native Stack Heap- Stores objects & instance variables
Stack- Method calls
- Local variables
Method Area- Class metadata
- Static variables
- Runtime constant pool
PC Register- Current instruction address
Native Method Stack- Native (C/C++) calls
-
- I/O in Java? [ Files, Command line, Rest API, Serialization-Deserialization, etc ]
- What is a Thread in Java?
- Instructions + Memory(Shared) + Control Flow
- What is Multi-Threading?
- Thread vs Process vs Program?
- What is deadlock?
- What is race condition?
- What is a synchronized keyword?
- What is thread-safety?
- Code works correctly, Even with multiple threads
- How to overcome the deadlock situation?
- Avoid nested locks
- Use timeout
- Lock ordering
- Use tryLock()
- Thread lifecycle?
- New β Runnable β Running β Blocked β Terminated
- Sleep vs Wait methods?
- sleep() β Thread class β no lock release
- wait() β Object class β releases lock
- What happens when we call the join method?
- Current thread waits
- Until another thread completes
- Consumer and Producer problem example?
- How many ways we can create Threads in Java?
***- extending Thread
- implementing Runnable
- implementing Callable
*
- Why should we prefer implementing Runnable over the Extending Thread?
- Callable vs Runnable?
*** - What is a Future Object?
*** - What is ExecutorServic ###
Types of GCe?*** - What is ThreadPool?
- What is BlockingQueue?
*** - Did you use the reentrantlock? What is the use of it?
- What are the new features in Java-8?
***- Lambda Expressions (Functional Programming) - Functional Interfaces***- Consumer
* - Supplier(Producer)
* - Predicate
*- Stream API (Processing Collections Efficiently)
*** - Default metods in interface
- Method References (:: Operator)
- Optional Class (Avoiding NullPointerException)
- New Date & Time API (java.time Package)
Collectorsin Stream API*- Base64 Encoding and Decoding
- Stream API (Processing Collections Efficiently)
- Consumer
- Rest parameters?
- Optional return type?
- What is a functional interface?
- Interface with only one abstract method
- Used for Lambda
- Consumer, Supplier,and Predicate interfaces?
Consumer<T>β takes input, no returnSupplier<T>β no input, returns valuePredicate<T>β returns boolean
-
What are the Lamda functions? - Short form of anonymous method - Used with functional interfaces
-
Can an interface have methods with the implementation?
- Method reference?
- Shortcut for lambda
- Refers to existing method
- Types
- Class::staticMethod
- obj::instanceMethod
- Class::new
-
What are streams in java? - Filter vs Map? - Stream vs ParallalStream? - Map vs FlatMap in streams?
- Stream vs ParallelStream
- Stream =
single thread- ParallelStream =multi-threaded processingβοΈ -Stream- Sequential processing
- Single thread
- Predictable order
- Good for small tasks
-
ParallelStream - Parallel processing
- Multiple threads
- Faster for large data
- Uses ForkJoinPool
ForkJoinPool- Thread pool forparallel tasks- Useswork-stealingalgorithm - Splits task (fork) - Merges result (join) -Used by:ParallelStream- RecursiveTask / RecursiveAction
- ForkJoinPool =
framework for parallel executionβοΈ
-
How streams are faster than normal for loops - Streams are faster due to
lazy execution + parallel processingβοΈ - Useslazy evaluation- Supportsparallel processing- Internaliteration optimization- UsesForkJoinPool(for parallel streams) - Better CPU utilization - CompletableFeature?
* - Sealed classes?
* -
Records?
*- Special class to store immutable data - Auto generates: constructor, getters, equals, hashCode, toString - can Record extend another class?: No (already extends Record) - can Record implent interface?: Yes - can Record have methods?: Yes - how to create custom annotations ?
* - How to implement the Singleton class?
- Reflection?
- What are Blocking collections?
* - What are concurrent collections?
* - what are
CountDownLatchandCyclicBarrierinjava.util.concurrent? - what is
niopackage?- non-blocing io?
- what is try with rerource? what are the benefits?
- can we pass object in switch case?
- yes in java17 afterwards
- in
switch expression - also we can use
Guarded Patterns
- in
- yes in java17 afterwards
- what are text blocks?
- multiline string after
java13
- multiline string after
- in User class has name & age
***- using streams- group users by name
- sort by age
- find 2nd youngest
* - find dublicate user
-
using streams
***- for a given string find no of occurance of each character***- find dublicate chars***- find unique chars* -
Different Types of Deisgn Patterns?
- What are major improvements in
Hashmapafter java7 - prevouslylinkedlistused- Worst-case time complexity: O(n) when many keys collide
- now
- initially
linkedlistif capacity increasedRed-Black Tree - Worst-case time complexity: O(log n) when many keys collide
- Thresholds introduced
- Untreeify threshold:6, Treeify threshold : 8, Min capacity for treeification: 64
- Tree conversion (
linkedlisttoRed-Black Tree) happens only when:- Bucket size β₯ 8
- HashMap capacity β₯ 64
- major Garbage Collection (GC) improvements after Java 7
- After Java 7, Java 8 removed PermGen, introduced Metaspace, stabilized G1 GC
- and later versions added ultra-low latency collectors like ZGC and Shenandoah.
- In detail
- Java 7
- PermGen (Fixed size) β OutOfMemoryError
- Monolithic heap handling
- G1 GC ( java 8)
- region based gc (Heap split into regions)
- Predictable pause time goals
- Low pause times ( Low latency GC )
- Automatic heap compaction
- Better for large heaps
- Metaspace (Native memory) β Grows dynamically
- Fewer OOM errors
- Better class loading handling
- Parallel GC
- Better multi-core utilization
- Smarter work stealing between GC threads
- Java 7
- Ccan a static block throw exception
- yes, only unchecked exceptions ( RuntimeExceptions )
- LinkedList in java is SingleLinkedList or DoublyLinkedList
-
Virtual Threads? - how they work? - Virtual Threads vs Platform threads?
- If I create Strings using StringBuilder for the first time: - How many objects get created? - Does it create anything in the String Pool?
JDBC
- What is a connection pool?
* - How does Driver Manager connect to db?
- Statement vs Prepared Statements ?
Servlets&Jsp
- What is Servlet?
- Lifecycle of Servlet?
- load class
- init() β called once
- service() β handles requests
- destroy()
- Lifecycle of JSP?
- compilation
- load class
- init() β called once
- service() β handles requests
- destroy()
Spring MVC
- What is spring?
- What is AOP?
*- Separates cross-cutting concerns
- Logging, security, transactions
- What is IOC?
*- Object creation handled by Spring
- Not by developer
- What is dependency injection?
* - What is a spring container?
- Manages bean lifecycle
- Creates & injects objects
- Examples: ApplicationContext
- Singleton vs Prototype?
- Singleton β One object per container
- Prototype β New object every request
- What is a session?
- what are different scopes of a bean in spring or spring boot?
***- singleton β default
- prototype
- request
- session
- application/applicationContext
- websocket
Spring Boot
- What is a spring boot?
- Spring vs Spring MVC vs Spring Boot?
*** - What is maven?
- What are the benefits of using spring boot over the spring MVC?
-
What are the different scopes in spring boot ( spring )?
***- Singleton, prototype, request, session, applicationContext, WebSocket -
What are the different types of contexts?
BeanFactory: β Basic containerApplicationContext: β Advanced containerClassPathXmlApplicationContext: β Loads from classpathFileSystemXmlApplicationContext: β Loads from file systemAnnotationConfigApplicationContext: β Java config (@Configuration)WebApplicationContext: β Web apps
- How many ways we can create beans in Spring boot?
*@Component:@Service,@Repository,@Controller@Bean: Method level inside@Configuration@Configuration + @BeanXML configuration(legacy)
- Controller vs RestContoller?
* - What are interceptors?
* - Component vs Controller vs Service vs Repository?
-
The life cycle of a bean?
* -
What @SpringBootApplication annotation does?
*** - What @Configure, @EnableAutoConfiguration, @ComponentScan annotation do?
*- @Configure: Marks class as config class
- @EnableAutoConfiguration: Spring Boot auto config, Based on classpath & properties
- @ComponentScan: Scans packages, Finds @Component, @Service, @Repository
- How many ways we can set the values in spring boot?
- What @AutoWired annotation does?
- What @Qualifies annotation does?
- What is @Primary annotation does?
* - How to read data(values) from application.properties?
- @Value
- @ConfigurationProperties
- How to use environment-based properties files?
- spring.profiles.active=dev
- application-dev.properties, application-test.properties
- I have application-dev.properties & application.properties & spring.profiles.active=dev
- then which proprty file is loaded
- A: Profile file has higher priority
- Base file loads first(application.properties) β profile file overrides(application-dev)
- What are profiles in spring boot?
- @Profile
- Used to enable/disable beans
-
Based on active environment
-
@Profile("dev") @Component class DevBean { }
- How to connect more than one DB using spring boot?
- JPA vs CRUD repository?
- What does @id, @transient annotation do?
- How to execute custom DB queries in Spring boot?
- @Query
- @Modifier
- @Param
- Native Queries
- CriteriaBuilder
- Hibernate Query Language Vs Native Query?
- What @Transactional annotation does?
*** - What is the connection pool?
- getById vs findById?
- EagerLoading vs LazyLoading?
*** - How to handle exceptions or error handling?
***- in controller
- in controller advice
- How to handle global exceptions in spring boot?
*** - How (best way ) to create threads in spring boot?
***- Use @EnableAsync, @Async + ThreadPoolTaskExecutor
-
interceptors vs filters?
*- Filter
- Part of
Servlet - Runs
before request enters controller - Works at
container level - Use: logging, auth, CORS
- Package:
javax.servlet
- Part of
- Interceptor
- Part of
Spring - Runs
before/after controller - Works at
framework level - Use: validation, auth, logging
- Package:
org.springframework
- Part of
- Filter β runs
earlier& Interceptor β runsafter filter
- Filter
Spring Boot Advance & Micro Services
- Spring boot actuator
- Caching
*- @EnableCaching ( @Cacheable, @CachePut, and @CacheEvict )
- @Cacheable: the result of a method should be cached
- @EnableCaching ( @Cacheable, @CachePut, and @CacheEvict )
- CommandLineRunner
- How to connect to multiple DBs?
* - Internationalization (i18n)
- Testing
- @SpringBootTest, @MockBean, and @DataJpaTest
- JPA pagination
- @Transactional
*- @Transactional(propagation = Propagation.NESTED)
- @Configuration
***- @ConditionalOnMissingBean
- How to load beans conditionally?
*- @Conditional
- @Profile
- @TransactionalEventListener
- @TransactionalEventListener = event handling tied to DB transaction state
- Phases
- BEFORE_COMMIT
- AFTER_COMMIT β (most used)
- AFTER_ROLLBACK
- AFTER_COMPLETION
- scheduled task
- @EnableScheduling
- @Scheduled
- @ConfigurationProperties
- to bind application.properties to an object / class
- file upload
- @Import
- @EnableAsync
- @Async
- @DynamicPropertySource ( Testing )
- database migrations
- Flyway
- Liquibase
*
- @Retryable
- distributed caching
*- Redis
* - Hazelcast
- Redis
- distributed session management
*- Redis
* - Hazelcast
- Redis
- distributed locks
*- shedLock
- @Lazy
* - server-sent events (SSE)
-
@EventListener
- How to Register a Custom Auto-Configuration?
- How to Disable a Specific Auto-Configuration?
- If we want to disable a specific auto-configuration,
- we can indicate it using the exclude attribute of the @EnableAutoConfiguration annotation.
-
what are
Spring Boot Starters - How to optimize API request
- first DB level
- primary keys
- index
- fetching required fields
- avoding un-necessary joins
- query pagination
- using cache
- Paginataion
- Images as a seperate api
- sending only required fields in response
- first DB level
- DTO
* - Bean vs Entity vs DTO
-
How to disable one specific package in spring boot
-
Exclude package from component scanning
@SpringBootApplication( scanBasePackages = "com.myapp", excludeFilters = @ComponentScan.Filter( type = FilterType.REGEX, pattern = "com.myapp.unwanted.*" ) ) public class MyApp { } -
Disable a specific auto-configuration(If the package is coming via auto-config)
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) -
Disable via application.properties (Used when the package is conditionally enabled.)
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration -
Disable beans using @Profile
@Profile("!prod") @Component public class TestOnlyBean { }
-
- How to do our own auto configuration
-
Step 1: Create configuration class
@Configuration @ConditionalOnClass(MyService.class) public class MyAutoConfiguration { @Bean @ConditionalOnMissingBean public MyService myService() { return new MyService(); } } - Step:2 Register auto-config
- create a file (spring 3.+)
META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
- add property
com.myapp.autoconfig.MyAutoConfiguration
- create a file (spring 3.+)
-
Step 3: (Optional) Enable via properties
@ConditionalOnProperty( name = "my.feature.enabled", havingValue = "true", matchIfMissing = false ) - one liner:
Auto-configuration uses conditions + classpath scanning + properties to configure beans automatically.
-
- application.properties vs application.yaml
- what are named queries?
- Named Queries are static, pre-defined JPQL queries defined once and reused.
- Advantages
- Validated at startup
- Reusable
- Cleaner code
- Advantages
-
eg:
@Entity @NamedQuery( name = "User.findByEmail", query = "SELECT u FROM User u WHERE u.email = :email" ) public class User { } -
usage
@Query(name = "User.findByEmail") User findByEmail(@Param("email") String email);
- Named Queries are static, pre-defined JPQL queries defined once and reused.
- what are native queries?
- Native Queries use database-specific SQL, not JPQL.
- When to use native queries?
- Complex joins
- Database-specific features
- Performance-critical queries
- Stored procedures
- When to use native queries?
-
eg:
@Query( value = "SELECT * FROM users WHERE status = ?1", nativeQuery = true ) List<User> findActiveUsers(String status);
- Native Queries use database-specific SQL, not JPQL.
-
Named vs Native Queries
Named Query Native Query Uses JPQL Uses SQL DB independent DB dependent Entity based Table based - in Saga design patternβ¦.one service executed 5 steps out of 7 & failed. How to handle this
- How to pass dynamic values to CI pipelines
- secrets & config
- atrifact information
Spring Security
- method-level security (
@PreAuthorize,@PostAuthorize,@Secured)* - what is filterSecurityChain
- How to secure mvc controller ? or APIs
- method level security
@PreAuthorize,@PostAuthorize,@Secured
- @EnableWebSecurity
- SecurityFilterChain
- authorizeHttpRequests & requestMatchers/matchPattern
- SecurityFilterChain
- method level security
Spring Boot Micro Services
- did you work with any message queues
- RabbitMQ
* - Apachekafka
*
- RabbitMQ
- How to communicate b/w the micro services
*- Synchronus comminication
- REST
- GraphQL
- GRPC
- ASynchronus comminication
- Event-driven architecture
- Messaging Queues
- RabbitMQ
* - Apachekafka
*
- RabbitMQ
- Messaging Queues
- Event-driven architecture
- Synchronus comminication
-
OpenTelemetry metrics, logs, and traces
- How to see logs in Micro services
***- ELK Stack (
Elasticsearch,Logstash,Kibana) Promtail&Loki
- ELK Stack (
- Observaility in micro services
***- logger
- ELK Stack (
Elasticsearch,Logstash,Kibana)* Promtail&Loki*
- ELK Stack (
- Metrics
- Spring Boot Actuator with
MicroMeter plugin&Prometheus
- Spring Boot Actuator with
- Tracing
- Spring Boot Actuator with
zapkin plugin&Tempo
- Spring Boot Actuator with
- Dashboard
- Grafana
- logger
-
Observaility
*-
Spring Boot ----> Centalized Service ================================================================================== Logging: Logstash ----> Elasticsearch for storage & Kibana for View (or) Logging: Logstash ----> Elasticsearch for storage & Loki for View Metrics: Actuator with MicroMeter plugin ----> Prometheus Tracing: Actuator with zapkin plugin ----> Tempo
-
-
What are different types of Micro Service Architecture Design Patterns?
- Application Performance Monitoring (APM) tool
- used to monitor, analyze, and optimize application performance in real time.
AppDynamics
Other Spring Boot Topics
- Spring Cloud: The Ecosystem for Distributed Systems
- Spring Cloud Config
- Eureka
* - Zuul
-
Hystrix
- Service discovery
- Netflix Eureka
- HashiCorp Consul.
- Reactive programming Spring WebFlux