Tuesday, 11 August 2026

2026 Interview Preparations


====================

Java 8 vs Java 11 vs Java 21

====================

Java 8 : Lamda expressions, Functional Interfaces, Default and Static interfaces, Streams, Completable features and New Date and time functions are introduced


Java 11 :  Local Variable syntax changes in Lamda,  Enhanced Streams and Collections concepts and HttpClient is introducted 


Java 21 : Virtual Threads, Pattern Matching in swith, Record Patterns and Sequence Collections are introduced 


Java 25 : Collection Performance, Stream preformance, Concurrent & Runtime Performance and I/O Security Enhancements. 


Immutable Class : A class which is not having setters and who's instance cannot be change after they are created.

  • Declaring a final class 
  • Make all fields are private 
  • Make all fields are final.
  • Donot provide the setters. 
Advantages of Immutable class : 
  • Thread safety
  • Security & Consistency 
  • Reliable Hash keys

Microservices Design Patterns : 

Circuit Breaker DP : 

Circuit breaker implemented using Resillance4J and it has 3 components : CLOSED, OPEN and HALF-OPEN.

CLOSED : When failure rate threshold is below 

OPEN : When failture rate threshold is above 

HALF-OPEN : After wait durtaion it will go to HALF-OPEN

Circuit breaker uses two types of sliding windows to store and aggregate the outcome of calls. 

1. Count based sliding window

2. Time-based sliding window

Bulk Head Pattern : 2 types of SemaphoreBulkhead and FixedThreadPoolBulkhead 

Rate Limtter Design Pattern : Rate limiting is an imperative technique to prepare your API for scale and establish high availability and reliability of your service.

Retry Design Pattern : Just like the CircuitBreaker module, this module provides an in-memory RetryRegistry which you can use to manage (create and retrieve) Retry instances.

Saga Design Pattern : 

Event Driven Approach Design Pattern : 

  • Kafka based event driven approach

Database Design Pattern : 

Indentity Design Pattern : Security Identity Management (verifying who is making requests) and Domain Data Identity (how data entities maintain their identifiers across service boundaries)


Feign Client vs Rest Client : 

The primary difference is that Feign Client is declarative (you write an interface and let the framework generate the HTTP code), while a Rest Client is programmatic/fluent (you manually write the steps to build and execute the request).

Microservice vs Monolithic : 

A monolithic architecture consolidates all software components into a single program, whereas a microservices architecture divides the application into separate, self-contained services.

When to Use Microservices

Microservices are advantageous for certain types of projects:

  • Complex Systems

  • Scalability

  • Technology Diversification

  • Autonomous Teams: For bigger organizations with multiple teams that need to work independently.

Challenges while using Microservices : 
  • Database per service
  • Data inconsistency 
  • Integrate Testing
How Microservies communicate each other :
  • Synchronous
  • Asynchronous
  • Restful api's
  • Event Based communication
  • Database per service
  • API-Gateway

How would you decompose a monolithic application into microservices?

  • Identify Domains
  • Service Boundaries
  • Data Segrigation
  • Decouple services

Kafka Based Interview Questions :

Kafka consumer vs Consumer Group : 

  • Kafka consumer reads the data from the topic
  • Consumer group is a set of consumers work together and reads one or more topics.
OffSet : 
  • Offset is a unique sequential identifier record with in a partition.
  • Kafka tracks the offset per partition, per consumer group. So each group can consumes its own position.
How does kafka handles data retention : 
  • Retention can be time based, once it reaches to limit old message will be discarded.
  • Retention limit will be provided while creating the kafka clusters.
How Kafka ensure the data consistency : 
  • Replication : Each partition is replicated across the mulitple brokers 
  • Acknowlegements : Producers can wait for leaders only
  • Atomic, orders writes to a partition
  • Idempotent producers to prevent duplicate writes on retry.
KRaft :
  • To manage the metadata management kafka introduced the KRaft by removing the dependency on Apache ZooKeeper.

Streams

Parllel Stream vs Stream : 
Streams
  • Run's single thread and results are predictable
  • Sequential
  • Low overheaded
                
Parllel Streams
  • Run's on multi threaded and results are unpredictable.
  • Parllel
  • High Overheaded due to thread management.

Map vs Flat Map : 

Map : 
  • One to one mapping 
  • To use basic data transformation

FlatMap : 
  • One to Many (zero)mapping
  • To handling collection of collections 
Tweleve-Factor App Concepts in java : 
  1. CodeBase
  2. Dependencies
  3. Configuration 
  4. Backing services 
  5. Build, Release, Run
  6. Processes
  7. Port Binding
  8. Concurrency 
  9. Disposability
  10. Dev/Prod Parity 
  11. Logs
  12. Admin Process

AWS Interview Questions : 

What is Cloud Computing : 
Cloud computing provides on-demand access to IT resources like compute, storage, and databases over the internet.

3 Types of Cloud Computing : 

  1. SAAS (Software as a service) : Aws email service etc services by AWS.
  2. PAAS (Platform as a service) : Elastic Beanstalk, Heroko.
  3. IAAS (Infrastructure as a service) : EC2 instance, S3 Storage, VPC.

EC2 Instance : Elasic Cloud Computing
  • Scalable virtual servers called instances in AWS
  • EC2 instances are used to host websites 
  • Run batch job process to acheive scalability

S3 Storage : 

  • Simple Storage Service 
  • Stores the objects in secure way
IAM : 
  • Identity Access Management
  • Helps you to securely access to AWS services 
  • IAM allows us to manage users & Roles.
RDS : 
  • Relational Database Service
  • To Manage the database service
VPC : 
  • Virtual Private Network
  • To create a virtual network in AWS.
AWS Cloud Watch : 
  • Uses for monitoring purposes
  • Metrics, Alarms, Logs, Events 
AWS Lamda : 
  • Server less Compute service
ELB : Elastic Load Balancer
EBS : Elasic Bean Stalk

Blue Green Deployment : 
  • Blue means current version deployment
  • Green means new version deployment
ECS : Elastic Container System 
  • Replacement to kubernetes, this simplifier to run EC2 Instances.
AWS Code Build : Compile the code, run tests, produce deployable artificats 
AWS Code Deploy : Deploy into AWS Environment
AWS Code Pipeline : Automate the deployment process using CICD workflow.

Amazon ECS : Deploying the Docker based applications into ECS Containers. 
AWS Secrets : Maintain the sensitive information into secret manager service.

Migrating the Old Application into New Applicaiton in AWS : 
  • Must follow the 7 Rs Framework 
  1. Rehost
  2. Replatform
  3. Repurchase
  4. Refactor
  5. Retire
  6. Retain
  7. Relocate 
  • Used EC2 and RDS to migrate also important.

DataStructures : 

  • Array
  • String
  • Linked List
  • Queue
  • Stack
  • Tree 
  • Graph
  • Hashing


    







No comments:

Post a Comment

Kafka

 KAFKA     Apache kafka is highly scalable and distributed platform for creating and processing the streams in RealTime.   Messaging system ...