[0:00]Hey guys, today we have Manjunath and he is having total two year of experience in Java, Spring Boot and micro services domain. And those who want to give same free mock interview, please fill out the form below in the description, so now let's get started. Hey, hello Manju, how are you? Yeah, I'm fine. How about you? Yes, I'm also good. Shall we start? Yeah, sure. Yeah. Manju, can you please introduce yourself and your recent project in brief? Yeah, first of all, thank you so much for giving this opportunity. So my name is Manjunath. So, I'm a Java back-end developer with two years of experience at Infosys. So and I did my graduation from Bangalore Institute of Technology from Bangalore. So and my technology stack like Java, Spring Boot, Micro Service, and my sequel. And my experience at Infosys was like, Digital Banking application, the project. So, and I building the rest APIs and writing the optimized queries.
[1:04]So what's your approach to optimize the queries? Yeah, so I first used the two approach, first using the indexing approach. Okay. And proper, like annotations to you on the repository layer. Okay. Okay. Yeah, so this is all about me myself. Yeah, yeah, okay. Thank you. So, yeah, moving ahead. Can you tell me the role of classes and objects in Spring Boot projects? Yeah, the classes and objects, which is the major role in that any Java applications projects. So the main thing is which is using that some entity or a DTO class layers. So another thing is like communicating between the classes. So that's the major importance. So it's a purely based on object-oriented.
[2:04]So, do you know about dependency injection Spring Boot? Yes. Please go ahead. Dependency injection is like a design pattern, which is creating the object based on the injecting the dependency without creating the manual creation. Okay. Okay. What are some common issues we anyone could encounter with dependency injection and how would you resolve them? Like that common common exception, right? Yeah, common issues that anyone could encounter.
[2:43]Yeah, sometimes issues we can get that like duplicate been exceptions like Okay. So another exception like, we may encounter like circular dependencies. Circular dependencies like and tracing the flow of dependencies, difficulties in tracing the flow of dependencies. Okay. Yes. Yeah, yeah. And solving these problems are typically involves careful design to minimize direct dependencies and use explicit configuration or annotation to manage these dependencies clearly. Yes. Okay. So, can we create a non-web application in Spring Boot? Non-web application.
[3:37]Yes, we can create. Okay. How?
[3:44]So, without adding some like web dependencies. Okay. Okay. So, yeah, that's true. We can create a non-web application in Spring Boot. Uh so there is a way I mean we should we could use command-line interface, we could implement the command-line interface if we want to if we want to create a non-web application. Yeah. Okay. Okay. So, uh can you tell me how do you configure Spring Boot project like what's the initially step? Spring Boot configuration like creating the project, right? Yeah, creating the project in the initial stage. Yeah, so, by we can using the two ways, by using the command-line interface and another thing is using that Spring initialization. So like and first Yeah. First, adding the dependencies. So required dependencies in the pom.xml, and second, we differentiate the layers between the like controller layer and persistence layer and service layer like that.
[5:01]So and according to the requirement, we creating that. Okay. Yeah, we can use Spring initializer and there are some other ways as well. That's correct. Yeah. So guys, Manju has our interview preparation kit and after completing that kit he is able to crack multiple interviews and have big offers in big MNCs. We have also referred him in few companies, so guys, basically this interview preparation kit has four parts. First is complete interview preparation material, second is two client enterprise projects with video recorded sessions, third is lifetime chat support, and fourth is referral support to the big MNCs like Infosys, TCS, HCL, etc. You can purchase either whole interview preparation kit or complete interview preparation material also. So basically it contains a lot of material categorized by experience level means each experience level has different material with all possible interview question answers for Java, Spring Framework, Maven, Git, Spring Security, Spring Data JPA, Kafka, Micro Services, Java coding questions, Spring web questions and many more. I have provided the link to get this in the below description as well as the interview preparation kits in the description. So guys, now moving to our interview. Before moving to our interview, Manju, can you please uh give your reviews about this interview preparation kit, whether this was helpful for you or not? Yeah, basically it's a so helpful for me. So, taking the multiple courses are like to searching the different platforms. So that is time consuming. Yeah, yeah, yeah. So it's a one-stop solution. For everything. So in your resource, like everything is in one resource, all in one. So that helps to, like getting the guidance like. Okay. Okay. Yeah, thank you. So now moving to our interview. So Manju, can you please uh mention few advantages of Spring Boot application? Yeah, the Spring Boot features like that auto-configuration, the first one. And another one is embedded server. It's a microservice support project. Yeah, and it reduces the boilerplate code. Okay. So these are the main features of the Spring Boot. Okay. So are there advantages or limitations of using Spring Boot that you have encountered? Like that common sorry.
[7:36]I'm saying is there any disadvantages of using Spring Boot that you have encountered?
[7:46]No. Okay. Yeah, actually there are no major disadvantages in Spring Boot application since it's a facelift of Spring Framework.
[7:58]But there is a term auto-configuration that's an advantage of Spring Boot, but sometimes that's also a disadvantage of Spring Boot leading to difficulty debugging or managing the complex auto-configuration structure dependencies on beans, right?
[8:15]Okay. We need to configure configuration. Yeah, yeah, yeah. So can you tell me what are some important annotations in Spring Boot? Yeah, first one there is a stereotype annotations like component, service, and repository. These are the main annotations like qualifier, primary. So after that in the we using a controller rest controller annotations. So and request mapping annotation. So at Aoid annotations, so these are the main annotations like qualifier, primary. Okay. So can you tell me some advanced annotations which you have used other than this common annotations?
[9:05]I used like profile and qualifier. Okay. And another thing is like logging logging annotations. Okay. And Lombok.
[9:24]Yeah. Okay. Can you tell me the difference between controller and rest controller annotation? Yeah, okay. So, controller is an annotation which is used at the controller layer, controller class. So, it returns in the it's an MVC architecture, which used in the mainly in the MVC architecture. And it returns in the like XML or JSON format. So this is the architecture, restful web service architecture.
[10:03]So when would you choose controller over rest controller annotation? Yeah, sometimes if you want that view page. Okay. Yeah, so raw data like something.
[10:19]Okay. So, tell me the differences between put, post, and patch. Yeah. Put is annotation which is used to like update the resource. It update the entire resource. When come to the patch, it just update the particular field in the resource. Okay. Yeah. And the post annotation which is used to adding the new resource to the existing database. Okay. Yeah, table, yeah. Okay, got it. Uh, okay. Uh, have you worked with Spring Boot Actuators? Yes. Uh, can you please go ahead? So Spring Boot Actuators is like production ready feature. So it gives some like, test the application, health, health, or like metrics.
[11:21]Yeah. Okay. Can you tell me the name of few endpoints that actuators provide?
[11:29]Like health endpoints. Info endpoints, metrics.
[11:39]Okay. So, how, how do you secure rest APIs? What's your pattern? So, the first one is like using the framework. So open authorization. So another thing using that like authorized like annotations. Our base access control. Yeah, mechanism. Okay. What is a 404 error and 401? Yeah, sorry. What is 404 error and 401? Yeah, 404 that is like resource not found. So 401 is like unauthorized access.
[12:30]Okay. And what is 500 series? It's like server error. Server errors. Okay. Uh, so how do you handle these errors user friendly manner in Spring Boot application?
[12:53]First, we have to if I got the any like 404. So we using that create the some custom class in the exception handler. So we just like implement the service not found. Yeah. So if we got the 500 like that is server error.
[13:16]Okay. Okay, got it. Can you explain the Spring Data JPA? Yeah, Spring Data JPA is like a specialization of ORM framework. So, which is used to like mapping the object object between and relation database.
[13:36]Okay. Okay. So, do you know about N+1 problem?
[13:43]Yeah, actually I'm not that much of confidence in that problem. It's fine, fine. Do you know about JDBC?
[13:56]Yes. What is the full form of JDBC?
[14:02]JDBC Java database connectivity. Okay. Uh, okay. Uh, moving ahead, what are the microservices and how does it differ from monolithic architecture?
[14:19]Yeah. Basically, monolithic architecture, which is that entire application in the one container, means like Yeah, so entire functionality or entire service in the one, so the whole database, which is depend on that one application, one application. So when come to the micro service, so we divided the microservice into the services. So each services has its own database or own functionality. Okay. So like, yeah. So each service has communicate through the rest calls.
[14:58]Okay. Moving ahead. Have you faced any challenges while developing microservice architecture?
[15:05]Yeah. Can you tell me few challenges? So, the first issue which is I like getting that rest calls between the services. The first issue I got. Okay. Okay. So, you need to identify that where that service resource not found something or issues between the another service. So these are some issues I got. Okay. So, how do microservice communicate with each other? I mean, how do the services inside the microservice architecture communicate with each other? There are two ways, like using the synchronous communication and asynchronous communication. When come to the synchronous communication, using the rest calls. So using the JSON or XML format, they're sending the data each other, each service, each service. Another thing is like using the Kafka. Kafka architecture, which is one service act as a producer, another service act as a consumer. So between the sending the data, using the topic. In the form of topic, yeah. Okay. Okay. So, Manju, now I will give you few coding questions, like first one would be input output based question. I will share a snippet code in you have to tell me what would be the output and second is I would give you a coding question that you have to write in Java stream API. Okay. Are you comfortable? Yes. Yeah, please share your screen.
[16:50]Okay. So I have dropped one snippet in the chat box. Can you please copy that and paste in any of the editor?
[17:05]Okay. So you have to tell me the outputs in true and false. Like S1 is equal to is equal to S3 whether it will be true or false in the the following lines as well. Yes.
[17:23]Yeah. Because it's a string literal, which is stored in the string constant pool. Oh. If you in the string constant pool, it's referring the same object. But we are it's comparing the address. Means like references. Okay. Can you copy this code and run in any editor? In the ID? Yeah, in the ID.
[18:02]Okay. So it will false, true and true. Third will be true because in string pool, this will check the content also, not the reference. Okay. Okay. Yeah, it's That's a confusion part. People think like double equal checks the reference and these are they will give reference. No, in string pool, let's say if S1 is equal to is equal to test. Now if we are creating S1 is equal to S3 is equal to test. So there will be a one test. Now S1 and S3 referring to the same test string that is available there. That's why string is immutable. We cannot change. Okay, sir. Yeah. Okay. Now I am just going to give you one coding question. Okay. So, you have to write that code in the stream API. Okay. You have to find the number of occurrence of each letter in the string. Okay. By using stream API. Okay. Okay. Using stream. Okay.
[19:00]Now put like output should be like Java as to Java comes two times, Python one, C++ one. Okay. Okay. So, I think I'm running out of time. You could try this code after this interview. Okay. And thank you so much. It was a wonderful interview. You have answered all the questions.



