Part 3: Microservices Interview Questions And Answers

Himaanshu Shukla
4 min readJun 12, 2022

--

What is the difference between Mock and Stub?
A Mock is generally a dummy object where certain features are set into it initially. Its behavior mainly depends on these features, which are then tested.
A Stub is an object that helps in running the test. It functions in a fixed manner under certain conditions. This hard-coded behavior helps the stub to run the test.

What is a CDC?
CDC(Consumer-Driven Contract) are patterns for evolving services. Here, each consumer captures their provider in a separate contract. All these contracts are then shared with the provider, which helps them to gain an insight into the obligations they must fulfill for each individual client.

How can we perform Cross-Functional testing?
Cross-functional testing is the verification of non-functional requirements, i.e. those requirements which cannot be implemented like a normal feature.

What are non-deterministic tests, and how will you eliminate them?
NDT or Non-Deterministic are unreliable tests. Such tests sometimes pass and sometimes fail. When these tests fail, they are re-run.

Non-Determinism from tests can be eliminated by: Quarantine, Asynchronous, Remote Services, Isolation, Time, and Resource Leaks.

What are Reactive Extensions in Microservices?
Reactive Extensions is a design approach through which results are collected by calling multiple services in order to compile a combined response. Also known as Rx, these calls can be synchronous or asynchronous.

What is Spring Batch Framework?
Spring Batch is an open-source framework for batch processing and execution of a series of jobs. Spring Batch provides classes and APIs to read/write resources, transaction management, job processing statistics, job restart, and partitioning techniques to process high-volume data.

What is Tasklet, and what is a Chunk?
The Tasklet is a simple interface with one method to execute. A tasklet can be used to perform single tasks like running queries, deleting files, etc. In Spring Batch, the tasklet is an interface that can be used to perform unique tasks like cleaning or setting up resources before or after any step execution.

Spring Batch uses a ‘Chunk Oriented’ processing style within its most common implementation. Chunk Oriented Processing refers to reading the data one at a time and creating chunks that will be written out, within a transaction boundary.

What is Semantic Monitoring?
Semantic Monitoring or Synthetic Monitoring is running a subset of the application’s automated tests against the live production system. These results are monitored, and alerts are generated in case of failures.

Semantic Monitoring approaches microservice monitoring from the business transaction perspective. Instead of monitoring each component, its semantic monitoring ascertains how well the transaction performs for the business and the users. It also detects the faulty service layer and the corresponding microservice instance, all at the same flow. This approach allows for faster triaging and reduces the meantime to repair.

How do you perform security testing of Microservices?
Microservices Application is a collection of smaller, independent, functional modules that may be developed in different programming languages, have different data sources, and run on different operating systems. This makes testing the microservices as a whole a very tough task.

The different pieces/modules need to be tested independently. There are three common procedures for this.

  • Code Scanning: In order to ensure that every line of code is bug-free and can be replicated.
  • Flexibility: The security protocols should be flexible as per the requirements of the system.
  • Adaptability: The security protocols should be adaptable to malicious intrusions.

What do you understand by Idempotence, and how is it used?
Idempotence refers to the repeated performing of a task even though the end result remains the same. It is used mostly as a data source or a remote service in a way that when it receives the instruction more than once, it processes the instruction only once.

What are Reactive Extensions in Microservices?
Reactive Extensions also are known as Rx. It is a design approach in which we collect results by calling multiple services and then compile a combined response. These calls can be synchronous or asynchronous, blocking or non-blocking. Rx is a very popular tool in distributed systems that works opposite to legacy flows.

Microservices Interview Questions And Answers

Did you know you could give up to 50 claps?
Yes, 50 claps, isn’t it awesome. If you feel my posts are interesting or helpful to you, please do press the 👏 clap button and share/ follow, and help others find this story too. Also, feel free to leave a comment below.

If you enjoyed reading my blogs, I’d appreciate it if you’d buy me a coffee

Keep learning and growing!
- Himanshu Shukla..

--

--

Himaanshu Shukla

Software Engineer | Certified Scrum Master | Angel Therapy Practitioner| Light Worker| Empath | Buy me a coffee https://ko-fi.com/greekykhs |Blogger