Cloud Fundamentals - Senior Java Developer Interview Guide

Cloud Service Models & Deployment Models

1. Cloud Service Models (IaaS, PaaS, SaaS)

Model Definition You Manage Provider Manages Examples Short Interview Answer
IaaS
(Infrastructure as a Service)
Provides virtualized infrastructure resources. OS, Runtime, Application, Data Servers, Storage, Network, Virtualization AWS EC2
Azure VM
Google Compute Engine
"IaaS provides virtual machines and infrastructure where users manage the OS and applications."
PaaS
(Platform as a Service)
Provides platform for developing and deploying applications. Application, Data Infrastructure, OS, Runtime, Scaling Azure App Service
AWS Elastic Beanstalk
OpenShift
"PaaS allows developers to deploy applications without managing servers or operating systems."
SaaS
(Software as a Service)
Ready-to-use software delivered over the internet. Only Usage Everything Gmail
Salesforce
Microsoft 365
"SaaS provides fully managed software that users access through a browser."

2. Cloud Deployment Models (Public, Private, Hybrid)

Model Definition Characteristics Examples Short Interview Answer
Public Cloud Cloud infrastructure shared among multiple organizations. Pay-as-you-go
Highly scalable
Internet accessible
AWS
Azure
GCP
"Public cloud provides shared infrastructure managed by a cloud provider and is ideal for scalable applications."
Private Cloud Cloud environment dedicated to a single organization. High security
Full control
Higher cost
On-Prem Data Center
Internal OpenShift Cluster
"Private cloud offers dedicated infrastructure with greater security and compliance control."
Hybrid Cloud Combination of Public and Private Cloud. Flexibility
Cost optimization
Better disaster recovery
On-Prem Database + Azure AKS
Private DC + AWS Services
"Hybrid cloud combines private and public cloud environments to leverage the benefits of both."

Quick Interview One-Liners:

1. Cloud Service Models

IaaS (Infrastructure as a Service)

You Manage:

Cloud Provider Manages:

Examples

Java Example

java -jar app.jar

You manually install Java, configure server, deploy application and maintain OS.


PaaS (Platform as a Service)

You Manage:

Provider Manages:

Examples

Java Example

Deploy Spring Boot application and platform handles:


SaaS (Software as a Service)

You simply consume software.

Examples

No server, deployment, infrastructure, or maintenance responsibility.

2. Public vs Private vs Hybrid Cloud

Feature Public Cloud Private Cloud Hybrid Cloud
Ownership Cloud Provider Single Organization Both
Cost Lower Higher Medium
Scalability High Limited High
Security Shared Responsibility Full Control Balanced

Examples

3. Regions and Availability Zones

Region

A geographical area containing multiple data centers.

Examples:

Availability Zone (AZ)

Independent data centers within a region.

Example:
Region: AWS Mumbai

AZs:
ap-south-1a
ap-south-1b
ap-south-1c

Benefits

If one AZ fails, traffic is routed to another AZ automatically.

4. Scalability

Vertical Scaling (Scale Up)

Example:
4 GB RAM VM ? 16 GB RAM VM

Limitation: Hardware limits.


Horizontal Scaling (Scale Out)

Example:
1 Pod ? 10 Pods

Why Microservices Prefer Horizontal Scaling?

5. Elasticity

Automatically scale resources based on demand.

Example:
Normal Traffic = 2 Pods
Peak Traffic = 10 Pods
Night Time = 2 Pods

Kubernetes

Elasticity = Cost Optimization + Performance Optimization

6. High Availability (HA)

System remains operational even if some components fail.

Achieved Through

Java Example

User Service

Replica-1
Replica-2
Replica-3

If Replica-1 crashes,
Replica-2 and Replica-3 continue serving requests.

7. Fault Tolerance

Ability to continue functioning despite failures.

Common Techniques

Example

Payment Service Down

Retry 3 Times
?
Fallback Response
?
Log Failure
?
Alert Support Team

8. Multi-Tenancy

One application serving multiple customers (tenants).

Approaches

Approach Isolation Cost
Shared DB, Shared Schema Low Low
Shared DB, Separate Schema Medium Medium
Separate DB per Tenant High High

Java Implementation

Senior-Level One-Liners

TermDefinition
ElasticityAutomatic scaling based on demand.
ScalabilityAbility to increase capacity.
High AvailabilityMaximum uptime with minimal downtime.
Fault ToleranceAbility to survive failures.
RegionGeographical cloud location.
AZIndependent data center inside a region.
Multi-TenancySingle application serving multiple customers.

Senior Interview Questions & Answers

Q1. Why is horizontal scaling preferred over vertical scaling in microservices?

Answer:

Horizontal scaling provides better fault tolerance, load distribution, high availability, and supports cloud-native architectures. Vertical scaling is limited by hardware capacity.


Q2. Difference between Scalability and Elasticity?

Answer:


Q3. How do Availability Zones improve availability?

Answer:

Applications deployed across multiple AZs remain available even if one data center fails. Traffic automatically shifts to healthy AZs.


Q4. How does cloud help achieve fault tolerance?

Answer:


Q5. What is Multi-Tenancy?

Answer:

A software architecture where a single application instance serves multiple customers while keeping tenant data isolated.


Q6. What is the Shared Responsibility Model?

Answer:

Cloud provider secures infrastructure, while customers secure applications, data, access controls, and configurations.


Q7. What is the difference between High Availability and Fault Tolerance?

Answer:

High Availability Fault Tolerance
Minimizes downtime Continues operating despite failure
Recovery after failure No interruption during failure

Q8. What is Auto Scaling?

Answer:

Auto Scaling automatically adds or removes resources based on CPU, memory, request count, or custom metrics.


Q9. How does Kubernetes support Elasticity?

Answer:


Q10. Explain a cloud architecture you worked on.

Sample Answer:

We deployed Spring Boot microservices on AKS/OpenShift, used Azure Load Balancer, Azure SQL/PostgreSQL, Redis caching, Kafka messaging, Prometheus/Grafana monitoring, and configured HPA for automatic scaling. Applications were deployed across multiple availability zones to achieve high availability and fault tolerance.

Interview Summary