Monolith vs Microservices Interview Questions Hindi mein

Monolith vs Microservices कोर्स के 25 सवाल, हर सवाल के सही जवाब और explanation के साथ। जवाब देखने से पहले ख़ुद सोचें।

Two Ways to Build a System

1. Which is a genuine advantage of a monolith?

  1. Operations across features can share one ACID transaction
  2. Each feature can be deployed independently
  3. Failures are always isolated per feature
  4. Each team can choose its own database
जवाब देखें

जवाब: Operations across features can share one ACID transaction

In-process calls and one database make transactions simple; independent deployment is a microservices trait.

पाठ: What a Monolith Really Is

2. Which property best defines a microservice?

  1. It has fewer than 1,000 lines of code
  2. It must be written in a different language from other services
  3. It always uses Kubernetes
  4. It can be deployed independently and owns its data and capability
जवाब देखें

जवाब: It can be deployed independently and owns its data and capability

Independent deployability with clear ownership is the core property; size and tooling are secondary.

पाठ: What Microservices Are

3. What does Conway's law state?

  1. Systems double in complexity every year
  2. Every service needs its own database
  3. System designs tend to mirror the communication structure of the organisation that builds them
  4. Monoliths cannot scale
जवाब देखें

जवाब: System designs tend to mirror the communication structure of the organisation that builds them

Conway observed that organisations produce designs that copy their communication structures.

पाठ: The Architecture Spectrum and Conway's Law

Trade-offs and Choosing

4. Which benefit of microservices depends most on having many teams?

  1. Faster in-process calls
  2. Simpler transactions
  3. Team autonomy and independent release schedules
  4. Fewer network calls
जवाब देखें

जवाब: Team autonomy and independent release schedules

Autonomy matters when coordination across many teams slows delivery.

पाठ: What Microservices Give You

5. Which is one of the fallacies of distributed computing?

  1. Databases are always relational
  2. The network is reliable
  3. Monoliths cannot use caching
  4. Containers are secure by default
जवाब देखें

जवाब: The network is reliable

"The network is reliable" is the first of the classic fallacies.

पाठ: The Distributed Systems Tax

6. A five-person start-up is still discovering its product. What is usually the best starting architecture?

  1. A well-modularised monolith
  2. Thirty microservices on Kubernetes
  3. A separate service per database table
  4. Serverless functions for every endpoint
जवाब देखें

जवाब: A well-modularised monolith

Small teams with evolving domains benefit from the simplicity and flexibility of a modular monolith.

पाठ: Choosing an Architecture

The Modular Monolith

7. What makes a modular monolith different from a big ball of mud?

  1. Modules have explicit public APIs and enforced dependency rules
  2. It is deployed as several services
  3. It uses a NoSQL database
  4. It has no database
जवाब देखें

जवाब: Modules have explicit public APIs and enforced dependency rules

Enforced module boundaries are the defining property; deployment is still a single unit.

पाठ: Modules With Real Boundaries

8. What is a bounded context?

  1. A database table
  2. A Kubernetes namespace
  3. A type of API gateway
  4. A boundary within which one domain model and its language stay consistent
जवाब देखें

जवाब: A boundary within which one domain model and its language stay consistent

Bounded contexts define where a particular model applies, which makes them natural module or service boundaries.

पाठ: Bounded Contexts and Domain-Driven Design

9. Why avoid foreign keys between tables of different modules?

  1. Foreign keys are slow in all databases
  2. They are not allowed in PostgreSQL
  3. They couple modules at the data level and make a later split into services very hard
  4. They prevent backups
जवाब देखें

जवाब: They couple modules at the data level and make a later split into services very hard

Cross-module constraints tie data together, blocking independent evolution of modules.

पाठ: Data Ownership Inside a Monolith

Designing Services

10. Which is a warning sign of poorly drawn service boundaries?

  1. Each service owns a business capability
  2. Services expose small, stable APIs
  3. Most features require coordinated changes in several services
  4. Teams can deploy alone
जवाब देखें

जवाब: Most features require coordinated changes in several services

Frequent multi-service changes show that cohesive logic was split across boundaries.

पाठ: Finding Service Boundaries

11. Why is a shared database between services considered an anti-pattern?

  1. Databases cannot handle multiple connections
  2. Schema changes and deployments become coupled across services, defeating independence
  3. It is always slower than API calls
  4. It prevents backups
जवाब देखें

जवाब: Schema changes and deployments become coupled across services, defeating independence

Shared tables force teams to coordinate changes, recreating monolith coupling over a network.

पाठ: Database per Service and Querying Across Services

12. Which change to a public API response is usually backward compatible?

  1. Adding a new optional field
  2. Renaming a required field
  3. Removing a field clients use
  4. Changing a field from integer to string
जवाब देखें

जवाब: Adding a new optional field

Adding optional fields lets old clients ignore them while new clients use them.

पाठ: Communication: Sync, Async and Contracts

Infrastructure for Many Services

13. What is the purpose of the Backend for Frontend pattern?

  1. Giving each client type its own thin backend that shapes data for that client
  2. Replacing all services with one backend
  3. Storing frontend assets in the database
  4. Running the frontend on the server
जवाब देखें

