Interview Tips
Interview Tips
Principle Description
S — Single A class should have only one reason to change,
Responsibility Principle meaning it should only have one job or
(SRP) responsibility.
Software entities (classes, modules, functions)
O — Open/Closed
should be open for extension but closed for
Principle (OCP)
modification.
Subtypes must be substitutable for their base
L — Liskov Substitution
types without altering the correctness of the
Principle (LSP)
program.
I — Interface Clients should not be forced to depend on
Segregation Principle interfaces they do not use; create smaller, specific
(ISP) interfaces.
D — Dependency High-level modules should not depend on low-
Inversion Principle level modules; both should depend on
(DIP) abstractions (interfaces).
NFR
Description Key Considerations
Category
Ability to handle increased Horizontal scaling, service
Scalability
load by adding resources. replication, load balancing.
Response time and Asynchronous processing,
Performance throughput of the system caching, efficient data
under various conditions. access.
Availability System uptime and Redundancy, failover
NFR
Description Key Considerations
Category
reliability, minimizing
mechanisms, health checks.
downtime.
Ability to recover from
Circuit breakers, retries,
Resilience failures and maintain service
graceful degradation.
continuity.
Protecting data and services
Authentication, authorization,
Security from unauthorized access
data encryption, secure APIs.
and breaches.
Modular design, clear
Maintainabil Ease of making changes and
documentation, automated
ity updates to the system.
testing.
Observabilit Ability to monitor and trace Logging, monitoring tools,
y requests across services. distributed tracing.
Ability of different services to
Interoperabi Standardized APIs, data
work together, potentially
lity formats (e.g., JSON, XML).
across platforms.
Ease of adapting to changes
Use of containers,
Flexibility in requirements or
microservice independence.
technologies.
CI/CD pipelines, automated
Deployabilit Ease and speed of deploying
deployments, blue-green
y new versions of services.
deployments.
Property Description
Every read receives the most recent write or an error. All
C - Consistency
nodes see the same data at the same time.
Every request (read or write) receives a response, without
A - Availability
guarantee that it contains the most recent data.
P - Partition The system continues to operate despite network
Tolerance partitions or communication failures between nodes.
Trade-offs: According to the CAP theorem, you can only achieve two out
of the three properties at any given time. This leads to trade-offs in
system design.
Design Implications:
CP Systems: Prioritize Consistency and Partition Tolerance (e.g.,
HBase, MongoDB in certain configurations).
AP Systems: Prioritize Availability and Partition Tolerance (e.g.,
Cassandra, DynamoDB).
Real-World Applications: Understanding the CAP theorem helps
architects choose the right database and design patterns based on
application requirements, such as financial systems (favoring consistency)
versus social media platforms (favoring availability).
Deployment Strategies
Circuit Breaker:
When a microservice depends on an external API that might be
experiencing downtime, the Circuit Breaker can be used to stop sending
requests to that API and provide a fallback response
The Circuit Breaker pattern prevents a service from repeatedly
trying to execute an operation that's likely to fail, thereby avoiding
resource exhaustion and allowing the system to recover.
Closed, OPen, Half-Open : State
Fault Tolerance:
Fault Tolerance refers to the ability of a system to continue functioning
correctly even in the presence of failures.
Redundancy: Duplication of critical components or services to
ensure availability.
Graceful Degradation: The system continues to operate in a
reduced capacity rather than failing completely.
Fallback Mechanisms: Providing alternative responses when a
service fails (e.g., serving cached data).
Architecture Descripti Key Use
Pattern on Cases
A single unified unit where all Simple applications,
Monolithic
components are interconnected startups, and small
Architecture
and interdependent. teams.
Large applications,
Decomposes applications into
Microservices continuous
small, loosely coupled services
Architecture deployment,
that communicate over APIs.
scalability.
Uses events to trigger and
Real-time applications,
Event-Driven communicate between
complex workflows, and
Architecture decoupled services or
asynchronous systems.
components.
Organizes the system into layers,
Enterprise applications,
Layered each with a specific role (e.g.,
where separation of
Architecture presentation, business logic, data
concerns is crucial.
access).
Separates the client and server Web applications,
Client-Server
roles, allowing for distributed database systems, and
Architecture
processing and resource sharing. network services.
Service-
Builds applications as a Enterprise integrations
Oriented
collection of services that and complex business
Architecture
communicate over a network. processes.
(SOA)
Allows developers to build and run Event-driven
Serverless
applications without managing applications, APIs, and
Architecture
servers, using cloud services. microservices.
Domain- Focuses on modeling software Complex business
Driven based on the business domain applications with rich
Design (DDD) and its logic. domain models.
Distributes processing and High-traffic
Space-Based
storage across multiple nodes to applications and large-
Architecture
handle load and scale. scale systems.
Broker Mediates communication between Messaging systems,
Architectur components through a broker, integration platforms,
e enabling loose coupling. and distributed systems.
Structures the system as a
Data processing
Pipeline series of processing steps or
applications, ETL systems,
Architecture stages, often for data
and batch processing.
processing.
Hexagonal Emphasizes the separation of
Testable applications
Architecture the core logic from external
and those needing
(Ports and agents through ports and
flexible interfaces.
Adapters) adapters.
Java 21 Features :: 15 JEPs (JDK Enhancement Proposals)
Aspect Example:
Spring Boot Document:
springdoc.show-actuator=true
springdoc.use-management-port=true
management.endpoints.web.exposure.include=openapi, swagger-ui
implementation 'io.micrometer:micrometer-core'
implementation 'io.micrometer:micrometer-registry-prometheus'
APIGEE / Kong
Istio/Kiolo Linked