A passionate developer with 4+ years of experience who is always learning new technologies and honing his craft.
My experience includes working with Java, Python, Golang, PHP, AWS, Docker, Git, MySQL and other backend-related technologies. I have good experience with debugging and bug-fixing. I am a quick learner who enjoys solving problems
Lead Software Engineer
Prudent Insurance BrokersSoftware Engineer
SHLAssociate Software Engineer
SHLCommunication and Media Solutions Intern
Hewlett Packard EnterprisesPHP
Java
Spring Boot
Spring Data JPA
Git
AWS (Amazon Web Services)
VS Code
GitHub
AWS
Docker
MySQL
AWS CloudWatch
AWS ECR
IntelliJ
Redis
Aerospike
Elasticsearch
So, hi, I'm Pratik Agrawal. I am a back end engineer at SHL India, a b to b software based company. And, uh, I have around, uh, 3 years of experience here. I have worked majorly in the back end side, uh, of, uh, of our tech, and, uh, I have worked on majorly, um, Java Java Spring Boot. Uh, and I have used PHP for scripting as well. And, uh, also been working recently with the Golang. So I have, Yeah. So apart from this, I have also experience with, um, taking doc session on Docker. That's all about me.
Segment that aims to capture some results for efficiency identified potential for associated with multiple cache, complete data, fetch data. If cache may contain, getting at it will return the data. Else, load input result. So the issue which will come here Suppose we have 2 threats and, uh, they both come here simultaneously, so what what will happen is, Uh, and suppose the data is not loaded. Okay. So, uh, for 1 thread also, Uh, for both the threads, it will check that it contains key k, but it will not contain. So, uh, it will go and load, data and put cache for both of them. So, uh, ideally, it should there have there should have been a locking kind of a thing. Reason being, uh, if at all they would have been lockings, and then both the threads would not have, Uh, put the data in the cache map. Yeah. That's
Implement dependency inversion in a new starting. So for dependency inversion, um, we can use, uh, 2 things. Uh, we have 2 options. Uh, I can recall. So the first one is using auto wired annotation. So the auto wired annotation will inject the dependency um, of, uh, of whatever class which is needed, so it that. And the second1 is constructor injection. So we can use either one of them um, to achieve the dependency inversion principle.
System to handle 1,000,000 requests. How would you handle a system design a system? Millions of per meter. So I will follow the best practices, like loose coupling, um, and, Design patterns design patterns. So there is no tight coupling among any of the, uh, services which we are using? And we I'll follow the model view controller, uh, kind of a design pattern. So model for interacting with the databases, views, uh, and controllers controllers. Yes. So, Control us for the request will land in there, and then we will pass the request to the service for handling the business logic.
The versioning of the Rest API. Handle versioning of REST API. So for versioning, I will take the help of the application properties. Versioning of a REST API. No. I don't know. I'm sorry.
This is trying to ensure clean, maintainable code. So for clean, maintainable code, uh, we should, uh, first of all, give control to spring boot spring, uh, to create, uh, to create beans. So we should use, uh, at the rate, rest controller or controller for, uh, for the controllers. And then we, uh, we should redirect it to the services, which will again have address service annotation, which gives features, uh, so which will give and, sorry, and, uh, one more thing, then it will redirect you to to the JPA, uh, if at all we have to, uh, have any query interactions with the, uh, with our system, with the database. So we will use JPS. So these 3 things these 3, uh, will have internally a direct component annotation, which instructs the spring application to, uh, create the bin, and then it will automatically manage it via the application context. So one of them is this. So we should follow the designs. The second 1 is, uh, we can, uh, you we should use, uh, the dependency injection principle, uh, for handling for handling everything, uh, for handling the dependencies which we need to inject. And, uh, yes. Yeah. Best.
Pseudo code for the restful API endpoint to determine what could be improved from a security guide, best practices, and the point standpoint. About what do you suggest to adhere to? I think we should not, uh, return a user entity here. We should instead create A DAO for it and use a response entity to return it. So response entity will also give Status codes apart from the entity itself, we should first use the response entity. Second thing, we should use, Uh, we should use a risk first 1 is a response entity. We should use second 1 is We should use, uh, DAOs. We should create a different DTOs for it. So and then, uh, we should call the build builder, uh, functions to map it. Yeah. That too, determine what could be improved from a security. We should also, Uh, for security point of view, we can give authorizations here. So, uh, so we can restrict The get user function, uh, we can restrict to who all can call the get user function. So we can also do that for the best practices.
Management in a complex application. I'm sorry. I don't know this.
So to convert, monolithic spring boot application to, um, into a set of microservices, I will, um, break our application uh, into multiple sections so that it can be, uh, so that all other all the service all the microservices in itself are uh, different modules, and we can and can be used entirely, uh, and can be used entirely in a single way. Uh, so for example, if I take uh, example for example, if I take ecommerce application, so I will suppose it was initially written as a monolithic, I will break it into different modules like product, uh, surfing, then the, uh, order the order module, and then, uh, uh, uh, the card module, the payment module, so and, also, we can have the notification module as well. Uh, yeah, so the notification module will be written in such a way that, uh, we can uh, that, uh, the if, uh, that after the payment is done, we will get the notification first. Uh, secondly, uh, if at all for the tracking purpose also, uh, if at all the order is shipped, we can give a email, uh, uh, to the customer, uh, giving a better user experience, uh, for them. So, yeah, that can also be done. Uh, so in such cases, in different ways like this, uh, we can divide our application into bits and pieces, uh, and then we will integrate
You're building a script tool that needs to regularly update in your client's browser. How would you do? So I will use lazy loading for it, uh, and that will help Us. Yes. I will I will keep, uh, regularly updates in the client browser. I will put the, uh, data itself, uh, in my memory initially only at the time of loading, so it will not take much time for data retrieval. Yes.