
Senior Lead Software Engineer with over 9 years of experience in spearheading successful software development projects, leading a team of 20+ developers, and driving the migration of legacy applications to modern platforms. Adept at implementing CI/CD practices and leveraging cloud infrastructure for seamless
application deployment. Skilled in Java, Springboot, and Microservices development, with a strong focus on optimizing application performance and enhancing code maintainability. Proven track record in fostering strong communication and collaboration within cross-functional teams. Known for innovative problem-solving and a proactive approach to system integration, resulting in effcient and reliable web applications.
Senior Lead Software Engineer
Virtusa Consulting ServicesLead Software Engineer
Virtusa Consulting ServicesAssociate Consultant - Java Developer
Virtusa Consulting ServicesJR Software Developer
Tech MahindraJr. Software Engineer - Java Developer
Tech Mahindra
Servlets

JSP

JDBC

Eclipse IDE

ANT

Maven

SVN

Postman

Confluence
.png)
Docker

Kafka
.png)
Jenkins
Jira
Hi, my name is Gita and I'm based out of Pune. I completed my bachelor's degree in computer science and graduated in 2015. Since then, I've been working, which gives me approximately 9 years of work experience in the IT field. Throughout my career, I've worked in the telecom domain, and one of my clients was British Telecom.
What strategy would you utilize to implement microservices? Circuit breaker for a fault tolerance. What strategy would you utilize in Java to implement a microservices circuit breaker for fault tolerance? Circuit breaker design pattern is something that prevents cascading failures. If there is some failure in your application and it has some cascading effects, implementing the circuit breaker design pattern in your application will prevent the cascading effects. Now, what strategy will I utilize in Java? We do have some dedicated libraries that provide the core functionality, such as Hystrix. It does provide the circuit breaker functionality. So, that can be used in my application. Apart from that, Hystrix allows you to monitor the health check of the application, the server health, and some fallbacks if you have them. You can trigger those using some trigger mechanisms. You can automatically transition between states, like closed or open, to manage the recovery of the application. Mainly, monitoring failures and applying a fallback mechanism is something we can apply. One more thing we can consider while implementing a circuit breaker in Java is the configuration. We will have to set up some appropriate configurations, like failure thresholds or retry attempts, because the retry mechanism is something we can try in case of failures. And, of course, the timeouts, if you have a designated timeout and within that time, if you're not getting a response, that's how you know something is not right. We can use resiliency libraries, such as Hystrix and Resilience 4J. Resilience 4J, unlike Log 4J, will help you have a complete log of what all has gone wrong, so that's going to help you in monitoring the failures while implementing your circuit breaker patterns. Monitoring and logging will be a must here, because you will have to understand what has gone wrong.
Can you describe how to apply solid principle in Java based microservices application what is it? Can you describe how to apply solid principles in a Java based microservices application to improve maintainability? Solid principles basically improve the maintainability. SOLID stands for different things. S meaning single responsibility, your class should have single responsibility or not multiple functionalities or responsibilities in it. Always open to extension but close to modification of the functionality. L means Liskov substitution principle, where subclasses can be used wherever the base class is expected without some unexpected behavior. I is interface segregation principle. Here, that means we can split larger interfaces into smaller, more specific interfaces to avoid all your classes need not implement all the interface methods. So if it is split up, whatever is required only, that will be implemented. And next is D, dependency inversion principle. Here, the high level modules should depend on abstraction and not concrete implementation. Meaning dependency injection, we can use here during run time so that you can just pass on the objects and reuse the code. Now to improve the maintainability of this microservices application, what we can do is we can apply all of these principles in the microservice which focuses on a single responsibility class. So if you are in your application, if you're having a class, it should just have one responsibility. Then it should utilize the interfaces very effectively. And wherever required, we can implement this interface segregation principle where if your interface is having a lot of methods, but then if you are splitting it up, well, different interfaces for interaction is going to help. And other than that, open close principle which we spoke about, where modification is not allowed, but the extension of the functionality is still on. And inheritance should be applied very appropriately to adhere to the solid principle. And how can I implement this? Obviously there should be loose coupling between the modules, then there should be a proper testing strategy to make sure that all of these things are heard. And monitoring or maintaining logs of this does come as a must in any application.
Python based AI models are often referred to as a type of Machine Learning (ML) or Artificial Intelligence (AI) model that is implemented using the Python programming language. Here are the steps to integrate Python based AI models into an existing Java microservices architecture: 1. Create a Python service that exposes REST APIs or uses a messaging mechanism like Kafka to communicate with the Java application. 2. Design the REST API or messaging mechanism to allow the Java application to interact with the Python AI model. 3. Implement the Python AI model using a library such as scikit-learn, TensorFlow, or PyTorch. 4. Deploy the Python AI model as a microservice using a containerization platform like Docker. 5. Use a container orchestration tool like Kubernetes to manage the deployment and scaling of the Python AI model. 6. Integrate the Python AI model with the existing Java microservices architecture using REST APIs or messaging mechanisms like Kafka. 7. Test the integration to ensure that the Python AI model is working correctly with the Java application. Some common tools and technologies used for integrating Python based AI models with Java microservices architecture include: - REST APIs: to expose the Python AI model as a service to the Java application. - Kafka: a messaging mechanism for asynchronous communication between the Java application and the Python AI model. - Docker: a containerization platform for deploying the Python AI model. - Kubernetes: a container orchestration tool for managing the deployment and scaling of the Python AI model. Here is the corrected transcript: To integrate Python based AI models into an existing Java microservices architecture, one way is to create a Python service that exposes REST APIs or uses a messaging mechanism like Kafka to communicate with the Java application. We can create a Python microservice that exposes REST endpoints to the Java application. The Java application can then communicate with the Python AI model via these REST APIs. Apart from that, some messaging mechanisms also can be used. Since this is a microservices architecture, we have messaging tools like JMS and all. But in between these two, we can use Kafka. Kafka can be used for asynchronous communication. The Python model can send messages to a Kafka topic, and the Java application can subscribe to those topics and consume those messages. For deploying these applications, we can make use of Kubernetes for scalability and orchestration, or we can use Docker. Like for a simpler version, Docker can be used for the deployment. And packaging all of this together, again, Docker can be used. So basically, you'll be implementing REST APIs or message broker, something is which we'll use to communicate. Then for deployment, you can use Kubernetes or Docker for the setup. And for packaging also, Docker can be used.
Zero downtime deployments in microservices using Spring Boot. Microservices individually will be deployed with zero downtime. So, Docker and Kubernetes will create a Docker image. We can make use of Kubernetes to ensure a zero downtime deployment, some rolling update kind of strategy. I'm not aware of the infrastructure part, but I have come across a few things in my previous project. A rolling update strategy with Kubernetes can help us achieve this, which is a zero downtime deployment, where new versions of microservices are gradually rolled out to replace the existing ones. In this way, there's no downtime required, and it's gradually going to update a newer version. So, you need not have a downtime, and your application will not go down for a new deployment or for a new version to be deployed. And, obviously, maintaining a production environment or any environment, you will have managed servers. This rolling update can be done on managed servers in parallel, and the URL will be redirected to the servers. So, the checks and everything can help us achieve this. Docker, when we use it, creates images of the application. This also helps us in not having a separate deployment altogether. Load balancing is something I've already mentioned. Kubernetes, if you're using it for deployment, it will help manage the life cycles of your microservices, including the rolling update.
What Python tools and frameworks would you employ for monitoring, logging, the health of microservices? Python. What Python tools and frameworks would you employ for monitoring and logging the health of microservices? Oh, no. I am not aware of this, but I've heard of few tools. I think, Grafana and Flask being one of them. Those tools or frameworks you can, use here. What the Java tools and frameworks? What do you employ for monitoring? Because in, Java applications, We do have, different frameworks. Like, obviously, you have your spring boot and then that you have different mechanisms to maintain the logging and monitoring. But in Python, I have not, developed much in Python. So I, don't know in-depth answer for this. But there are few tools which I have read about I mean, I have I know about, Flask being one of them. Then Flask being one of them. Prometheus or something, is there. I don't clearly remember. But, yeah, maybe that's it from my end for this, question.
Public static gets okay. Private static. Fine. Public static service getting service instance. Service instance is null, then you are creating a new service. But, yes, there's a problem. Right? Public static service to instance. So what okay. So I will just attempt to answer this question. So here, we are trying to, lazily initialize an instance of the service. So we are trying this is mostly a code of a singleton design pattern. so where, we are ensuring that for a class, only a single instance is, created. And, in this code, this is going to work, but not in a multithreaded environment. So in a multithreaded environment, if multiple threads are accessing this class and trying to do this, there is a possibility that multiple instances will be created, which is going to, break the purpose of your singleton, design pattern itself. So in this case, there's one thing, which is wrong. We could have had a synchronized block here. Like, the instance which we are checking, if you would have had an additional synchronized block where the same thing we'll be checking. Like, if your service instance is null, then create a new instance, but that should be in a synchronized, static block. So then that is going to prevent, any issue in case of your multiple threads. So if multiple threads are involved, then you need to have a method which is synchronized and which is checking this. So that is going to prevent the multithreading issues which we might get in the get service instance method. So, yeah, that's it for this code. So, basically, the answer for this is, the method is not synchronized, so you could have had a synchronized block, which is going to, handle the multithreading issue.
Given the Java snippet below, can you identify the problem with singleton design pattern implemented here and suggest how it could lead issues to a multi data environment? Similar. Okay? Private static singleton instance for the okay. Okay. Okay. So, this is a valid code for a singleton design pattern. Like, in a normal environment where you do not have multi threading or multiple threads accessing this class at once. So this might work for the application where, you know, you do not have a multithreading kind of thing coming into picture. But then if it is a multithreaded environment and if multiple threads are trying to access this, or trying to achieve the singleton design pattern, like, you know, only one instance to be created at once, this code is going to fail. So to overcome that, this is going to lead issues because since this is a public method, obviously, we have a private constructor. We have all the prerequisites which is required for a singleton design pattern to be achieved. But then in case of multithreaded environment, multiple threads can access the static method of the get instance, and there is a possibility that this singleton design pattern will break because multiple threads at once is going to access this method, and there is a chance of creation of multiple instances. So in this case, can you identify the problem? The problem here is there's no synchronized block. So if I have one synchronized block here where I'm again checking the same thing that if the instance is not null, then only create a new instance. So the synchronized block is going to help me here to avoid issues in a multithreaded environment. So there should be a synchronized block here, which is again going to check the instance if it is null or not, and then only it will go to this get instance method and create a new instance. So, yeah, basically, it should have a synchronized block.
Device or method to ensure consistent data across multiple microservices handling persistent data. So if you have multiple microservices handling persistent data, what comes to mind is how to ensure consistent data. I think saga design pattern can be used here because saga is something where for example, if I take any app, like Zomato for that matter. So in Zomato, you have different services. Like, I can just for example, consider that placing an order, sorry. Viewing the menu, selecting the food, it will go and sit in a cart. So that's one thing. After it's sitting in the cart, I'm going to click on place order. And once I click on place order, it will take me to the payments page. And once I do the payment, that's when the order will be completed, and that's when I'll be notified that, okay, your order is completed. Your food will be arriving shortly, etcetera. So saga design pattern what it does is, it ensures that it helps you keep your data consistent because step 1, step 2, step 3, step 4. If all the steps are achieved one by one, then only it will get committed. If it's failing on step 3, it has to roll back from step 3 back to step 1. So, in this scenario, the data is kept consistent. So it works like breaking down a very big microservice into smaller services, and it handles its own transactions. Placing food item in the cart is one service which is doing it, and it's updating the database. Apart from that, then after the cart, I'm placing the order, that's one service. So all these operations the database is getting updated any which way. But in saga design pattern, when we're making use of saga design pattern, it ensures that the data is consistent. Because if it's failing at any one point, from that point onwards, it has to have a rollback strategy. So the data is not going to be inconsistent in this case. And to ensure consistent data again across this thing, obviously, you can have communication mechanisms also using some messaging. Obviously, your microservices are going to communicate with each other using some other mechanisms. So that's one thing. But then to ensure that data is consistent, saga design pattern fits the bill. It will take care of the data consistency across your microservices is what I can think of. And there's one more, you can have distributed transactions, which is also going to ensure your data consistency. Then there's another thing, event-driven approach is also something which can achieve it. But yeah, I will stick to saga and distributed transactions pattern to answer this question. So that's it from mine. Thank you.