जवाब: Giving each client type its own thin backend that shapes data for that client

BFFs tailor APIs to specific clients without overloading a shared gateway.

पाठ: API Gateways and Backends for Frontends

14. What does a service mesh typically provide without application code changes?

  1. Database schema migrations
  2. Frontend rendering
  3. Business validation rules
  4. Mutual TLS, retries, traffic splitting and telemetry between services
जवाब देखें

जवाब: Mutual TLS, retries, traffic splitting and telemetry between services

Meshes handle network-level concerns uniformly through proxies or the network layer.

पाठ: Service Discovery, Configuration and Service Mesh

15. Which practice undermines independent deployment?

  1. A pipeline per service
  2. Contract tests
  3. A shared domain-model library that every service must upgrade together
  4. Container images with health endpoints
जवाब देखें

जवाब: A shared domain-model library that every service must upgrade together

Shared domain libraries force coordinated releases across services.

पाठ: Independent Build and Deployment

Consistency, Resilience and Observability

16. What replaces a cross-service ACID transaction in most microservice systems?

  1. A shared database lock
  2. Two-phase commit across every service
  3. A saga of local transactions with compensating actions
  4. Running all services in one process
जवाब देखें

जवाब: A saga of local transactions with compensating actions

Sagas keep each step local and undo completed steps with compensations on failure.

पाठ: Consistency Without Distributed Transactions

17. A product page calls an optional recommendations service that is timing out. What is the best behaviour?

  1. Return HTTP 500 for the whole page
  2. Render the page without recommendations after a short timeout
  3. Wait indefinitely for recommendations
  4. Retry forever
जवाब देखें

जवाब: Render the page without recommendations after a short timeout

Optional dependencies should degrade gracefully so they cannot take down the main flow.

पाठ: Designing for Partial Failure

18. What lets you see the full path and timing of one request across many services?

  1. Distributed tracing with propagated trace context
  2. A bigger log file
  3. More CPU
  4. A shared database
जवाब देखें

जवाब: Distributed tracing with propagated trace context

Trace context propagated between services links spans into one end-to-end trace.

पाठ: Observability Across Services

Migrating Between Styles

19. What is the main idea of the strangler fig pattern?

  1. Gradually route individual capabilities from the old system to new components
  2. Rewrite the whole system and switch over in one weekend
  3. Delete the database first
  4. Freeze all feature work for a year
जवाब देखें

जवाब: Gradually route individual capabilities from the old system to new components

Incremental routing lets you replace the system piece by piece with reversible steps.

पाठ: The Strangler Fig Pattern

20. In a service extraction, when is the data usually moved?

  1. First, before any code changes
  2. Never; services always share the monolith database
  3. Only during a scheduled outage
  4. Late, after the new service has been proven with reads and writes behind a flag
जवाब देखें

जवाब: Late, after the new service has been proven with reads and writes behind a flag

Moving data is the riskiest step, so it comes after the service has been validated.

पाठ: Extracting a Service Safely

21. Which signal suggests two services might be better merged?

  1. They are owned by different teams with different release schedules
  2. They have different scaling needs
  3. They are almost always changed and deployed together and call each other constantly
  4. They use different databases suited to their data
जवाब देखें

जवाब: They are almost always changed and deployed together and call each other constantly

Lockstep changes and chattiness indicate the boundary between them is in the wrong place.

पाठ: When to Merge Services Back

Organisation, Pitfalls and Revision

22. In Team Topologies, what is the role of a platform team?

  1. Owning a customer-facing feature end to end
  2. Approving every deployment manually
  3. Providing self-service internal capabilities such as pipelines and infrastructure for other teams
  4. Writing all the business logic
जवाब देखें

जवाब: Providing self-service internal capabilities such as pipelines and infrastructure for other teams

Platform teams reduce the load on stream-aligned teams by offering infrastructure as a product.

पाठ: Teams and Ownership

23. Several services share database tables and must be released together. What is this anti-pattern called?

  1. Modular monolith
  2. Distributed monolith
  3. Strangler fig
  4. Backend for frontend
जवाब देखें

जवाब: Distributed monolith

A distributed monolith has the coupling of a monolith with the costs of a distributed system.

पाठ: Common Anti-Patterns

24. In the case study, why did the core order flow stay in the monolith?

  1. Because it changes as a unit and splitting it would add coordination and consistency costs without a clear benefit
  2. Because monoliths cannot be split
  3. Because Kubernetes was unavailable
  4. Because services cannot handle orders
जवाब देखें

जवाब: Because it changes as a unit and splitting it would add coordination and consistency costs without a clear benefit

Keeping tightly coupled logic together avoids distributed transactions and lockstep releases.

पाठ: Case Study: An E-Commerce Platform Over Five Years

25. A company has two engineers and an unproven product. An interviewer asks which architecture to start with. What is the strongest answer?

  1. Microservices from day one so it can scale later
  2. Serverless functions for every endpoint without exception
  3. A service per database table
  4. A modular monolith, extracting services later when specific pressures appear
जवाब देखें

जवाब: A modular monolith, extracting services later when specific pressures appear

A modular monolith keeps change cheap now while preserving clean seams for later extraction.

पाठ: Revision and Interview Questions

← कोर्स पर वापस जाएँ