Java Spring Boot 10+ Yrs Interview Experience [Lead Developer] — Transcript
Full transcript
- 0:00Hey guys, today we have Sep and he is
- 0:02having total 10 plus year of experience
- 0:04in Java, Spring Boot and microservices
- 0:05domain and those who want to give same
- 0:07free mock interview, please fill out the
- 0:09form below in the description. So now
- 0:10let's get started. Hey hello Sep, how
- 0:12are you?
- 0:14>> Hi. Hi Ali, good afternoon. I'm good.
- 0:15How are you?
- 0:16>> Yes, I'm also good. Shall we start?
- 0:18>> Yes. Yes.
- 0:19>> Okay. Okay. So can you please introduce
- 0:21yourself? It seems you are very excited,
- 0:23right? [laughter]
- 0:24>> Excited and bit nervous as well but
- 0:26yeah. [gasps]
- 0:26>> Okay. So can you please introduce
- 0:28yourself and your recent project in
- 0:30brief?
- 0:32>> Yeah. [clears throat]
- 0:34Uh so uh basically I have around 10
- 0:36place of uh working experience uh with
- 0:39mainly into Java and Spring Boot and uh
- 0:42uh microservices. Uh present my role is
- 0:45uh principal software engineer in
- 0:47whichever the organization I'm working
- 0:48on. Uh my recent uh project is one of
- 0:53the uh project uh in Texas and east in
- 0:57uh uh uh US where they are supporting
- 0:59some electric electricity and gas
- 1:02services uh
- 1:03>> uh to the uh uh people who are living in
- 1:06those multiple states based on the zip
- 1:08codes, utilities uh uh we are providing
- 1:11some offers, building uh everything uh
- 1:14uh to them. That is the recent project
- 1:16what I have worked on. While coming to
- 1:17the very latest things, recently we have
- 1:20started uh uh migrating to Spring Boot 3
- 1:23and uh Java 21 to some of the uh
- 1:26projects. We uh yeah it's it's in
- 1:29challenges that you are facing uh in
- 1:30migration. Uh the thing is it it is
- 1:34giving all the dependencies which
- 1:36supports by spring boot dependency like
- 1:383 through 3x versions and uh we are uh
- 1:43pointing it to Java 20 till that is good
- 1:46but uh there are lot of things uh we are
- 1:49uh experiencing during a lot of things
- 1:52are getting failed uh uh when we are
- 1:54running the mayan build and when we are
- 1:55running the application and during Mayan
- 1:57build we are getting a lot of compil
- 1:59compilation issues mainly with respect
- 2:00to uh what we call Java X and the
- 2:03Jakarta uh imports are being changed and
- 2:06uh uh another thing is uh JPA repository
- 2:09things are getting failed because of the
- 2:12syntactical errors uh with the respect
- 2:14to the different hibernate versions. uh
- 2:17some some of the uh syntaxes which were
- 2:21not uh present in the 21 still we are
- 2:24using either it from 11 or 17 or 8 it's
- 2:27telling that you have to override this
- 2:29and you have to import new imports and
- 2:32uh removing the old one
- 2:33>> and also have you migrated Java X to
- 2:35Jakarta or it was already migrated
- 2:38>> no we are migrating to Java X to Jakarta
- 2:41>> okay got it let's say you have a
- 2:45monolithic application with no test and
- 2:49poor documentation, right? So, how would
- 2:51you plan the migration to microservices?
- 2:57>> Okay. M
- 2:58>> uh so
- 3:00basically when as you told when we don't
- 3:03have any proper test and poor uh this
- 3:06code quality generally what I'll be
- 3:08doing is things like first I'll start
- 3:09with uh uh starting some uh critical
- 3:12unit and integration test for the most
- 3:14of the uh importance and uh risky parts
- 3:17of the application like what are the
- 3:19main APIs we have
- 3:20>> uh to ensure before migrating those are
- 3:23the API should be uh stable and uh
- 3:25working as expected because because most
- 3:27of API whatever the biggest APIs are
- 3:30there like small small APIs and which
- 3:32has less functionality less dependency
- 3:34on the production and which will giving
- 3:36the response with less business logic
- 3:38and all that will be taken care of in
- 3:40the next level mainly focusing on the uh
- 3:42major APIs uh and also uh gradually
- 3:46we'll refactor the code in small chunks
- 3:48to improve the uh readability and
- 3:50maintainability without breaking the
- 3:52existing functional that is also one of
- 3:54the uh main thing uh and also if there
- 3:57are we don't have any uh integrating
- 4:00with the sonar QVs to do that as well to
- 4:02prevent lot of the uh major uh minor
- 4:06critical uh and all these uh uh bugs.
- 4:10>> Okay. Yes. Yes. That's nice. Okay. So
- 4:13can you tell me how would you implement
- 4:14soft deletes?
- 4:16>> Swap delete or soft delete?
- 4:17>> Soft sof.
- 4:19>> Okay.
- 4:20>> Yep.
- 4:21>> Uh
- 4:23so basically soft delete it's like uh
- 4:25removing the record it from the
- 4:27uh database or storage uh usually it's
- 4:30setting uh flag by is disabled is equal
- 4:33is deleted is equals to true if I'm not
- 4:35wrong
- 4:36>> uh what happens in that case is that uh
- 4:38I'll write a boolean field is deleted is
- 4:41equals to uh true in the entity and I'll
- 4:44update it while uh deleting and modifies
- 4:47the query to uh filter out some soft
- 4:50deleted records
- 4:53>> and also what happens in this case is
- 4:55like uh M and this is uh
- 4:58>> what's the difference between soft
- 4:59delete and hard delete?
- 5:01>> Soft delete and uh hard delete.
- 5:03>> Mhm.
- 5:04>> Okay.
- 5:05So as I told uh earlier uh this is used
- 5:11to delete and make a copy and it is used
- 5:13for data retrieving and hard delete I
- 5:16think it will be difficult for us to
- 5:18retrieve the data in case of uh copying
- 5:21or something like that.
- 5:22>> Mhm. Yeah. Yeah. That's correct. Soft
- 5:24delete means we are not deleting it. We
- 5:26are just hiding it. But it is somewhere
- 5:28in the database.
- 5:30>> Database. Correct. Correct.
- 5:31>> Mhm. But
- 5:31>> and soft delete that's what uh yeah it
- 5:34it is used for data retrieval as well.
- 5:36Soft delete what I mean to say.
- 5:37>> Okay. Hey guys, I want to share
- 5:39something important with you. Actually
- 5:40Sundep prepared from our interview
- 5:42preparation kit and cracked multiple
- 5:44interviews. We have also referred him to
- 5:46the multiple companies. So let me tell
- 5:48you this interview preparation kit has
- 5:49four main parts. First is complete
- 5:51interview preparation material. It is a
- 5:53step-by-step material made by me expert
- 5:55and MNC's interviews. 99% of the
- 5:57questions asked in interviews are
- 5:58covered in it. Second is two real
- 6:00enterprise client projects code and
- 6:01video recorded sessions are there and
- 6:03you can add this in your resume. Third
- 6:05is lifetime chat support. Here you can
- 6:07ask your doubts any time. Fourth is
- 6:09referral support. Here we help you get
- 6:10referred to the top MNC's. So basically
- 6:13the material is organized as per your
- 6:14experience level and covers Java, Spring
- 6:16Boot, Spring Security, Spring Data, JPM,
- 6:19microservices, Kafka, Maven get coding
- 6:21questions, stream API coding questions
- 6:22and many more. You can buy just the
- 6:24complete interview preparation material
- 6:25or the full kit with project supports
- 6:27and referrals. I have added the links in
- 6:29the description below. So now moving to
- 6:31our interview and guys before moving to
- 6:33our interview since sep is here so we
- 6:35can ask about uh the review of uh that
- 6:38kit. So SEP uh could you please go
- 6:40ahead?
- 6:40>> Uh yeah. So uh that kit whatever
- 6:44whichever the kit I have purchase it's
- 6:46uh very very helpful.
- 6:47>> Okay.
- 6:48>> Even uh I could see very uh small small
- 6:51things and small small concepts in
- 6:53detail with explanation
- 6:55>> uh that how uh it will helpful in
- 6:57writing or any interview preparation and
- 7:00while implementing any of the logic
- 7:01which improves the performance
- 7:03[clears throat] and all and also it
- 7:04helped me in cracking more number of uh
- 7:07interviews as well. Most of the
- 7:08questions as you are telling in uh every
- 7:10video like yeah most of the questions
- 7:12are being asked uh that was yeah helpful
- 7:15very very helpful even I was regularly
- 7:17following your uh uh uh this interview
- 7:20videos as well.
- 7:21>> So okay nice
- 7:22>> yeah I suggest if anyone wants to crack
- 7:24the interview it's better to buy a kit
- 7:27and watch your interview videos that
- 7:29would be very very helpful. Okay buddy.
- 7:32Yeah, thank you so much. Now
- 7:34>> thanks. Thanks man.
- 7:35>> Let's move to our interview. How would
- 7:38you prevent common vulnerabilities in a
- 7:40rest API? Common vulnerabilities means
- 7:43like SQL injection, CSRF, XSS.
- 7:47>> Okay.
- 7:48>> Mhm.
- 7:49>> In this case what we can do? Okay. uh
- 7:52before uh entering the uh control to the
- 7:56controller, we can write some
- 7:58>> filters and some regular expressions in
- 8:01our code. [snorts] If any of the request
- 8:04is uh coming to a filter, if it matches
- 8:07that regular expression either as you
- 8:09told uh SQL injection or XSS uh uh this
- 8:13one cross scripting and all. So we we
- 8:17are matching if uh the request has that
- 8:19regular expression and we are uh not
- 8:21sending the control to control and
- 8:23redirecting to some either uh login page
- 8:25or something like that.
- 8:28>> Yeah. Yeah. And also instead of some uh
- 8:31exposing sensitive data through uh
- 8:33improper error message and unsecure
- 8:35endpoints uh
- 8:39yeah something
- 8:41>> and we could use prepared statements
- 8:43input validation CSR tokens input
- 8:45validation headers. Yes.
- 8:47>> Yes. Yes. Yes. Headers as well. Yeah.
- 8:49>> Okay. So in your current project how you
- 8:51guys are rotating secrets?
- 8:53>> Okay. So we have different types of uh
- 8:56uh secrets. So basically uh different uh
- 9:00projects are using different types of uh
- 9:01secrets. So in in this case I'm
- 9:04considering secrets. It's not about only
- 9:06the secret key. It can be any uh uh uh
- 9:10what we call database passwords or uh
- 9:12third party API passwords everything we
- 9:13are considering it as a uh secrets. Uh
- 9:16database things we are handling it
- 9:18through the console.
- 9:19>> Mhm.
- 9:20>> Okay. Uh and also if related to any AWS
- 9:25projects uh uh SQL sorry uh secrets are
- 9:28automatically rotated on a uh
- 9:31scheduleuler configured in AWS and also
- 9:34other thing uh we are also having uh
- 9:37monitoring or alerting in places to
- 9:39detect any unauthorized access or
- 9:41failure in uh uh secrets retrieval. And
- 9:44in AWS we will be using some secret
- 9:46managers to secure uh store and some
- 9:50manage secrets like database
- 9:51credentials, API keys, uh tokens uh as I
- 9:55told any if you are validating through
- 9:56any third party API for that usernames
- 9:58and password something like that.
- 10:00>> Correct. Correct. Okay. So can you
- 10:03please tell me how would you design a
- 10:05system to handle 100x traffic spikes?
- 10:08>> Okay.
- 10:09>> Mhm. So first of all okay based on the
- 10:14complete design I'll decide okay by
- 10:18default I'll make it as a micros service
- 10:20that's for sure
- 10:21>> so and after that I'll decide how many
- 10:24number of uh services it required
- 10:27instead of uh uh dividing into main
- 10:30let's say if uh complete application
- 10:32required three I cannot make it to seven
- 10:34because of some cost cutting issues uh
- 10:37maintenance and all uh because if
- 10:39everything is dependent on each and
- 10:40everything. So in order to avoid that
- 10:42problem, I'll make sure that only
- 10:44required number of services it should
- 10:46have. Uh and also I'll make it most of
- 10:50the things I'll make it as stateless
- 10:52components. Stateless components so we
- 10:54can use uh uh horizontally by adding
- 10:56more uh instage during spikes.
- 10:59>> Mhm.
- 10:59>> And we'll use load balances as well.
- 11:02>> Okay. And also we'll be using some uh
- 11:05caching techniques to each and every
- 11:07time to make the call to the backend
- 11:09service which will reduce the traffic
- 11:12like we can use radius cachy and store
- 11:13it in our uh things and we can use uh
- 11:16wherever uh we required.
- 11:18>> That's correct. Okay. So how how would
- 11:20you optimize JVM startup time? JVM will
- 11:24use uh quick start
- 11:29to reduce the time spent on uh uh the
- 11:33compiler during uh startup
- 11:35>> means I didn't get you
- 11:39>> uh
- 11:42what we call that uh how to explain
- 11:46>> have you heard about grow VM?
- 11:51No.
- 11:53>> Okay. Um
- 11:54>> I while even I have saw this uh I'll
- 11:59tell basically so I think in your
- 12:02interviews only I've start how to reduce
- 12:04the time whenever we run any springwood
- 12:07application if I'm not wrong from that I
- 12:09got to know this while reading I got to
- 12:11know this as well. So only one thing I
- 12:15know is like uh x - x start uh while
- 12:19running the uh jit compile or something
- 12:22like that.
- 12:22>> Okay. Yeah, that may be the answer. I'm
- 12:25not aware
- 12:25>> another one.
- 12:27>> Maybe another use uh yeah maybe another
- 12:29way but we could use grav native image
- 12:32for fast startup class data sharing to
- 12:35use class meta data right AOT uh
- 12:38compilation. [snorts]
- 12:41>> Okay. Um do you know about object
- 12:44pooling?
- 12:45>> Yes.
- 12:46>> Okay. Please go ahead.
- 12:47>> Uh what we call what basically so it's a
- 12:50technique where uh we'll create a pool
- 12:53of uh what we call reusable objects. So
- 12:56instead of creating and destroying uh
- 12:59them repeatedly.
- 13:01uh what is the main use of this uh
- 13:03object pooling is like uh it will
- 13:05improve the uh performance by creating
- 13:08the overhead object creation and then uh
- 13:11garbage collection. M
- 13:13>> so basically it's like yeah we uh object
- 13:17pooling is like connection pooling I
- 13:19think most of the most of them we have
- 13:21use heard the call as uh connection pool
- 13:24while creating the database uh
- 13:26connections similar way while creating
- 13:28multiple uh reusable objects
- 13:31>> yep yep that's correct um so sep can you
- 13:34please explain JVM architecture like the
- 13:37role of class loader runtime data areas
- 13:40and execution engine.
- 13:45>> Okay.
- 13:45>> Mhm.
- 13:46>> So, one thing.
- 13:51Okay. Uh so, basically uh this JVM
- 13:55architecture is several uh is made up of
- 13:57several components which is used to uh
- 14:00which all together uh which is used to
- 14:03run the Java program. That is the main
- 14:04thing. Uh as you asked for the class
- 14:06loader uh thing uh uh it loads the class
- 14:09files into our uh JVM memory uh we have
- 14:13uh uh what we call different types of uh
- 14:16uh hierarchy like uh uh bootstrap uh
- 14:19extensions uh that loads core java
- 14:22classes extens extensions and uh
- 14:24applications classes respectively. uh if
- 14:27I'm not wrong uh I think uh correct me
- 14:30if if I'm not if I'm uh wrong I think
- 14:32class loader is responsible for uh uh
- 14:35what we call assigning default values to
- 14:38all the different types of uh data types
- 14:40if if I'm not wrong uh that is one thing
- 14:44>> and also as we know different types of
- 14:47objects like heap stack uh uh string
- 14:49constant pool and all method area where
- 14:51we'll have uh
- 14:53ob
- 14:55memory space allocated for uh uh
- 14:57constants and static variables. Heap for
- 14:59all objects. Uh and uh we have uh
- 15:03>> what's the difference program and heap
- 15:05memory?
- 15:10>> What is the difference between
- 15:11>> stack memory and heap memory?
- 15:16>> Okay. He heap is used to store all the
- 15:20objects basically where all the objects
- 15:22is stored uh and also uh when any
- 15:26objects is created in heap memory it is
- 15:29uh uh managed by uh garbage collectors
- 15:32and uh it can be uh shared across all
- 15:35the threads. That is one thing. While
- 15:37coming to uh stack uh stack memory uh
- 15:41mainly it's used to store some local
- 15:44variables and uh references. Mhm.
- 15:47>> Uh in this case uh each thread will have
- 15:50its uh own stack or something like that.
- 15:53>> And also stack memory is uh limited in
- 15:56size
- 15:58which heap has some uh larger memory
- 16:00allocation based on the dynamic memory
- 16:03allocation.
- 16:04>> Correct. Correct. Okay. Can you explain
- 16:07the Java's thread life cycle and also uh
- 16:09the difference between blocked waiting
- 16:11and time waiting states?
- 16:15Java thread life cycle.
- 16:17>> Yes. Yes.
- 16:18>> Yeah. So we'll have new runnable running
- 16:21blocked and uh
- 16:22>> uh dead or terminated. Uh basically
- 16:27uh when a thread enters into that uh it
- 16:30will be in uh new state which uh that
- 16:32means that thread is not yet started. uh
- 16:35after calling the start method uh that
- 16:38thread will be in uh uh runnable state
- 16:40and I think it will be waiting for the
- 16:42CPU approval to CPU time to run uh to
- 16:45run the job. Uh and while when it is in
- 16:50running state uh uh I think it will pick
- 16:53some uh scheduulers and the thread it
- 16:55and it starts executing. uh whenever we
- 16:59write uh any waiting or asynchronous
- 17:02calls it will be in blocked or waiting
- 17:04state and terminated when thread
- 17:06finishes its complete task it is in
- 17:08terminated.
- 17:09>> Mhm. Yes. Yes. That's correct. Okay. So
- 17:13seping
- 17:19>> log striping. No.
- 17:20>> Mhm. Okay. So concurrent hashmap uses it
- 17:23[snorts] internally. Do you know?
- 17:26>> Yes.
- 17:28Yeah, please go ahead.
- 17:30>> Yeah, so [clears throat]
- 17:33I think uh this concurrent hashmap will
- 17:34come into the picture when uh I guess
- 17:36when we are reading and making uh uh
- 17:39some changes to the map, concurrent
- 17:40exception will occur. In order to avoid
- 17:42that problem, we'll be using this uh uh
- 17:45concurrent hashmap.
- 17:46>> Mhm.
- 17:46>> Okay. uh what we'll do is like uh
- 17:49internal uh it will divide the uh data
- 17:52into multiple segment and uh uh seg
- 17:56segments and strikes or stripes if I'm
- 17:58not wrong. uh uh and each one will have
- 18:00its own lock to perform some uh uh
- 18:04operations without blocking each other.
- 18:06>> Mhm.
- 18:07>> And also this is used to help the uh
- 18:10what we call performance by uh uh
- 18:13locking and uh locking only the specific
- 18:17uh grain uh object uh instead of
- 18:20completely blocking the entire map. What
- 18:22happens in this case is like threats can
- 18:24operate on different parts of the map
- 18:26simultaneously. M
- 18:28>> uh redundant uh uh bottleneck uh we can
- 18:32solve that uh issue.
- 18:34>> Okay. Yep. Yep. That's correct. Uh so
- 18:37sep uh tell me um let's say if there are
- 18:40some concurrency issues in the hashmap,
- 18:42we could use concurrent hashmap, right?
- 18:44But if there are some issues in hashet,
- 18:46so what would be use in used?
- 18:53So as we know [snorts] hashmap is not uh
- 18:57thread safe uh and uh multiple threads
- 19:00is uh uh modifying it concurrently. So
- 19:05it can throw some uh what do you call
- 19:07concurrent modification exception
- 19:09>> the same thing is I mean there in the
- 19:11hash thread right?
- 19:13>> Yes.
- 19:13>> So what's the alternative in the hash
- 19:16then?
- 19:19printing what's alternating hash set
- 19:22>> if we want to use the thread safe hash
- 19:25set. So
- 19:27>> uh what would you use
- 19:31>> think concurrent hashmaps dot new hash
- 19:35set or something new key set if I'm not
- 19:38wrong. No, no.
- 19:40>> Oh,
- 19:41>> yeah. All obviously uh by using
- 19:44concurrent hashmap we can uh work with
- 19:46the set as well.
- 19:48>> We can work with keys or values, right?
- 19:51And sorry keys and make synchronizes.
- 19:54>> Yeah. Yeah. Synchroniz
- 19:55>> collections don't synchronize
- 19:56>> collections. Ah okay okay. Actually yeah
- 20:00concurrent
- 20:01>> and thread safe.
- 20:03>> Yes. Yes. Yes. Actually yeah uh there
- 20:06were two ways uh I guess. One is uh uh
- 20:09concurrent hashmap dot new case set uh
- 20:12which provides a concurrent set uh by a
- 20:15concurrent hashmap. Other one is like
- 20:16yeah collections dots synchronize set.
- 20:19>> Yep. Yep. Got it.
- 20:20>> But what's the drawback of using
- 20:21collections synchronized map set?
- 20:30What is the drawback of using
- 20:32>> these collections dots synchronize map
- 20:34synchronize set synchronize list?
- 20:40I think
- 20:44maybe
- 20:45it will reduce some performance because
- 20:48of some high occurrences.
- 20:52>> No.
- 20:52>> And also no because of any locking
- 20:55system internally.
- 20:57>> Yeah. Yeah. Because of locking system. M
- 20:59yes
- 20:59>> it locks the entire map or set or this
- 21:02[clears throat]
- 21:03>> yes
- 21:03>> don't work it doesn't work uh based on
- 21:06the segments right
- 21:08>> segments or stripes what's happening in
- 21:10the main concurrent hashmap
- 21:11>> yep y
- 21:12>> yeah yes yes complete blocking system
- 21:15>> okay so sep
- 21:17migrated to Java 21 or migrating to Java
- 21:2021 uh do you know the concept of virtual
- 21:23threads in Java
- 21:29virtual threats.
- 21:31>> Uh we call it project loom
- 21:35also.
- 21:38>> Yeah. Yes, I heard this. Yeah. uh it's
- 21:41like uh lightweight threads uh managed
- 21:44by I guess uh Java runtime rather than
- 21:48the OS the main thing
- 21:51>> and also
- 21:53uh they are used to write uh concurrent
- 21:55code much simpler uh uh and also we can
- 22:01use the same thread uh uh per model but
- 22:05uh which will which will make the better
- 22:07uh scalability. [clears throat]
- 22:09>> Yep. Yep. And
- 22:12>> virtual threads are lightweight threads
- 22:13managed by JVM instead of us.
- 22:16>> They allow handling thousands of
- 22:17concurrent task efficiently.
- 22:20>> Yeah, I think basically they they'll be
- 22:22calling it as game changer for
- 22:24concurrency in Java.
- 22:25>> Yes, even
- 22:27>> in 21
- 22:29since uh since you said you are
- 22:31migrating to Java 21. So uh questions
- 22:34from Java 21 could be asked to be
- 22:38prepared.
- 22:38>> Okay.
- 22:39>> Yes.
- 22:40Okay.
- 22:41>> Y and how does springs async annotation
- 22:45work under the hood or behind the scene?
- 22:50>> Okay. M
- 22:52>> uh
- 22:53especially in case of uh asynchronous
- 22:56calls whenever we write any uh method
- 22:59with asynchronous it's annotated within
- 23:02asynchronous
- 23:03>> uh I think whenever we run the
- 23:04application that async method will have
- 23:07a separate uh thread to uh finish its
- 23:10task
- 23:11>> uh and also uh whenever it's uh uh the
- 23:17thread submits the method to the call uh
- 23:20what task task executor uh
- 23:22>> uh which is managed by the thread pool
- 23:25>> and also
- 23:27uh it will uh enable some non-blocking
- 23:29behavior as well.
- 23:31>> Mhm.
- 23:33>> Uh simple asynchronous task task
- 23:35executor something like that.
- 23:36>> It uses spring
- 23:39>> and run methods in a separate thread
- 23:40pool.
- 23:41>> Correct. Correct. Correct.
- 23:43>> Correct. Have you worked with spring
- 23:45weblex? Web flux sorry
- 23:51>> uh no
- 23:52>> no okay basically web flux supports
- 23:55non-blocking reactive programming
- 23:58right
- 23:58>> okay okay
- 24:02uh moving ahead
- 24:06uh do you know about event listener
- 24:08annotation
- 24:13yes
- 24:15please go ahead
- 24:16Yeah. So [clears throat] uh this is uh
- 24:19as as discussed with the asynchronous.
- 24:22So whenever uh we'll be using the same
- 24:24as similar way of annotation like event
- 24:27listener
- 24:28>> uh spring automatically uh calls that
- 24:31method uh when we annotate uh at the
- 24:33rate event listener uh
- 24:34>> uh which matches with that uh specific
- 24:36uh event type
- 24:38>> and also uh uh this uh removes this
- 24:42removes the need of uh uh implement
- 24:44application listener explicitly
- 24:47>> uh which is uh uh which makes the code
- 24:50more readable and uh easier to maintain.
- 24:55>> Okay.
- 24:55>> And also it supports features like uh uh
- 24:59conditional event and asynchronous
- 25:01processing
- 25:02>> uh fastdriven uh uh responses. Event
- 25:06driven respon not fast driven event
- 25:08driven responses.
- 25:09>> Yep. Yep. That's correct. Okay. So uh
- 25:12sep when would you use retryable
- 25:15annotation versus manual retry logic?
- 25:23retryable and then uh manual retry.
- 25:26>> Mhm.
- 25:29>> Retriable
- 25:31uh we'll be using when uh any method on
- 25:36failure basis uh like maximum number of
- 25:40times it's uh it want to reattempt or
- 25:43recall uh any exceptions. So you don't
- 25:46want to uh write your code for yourself
- 25:50that is I think retraable manual retry
- 25:52logic is like uh write your uh own loops
- 25:56or recursive calls to retry operations.
- 26:01>> Yep. Yep. That's correct. Okay. So how
- 26:05would you implement distributed locking
- 26:07in Spring Boot?
- 26:15distributed. Okay. Uh
- 26:19distributed or the basic uh
- 26:21>> distributed locking in
- 26:24>> distributed locking in in
- 26:27>> Spring. Okay. Uh I think distributed is
- 26:33uh used when we have uh
- 26:36multiple instances of our applications
- 26:39like uh yeah microservices uh because uh
- 26:44uh it it needs to coordinate access to
- 26:47shared sources across the all the
- 26:49services and also for distributed uh uh
- 26:54locking we'll be using uh uh uh radius
- 26:57and zookeep keeper uh to create the
- 26:59logs.
- 27:00>> Uh Kafka Zookeeper
- 27:03>> uh only one instance uh can perform some
- 27:06critical operations uh at a time.
- 27:09>> Yep. Yep. It can also be implemented by
- 27:12using radius if you have used
- 27:14>> Yes. Radius
- 27:15>> or database or
- 27:16>> radius or zoo. Mhm. Radius or zookeeper.
- 27:20Yes.
- 27:20>> Yep. Yep. Okay. Okay. So in
- 27:22microservices, have you heard about ACL
- 27:24pattern? Anti-corruption layer pattern?
- 27:29>> ACL or anti-corruption. Yes.
- 27:32>> Yeah.
- 27:32>> ACL. Yeah. Abbreviation ACL
- 27:35anti-corruption uh pattern. Uh it's same
- 27:38like I think if I'm not wrong, it's one
- 27:40of the uh design patterns what we have
- 27:42some architecture sorry orchestrators
- 27:44and other design patterns uh during in
- 27:46microservices implementation. uh what
- 27:49basically this ACL is used to protect
- 27:51our uh systems being from being tightly
- 27:54coupled uh to external systems or uh
- 27:58legacy code.
- 27:59>> Uh and also it acts like a uh translator
- 28:02between system and the external systems
- 28:06uh converting our all the data and calls
- 28:09uh uh unaffected by the external
- 28:11changes. M
- 28:13>> what we call it is used to maintain some
- 28:16integrity and uh uh what we call uh
- 28:20inconsistency of any poorly designed
- 28:22architectures any in any of the service.
- 28:26>> Yeah.
- 28:28>> That's correct. Um what is the sidecar
- 28:31pattern? Have you heard about sidecar
- 28:33pattern?
- 28:36>> No.
- 28:37>> Sidecar? No.
- 28:38>> Okay. No.
- 28:39>> Yeah. [laughter] It runs a helper
- 28:41component alongside the main service uh
- 28:44in service mesh right handle networking
- 28:46logging security and monitoring without
- 28:48modifying the application code.
- 28:51>> Okay.
- 28:51>> It's like um we do logging in spring
- 28:54boot use a something like that.
- 28:58>> Yeah, I got it. Like yeah.
- 29:00>> Mhm.
- 29:00>> Any Yeah. AOP basically as you said uh
- 29:03any logging information any validations
- 29:06[clears throat] before uh uh entering
- 29:08into the controller it it will do some
- 29:10validations if it successes then only it
- 29:12will come to the main application. Yeah.
- 29:14Same as like AOP spring AOP.
- 29:16>> Yep. Yep. Yep. Okay. Um moving ahead. Uh
- 29:22uh do you know about blue
- 29:24[clears throat] green deployment?
- 29:27>> Yes.
- 29:28>> Yeah. Please go ahead.
- 29:30Yeah. So basically we'll be using this
- 29:32in uh production deployments mainly
- 29:34because non-product okay somehow it goes
- 29:36down also uh we can ask some our testers
- 29:39to wait for some time and we can fix it
- 29:42but in case of production uh uh it will
- 29:44be a a big loss if goes down and it will
- 29:47be hectic until we resolve. So what
- 29:50we'll do is like uh
- 29:52>> uh we'll be using this uh blue green uh
- 29:55deployments in production mainly. M
- 29:57>> so we have two different types of
- 29:59environments. Blue is the which is in
- 30:02live for as for production and green
- 30:04will be uh which is about to go to the
- 30:06production. We can consider the new
- 30:08version. So this we'll be calling it as
- 30:09blue green version. Uh what we'll do uh
- 30:12we'll deploy this uh green environment
- 30:15like which is new environment while uh
- 30:18old uh blue is still uh serving the
- 30:22users. Once the uh this uh new version
- 30:26green deployment is uh completely tested
- 30:28and ready to use, we can switch the
- 30:30traffic from blue to green and we can
- 30:34decommission the blue and we can make
- 30:36the green uh instant lively for uh uh
- 30:39all the customers in prod.
- 30:42>> Okay. And also this will help us to roll
- 30:45back uh to the older one if something
- 30:48goes wrong uh uh uh anything went wrong
- 30:52during uh while testing in prod
- 30:55>> that also helps switching back easily.
- 30:58>> Yep. Yep. Okay. Okay. Sep now I will
- 31:02give you a few coding questions. Right.
- 31:06You are able I mean are you comfortable
- 31:09doing in stream API?
- 31:12Yes.
- 31:13>> Yes. And normal coding also, right?
- 31:16>> Yeah. Let's see if [laughter] it goes
- 31:19much.
- 31:20>> Okay. So, Sep uh can you please share
- 31:23your screen and open any editor, local
- 31:26editor or online editor, it's up to you.
- 31:28Oh,
- 31:29>> then I will share a quing question right
- 31:32one by one.
- 31:33>> Okay. All the IDs are my internal
- 31:37projects.
- 31:38All later. One second. Can you see this
- 31:41uh chrome tab? Yes. Yes, I could see.
- 31:44>> Mhm.
- 31:45>> Okay. So, the question is um you are
- 31:48given a list of uh numbers, right? And
- 31:54uh you have to print the top third
- 31:58number from the list.
- 32:03>> Okay.
- 32:04>> Okay.
- 32:04>> So, basically it's like uh Mhm. It's
- 32:07like highest third number.
- 32:10>> Highest third number.
- 32:11Okay. Yep. Yeah, please do it.
- 32:15>> Okay.
- 32:17Or else can I use this note? That's
- 32:19okay. Fine.
- 32:20>> Uh
- 32:21>> uh
- 32:22>> online editor is fine, I think.
- 33:05uh okay now what unique
- 33:13let me write the size
- 33:17is greater less than three because at
- 33:20least we need to have three numbers.
- 33:23This we are returning
- 33:27null to it. Else what we can do is like
- 33:31uh
- 33:33unique
- 33:34as it's say
- 33:38uh tree set we can have unique names dot
- 33:41iterator list type will be iterator
- 33:50iterator
- 33:56teacher we can call it as TR
- 34:01so
- 34:09dot it might be
- 34:12not sure
- 34:20next of
- 34:25wherever we want uh
- 34:28uh uh or return
- 34:31and uh here uh
- 34:34as we are calling it here
- 34:38in uh third highest number is equals to
- 34:43okay anyhow we have this right let me
- 34:46if
- 34:47>> okay so um sep
- 34:50>> yep yep so since you are
- 34:54>> uh since you are not using stream APIs
- 34:57right so This could be done like we
- 35:00could use collection dots sort then we
- 35:02could pass the list right
- 35:05>> I mean uh we don't need this tree set
- 35:09and all is it
- 35:15>> yes
- 35:18something like that
- 35:21[snorts]
- 35:22uh
- 35:22>> you could use collection sort and then
- 35:24sort in the reverse [clears throat]
- 35:25order
- 35:26>> and then we can direct ly print the
- 35:28third highest from the list.
- 35:30>> Yeah. U so yeah here uh what I am doing
- 35:34is like I'm creating array of dash list
- 35:35and uh uh I'm using preset just to uh
- 35:38remove some uh uh duplicate. There might
- 35:41be okay I'm using preset just to remove
- 35:44the duplicates collection. Reverse
- 35:46order.
- 35:47>> So we'll have uh something like that
- 35:49right?
- 35:51>> If unique nums do size is less than
- 35:54three return
- 35:55>> at least we need to have train. Mhm.
- 35:57>> iterator
- 35:59unique iterator. Next iterator. Okay.
- 36:02Got it.
- 36:03>> Something this maybe.
- 36:05>> Yep. That is also uh correct way. Uh we
- 36:08could do this. Um okay. So how would you
- 36:11do uh by using stream API? The same
- 36:14question
- 36:17>> using stream API.
- 36:18>> Mhm. Java 8 features.
- 36:23>> Okay. So if uh we don't want all these
- 36:27things now
- 36:28>> what we can do is like uh uh first of
- 36:32all
- 36:34uh we by default whenever we want to get
- 36:37uh nums dot stream we can use
- 36:41>> mhm before this what we have used we
- 36:44have used right so to remove duplicates
- 36:47we'll be using distinct here just to
- 36:49make sure it should not have any uh
- 36:52duplicates dot sort instead of uh uh
- 36:55comparator dot uh
- 36:59comparator
- 37:00dot
- 37:02reverse uh order method.
- 37:06>> Mhm.
- 37:07>> And then
- 37:09uh as we want uh third one right dot
- 37:12skip of uh two dot find first something
- 37:17like this
- 37:20>> maybe.
- 37:21>> Yes. Yes. like based on tree set and
- 37:24sorting order. This is replacement of
- 37:26tree set. Uh this is for uh uh
- 37:30collection dot reverse order. Uh this is
- 37:33for iterator two times and then find
- 37:35first something like that.
- 37:37>> Yep. Yep. That is correct. Okay. Okay.
- 37:40So let's say you are given a two string.
- 37:41One is a string and another is
- 37:43substring.
- 37:45Okay. And you have to check whether the
- 37:47substring
- 37:49is there in the main string or not. So
- 37:52how would you do that?
- 37:55>> With the help of uh index of that string
- 37:59exist.
- 38:01>> Yeah, please go ahead. Uh
- 38:06so okay. So basically we need a program
- 38:08if uh sub if a string has substring.
- 38:15Okay.
- 38:18Okay.
- 38:19>> And don't use any uh direct methods like
- 38:23uh there are some inbuilt methods sub
- 38:26str something like that.
- 38:31>> Okay.
- 38:37>> So just we want to find out that uh
- 38:40substring exist or not.
- 38:42>> Yes. Yes. For example, first string is
- 38:45>> I got it.
- 38:46>> Second string is deep d. [clears throat]
- 38:49So deep is here.
- 38:52>> Hello world something as this is the
- 38:54default program.
- 38:58If anyone wants to learn so let's
- 39:00consider uh string s2 or s1 is equals to
- 39:05uh world we can use the case sensitive
- 39:09as well. Uh what we can do if uh
- 39:13uh
- 39:17s dot uh index of s_ub_2
- 39:23it's uh
- 39:26uh if it gives greater than equals to
- 39:28zero
- 39:30this will give uh string exist in that
- 39:32if not true something like this
- 39:37that's it index of yeah mostly index X
- 39:40of is the main one. That's what uh I'm
- 39:42thinking
- 39:42>> contains we could use contains
- 39:45>> contains S1 contains of S2 that also
- 39:47true.
- 39:48>> And how what how would you do in uh
- 39:51stream Java features
- 40:03with help of uh streams same thing.
- 40:06Okay.
- 40:08uh may okay in case of this thing we'll
- 40:11be using index of right maybe uh with
- 40:14the help of uh uh what we call uh
- 40:20filters or uh contains. One second. Let
- 40:24me
- 40:25>> Yeah. Yeah. Contains we could use
- 40:28>> Yeah.
- 40:31>> One second. Uh
- 40:35okay. List of uh streams. Uh filter
- 40:39>> strontains then uh inside.
- 40:41>> Yeah. Yeah. That's it. Uh first we'll
- 40:43write uh yeah uh s dot. So it's not
- 40:48>> okay. So don't write it's fine. I just
- 40:50understood.
- 40:52>> Yeah. dot filters dot uh s dot contains
- 40:56of substring something
- 40:58>> of s1 what something
- 41:02>> maybe that this would be the complete
- 41:04skeleton but if you write the proper
- 41:05method that would become proper uh uh
- 41:08syntax
- 41:09>> okay so yes um so sep yes it's done from
- 41:13my end and it was a very very nice
- 41:14Interview.
About this transcript
This page contains the full transcript of Java Spring Boot 10+ Yrs Interview Experience [Lead Developer] by GenZ Career, generated from the public captions YouTube serves with the video. The transcript has 5,724 words across 946 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.