Java Spring Boot 11 Years Interview Experience — Transcript
Full transcript
- 0:00hey guys today we have n and he's having
- 0:0211 year of experience in Java spring
- 0:04Boot and microservices domain and those
- 0:06who want to give same free mock
- 0:08interview please fill out the form below
- 0:10in the description so now let's get
- 0:11started hey hello NES how are you yeah
- 0:15I'm am fine how are you yes I'm also
- 0:17good shall we start yes sure okay okay
- 0:20so nsh can you please introduce yourself
- 0:22and your recent project in brief yeah so
- 0:26uh I have done my bachelor of
- 0:27engineering from Gujarat University
- 0:312011 then after I have joined CMC
- 0:33limited as a training Java developers
- 0:35and after completion of that training I
- 0:38have joined aside solution as a same as
- 0:42a same position training Java developers
- 0:44and currently working in same
- 0:46organization till 12 years and my
- 0:49current roles and responsibility and my
- 0:51position is STL engineering too so yeah
- 0:55for the technical perspective I have
- 0:57worked on music core Java Advan Java and
- 1:01spring boot hyber net and currently
- 1:03working on microservices MH uh my major
- 1:06role of my in this project is to convert
- 1:09the monolithic architecture of my
- 1:12product into the microservice base so I
- 1:15am the key so this is in progress this
- 1:17is in transition phase this is in
- 1:20transition phase okay okay and parall
- 1:22I'm managing the teams of the five
- 1:25peoples who are going to develop new the
- 1:29coming up features for that okay so
- 1:32basically also that is from the spring
- 1:33boot
- 1:34side okay okay so uh may I know what are
- 1:39the challenges you guys are facing uh
- 1:41converting this monolithic to
- 1:44microservices yeah the main thing is for
- 1:47the uh uh see this is a monolithic
- 1:51application so everything will be in a
- 1:53one one Services right so we are facing
- 1:57for the functionality breaking one of
- 1:59the main things so what we did we have
- 2:02modularized all functionality into the
- 2:04different mod and we have also
- 2:08modularize and convert separate database
- 2:10for that particular modules and we have
- 2:12created independent microservices of
- 2:15that and we are also facing the main
- 2:19problem for the transaction Rel so micro
- 2:22services so we have also overcome that
- 2:25uh tolerance using the using the
- 2:31uh Saga design pattern as you know that
- 2:33Saga design so can you give a brief on
- 2:36this Saga design pattern yeah definitely
- 2:39so Saga design pattern is work on the
- 2:43two two features we can say
- 2:45orchestration orchestration and there is
- 2:49another one but we have used
- 2:50orchestration so Saga is doing what so
- 2:54for example two microservices
- 2:56communicating between two each other and
- 2:58one trans is dependent in second
- 3:01microservices MH first micros service a
- 3:04transaction is committed but uh B
- 3:07transaction was going to fail so we
- 3:09obviously need to roll back the
- 3:11transaction from the a microservices but
- 3:14uh that transaction is already committed
- 3:16and we don't know that the transition is
- 3:17fair so what we have implemented we have
- 3:20implemented Saga design pattern so when
- 3:22the first transition is completed then
- 3:24it will shot the message M we have we
- 3:29have configur One messaging service
- 3:32cap so that are going to send the
- 3:34message into the capka and if that
- 3:39transaction micro service B transaction
- 3:41is failed it will going to send fallback
- 3:44message to the uh that messaging service
- 3:47and micros service a will be received
- 3:49that message and that transaction will
- 3:51be R back so we have overcome that
- 3:53something like that okay in a real time
- 3:56example we can say that we can take an
- 3:59example of application z m so they are
- 4:03working something like that okay order
- 4:06is completed but it is not
- 4:09deliverable to be so it will
- 4:12be okay okay nice so uh in
- 4:18microservices uh architecture uh what's
- 4:21the difference between fall tolerance
- 4:22and
- 4:23resilience yeah for for resilience we
- 4:27have used resilience 4G for the circuit
- 4:29Breakers to imp the circuit breakers for
- 4:33example if any micros service or any
- 4:36server call is getting failed so and
- 4:39client will be not effect of that
- 4:41service failure so what we have
- 4:43implemented we have implemented circuit
- 4:45breaker to overcome that challenges and
- 4:48we have return D response to that M that
- 4:50end users for that we have implemented
- 4:53circuit breakers and circuit breaker is
- 4:55working for the three steps first steps
- 4:58is close second is half open and third
- 5:01one is fully open so we have implemented
- 5:04in between some intervals so if that
- 5:07call is falling for the three times four
- 5:09times continuously failing then it will
- 5:12be for the half open then fully open at
- 5:17the end okay so that for that we have
- 5:20implemented and using the yeah at
- 5:24circuit breaker annotations we have
- 5:26implemented fall back me and using the
- 5:28fallback method we have Returns the dumy
- 5:31response to the end client so NES I
- 5:34would like to share one important thing
- 5:36with you actually we had launched
- 5:37complete interview preparation material
- 5:39structur step by step by myself experts
- 5:41and mnc's interviewers and the best part
- 5:44is that now no one need to go anywhere
- 5:45else to prepare interviews there's a 99%
- 5:48chance that interviewers will ask
- 5:50questions from this material so
- 5:52basically it contain a lot of material
- 5:53categorized by experience level means
- 5:55each experience level has different
- 5:57material with all possible interview
- 5:59question question and answers for Java
- 6:00spring framework may1 Gate Spring boot
- 6:02Spring Security spring data jpa cka
- 6:05microservices Java coding questions
- 6:06stream APA coding questions and many
- 6:08more I have provided the link to get
- 6:10this in the below description and if
- 6:11someone need this material plus two real
- 6:14client Enterprise projects for reference
- 6:16plus one-on-one lifetime doubt sessions
- 6:19and referrals to the big mnc's then they
- 6:21should check the interview preparation
- 6:22kit I will provide the link for this as
- 6:24well in the description below so now
- 6:26moving to our interview okay so uh M
- 6:30what happens in your application if the
- 6:32database is down or
- 6:34unavailable
- 6:38okay uh database down or unavailable you
- 6:42yeah yeah database is not available or
- 6:45uh databas is down so that code
- 6:48operation will be getting fails and in
- 6:51that case we if we have implemented that
- 6:54circuit then the D response we can send
- 6:57to the response in that case
- 7:00okay the trans full transaction will be
- 7:03getting filed and we can we have also
- 7:06implemented fure queue in capka so
- 7:10whatever transation is going getting F
- 7:12then it will be that message will be
- 7:14goes into that particular queue and we
- 7:17know that that database is goes down so
- 7:20when this this is getting up then then
- 7:23that transaction will be initiated from
- 7:25that kka and that transaction will be
- 7:27completed so we have implemented
- 7:29something
- 7:34is okay okay so imagine a critical
- 7:38service in your application fails
- 7:40because it it cannot connect to the
- 7:41database so how would you ensure that
- 7:44the rest of your applications remains
- 7:46functional like what are the uh there
- 7:50might have multiple solutions for this
- 7:52uh just highlight the solutions only uh
- 7:56what so spring using the spring actuator
- 7:58we can know that all
- 8:00is getting this healthy or not right
- 8:02that is the one way and we have also
- 8:04implemented the internal console key so
- 8:07all the application host is hosted into
- 8:09that console and using the console
- 8:12console monitor we can find out that all
- 8:14application instance is getting up or
- 8:16not
- 8:18so yeah yeah got it do you know the
- 8:21difference between optimistic and uh
- 8:23pessimistic
- 8:25locking uh no not much okay optimistic
- 8:29locking I can give you a brief suppose
- 8:32one transaction is going to commit into
- 8:33the database and the same time same
- 8:36rules is going to update using the
- 8:39different transaction but that first
- 8:41first transaction is not completed then
- 8:42it at that time optimistic loocking
- 8:44exception is happening from the database
- 8:47M missing is one row is simultaneously
- 8:51committed or updating using the two
- 8:53transaction but first transaction is not
- 8:56committed MH before committing first
- 8:59transaction second second transaction is
- 9:00going to update that particular Ro so so
- 9:03it won't affect the others yeah
- 9:06something like that okay okay yeah and
- 9:09uh pessimistic
- 9:12locking I I don't know
- 9:15yeah so basically this it locks
- 9:18resources at the start of the
- 9:20transaction and preventing other
- 9:21transaction from modifying the locked
- 9:23resources until the first transaction
- 9:25completes yeah so we we can we can know
- 9:29we can we have also implemented that
- 9:31line for using the Hazel cast locking so
- 9:34what Hazel cast Hazel cast will uh stop
- 9:38second transaction Hast will lock that
- 9:40particular transaction or particular
- 9:43blocks to enter second transaction into
- 9:46that particular we have implemented like
- 9:49nice
- 9:50nice okay okay uh okay
- 9:55so as you said uh you are aware about
- 9:58optim istic locking so can you provide a
- 10:01real world scenario where optimistic
- 10:03locking would
- 10:05fail might
- 10:09[Music]
- 10:14fail I give a real world scenario see
- 10:19uh using the same transaction uh same
- 10:22process will be happen
- 10:25or if you're using the multi- trading in
- 10:28for updating any data into the database
- 10:31if First Trade will be not committed and
- 10:35will be executed to execute same thing
- 10:37then it will be happened but for the
- 10:39real time example it will know that real
- 10:42time can be uh like in where multiple
- 10:45users are attempting to book the last
- 10:47seat on
- 10:49flight uh and simultaneously uh so
- 10:52optimistic locking could fail when the
- 10:54last update overr rights a previous one
- 10:57yeah but uh uh we if if you know that if
- 11:01you're going to book any seats then it
- 11:02will be locked for the particular time
- 11:04so second user may not going to attempt
- 11:06that seat we have locked that particular
- 11:09sits for that particular user for
- 11:11sometime so it will be not maybe real
- 11:13time example but that passive ptic
- 11:16accept locking will be not implemented
- 11:19then it will be happen for the
- 11:21optimistics yeah yeah that is the real
- 11:24time you can say that
- 11:27uh so
- 11:30account no I I need to yeah it's
- 11:35fine okay okay so nsh uh can you tell me
- 11:39what are the best strategies for
- 11:41generating IDs uh in the database with
- 11:45GPA uh yeah string data jpa we have used
- 11:50that is the best way and we have also
- 11:53used the jdbc connection for the Bic for
- 11:55the monolithic application we have used
- 11:58jdbc
- 12:01okay okay so suppose you are designing a
- 12:05high traffic application which ID
- 12:07generation strategy would you prefer and
- 12:12why for the high Tropic ID
- 12:15[Music]
- 12:18generation strategy so in Spring data
- 12:21jpa there is a thing sequence generator
- 12:25sequence generator yes yeah yeah so this
- 12:27is uh one of the way actually to
- 12:29generate uh the IDS IDs means uh common
- 12:34ID unique ID unique ID yes yeah yeah
- 12:37yeah okay yeah this is actually way so
- 12:40have you heard about uu IDs U ID so
- 12:43what's the difference between uu IDs and
- 12:45sequential IDs so uu ID contains
- 12:49[Music]
- 12:51some characters and strings and uu ID
- 12:54contains some characters and it will be
- 12:56a part of the two or three parts I maybe
- 12:59and sequence is all contains only
- 13:01integers value okay that is
- 13:05difference okay so can you tell me how U
- 13:09IDs impact database
- 13:13performance uh so tell me can uu IDs can
- 13:18uh lead to index
- 13:19fragmentation yeah definitely because it
- 13:22contains large number of string so
- 13:25database database need uh database can
- 13:27have a trouble to of uh sting or finding
- 13:30the uni unique numbers of that ID yeah
- 13:34so it may contain a performance issue
- 13:36right and uh sequence ID contains only
- 13:39integer numbers so it is faster than
- 13:43faster than
- 13:45ID okay so what the mitigation
- 13:47strategies could you apply to solve this
- 13:50index fragmentation for the index in my
- 13:53project we have only used the not use
- 13:55the CU ID we have used the sequences ID
- 13:58sequence yeah and we have uh for the
- 14:00performance we have implemented uh index
- 14:03and something for that into the
- 14:05particular tables okay let's say someone
- 14:07want to use uu IDs and so then how can
- 14:12someone I mean mitigate this uh in index
- 14:20[Music]
- 14:22fragmentation we yeah for the indexing
- 14:25purpose I think we haven't used the uid
- 14:28but MH yeah in Aro we have used ID for
- 14:32the indexing purpose okay how that I
- 14:36don't know yeah it's
- 14:38fine uh okay so uh if an API Gateway
- 14:43goes down so how would you identify and
- 14:45resolve the issue
- 14:51uh API gway goes down yes yes yeah as I
- 14:56saw that using the spring accor we can
- 14:58say that any API is goinging to down or
- 15:01or API Gateway goes down then we can
- 15:04find that 4 not4 or something like get
- 15:08and we we can Implement one uh Monitor
- 15:13and in monitor we can also find that
- 15:15that API is going to down so uh
- 15:18automatically that API will can going to
- 15:22start up
- 15:23or okay okay
- 15:26so uh did you you face any uh this issue
- 15:32like API failed issue during your
- 15:37career uh so many
- 15:40times are facing so many times okay
- 15:46since last two to three years we are
- 15:47going to develop from we are working on
- 15:50micros service and we have that micros
- 15:52service into the production environment
- 15:55and something like that so in that case
- 15:58we have uh Dockers and
- 16:01kubernetes for deployment and something
- 16:04like that so that all the microservices
- 16:07is managing by that as
- 16:10well okay okay all
- 16:12right okay so moving
- 16:16ahead uh in Java why does the static
- 16:20block execute before the main
- 16:25method static blocks executed before
- 16:29yeah
- 16:35yeah yeah yeah it's fine fine uh okay so
- 16:40uh do you know about system.exit in Java
- 16:43system.exit Yes Yes program will be
- 16:46terminated
- 16:48system okay so do you know what happens
- 16:51uh internally when system. exit is
- 16:55called uh program terminated and your
- 16:58server
- 16:59goes down M okay
- 17:02but
- 17:06onee uh fine fine what is a h collision
- 17:11and how it handled
- 17:13internally so hash Collision means uh
- 17:17hasing it is one of the hasing mechanism
- 17:20so hash code and equal method will be
- 17:24used using the into the H code so when
- 17:27we are using the has map when we are
- 17:30using map then ashod method will be
- 17:34uh call and it will convert that
- 17:37particular Keys into the hash code and
- 17:39uh it will put into the particular pool
- 17:44and and call the and when another times
- 17:47map. put method will be called then it
- 17:49will be convert T key into the has hash
- 17:52code and equals method will be called so
- 17:56it will check that both keys are same or
- 18:00not
- 18:02so po something like
- 18:06that okay
- 18:09okay do you know about proxy design
- 18:12pattern which proxy design
- 18:16pattern no okay okay so basically this
- 18:21pattern involves using a serate or
- 18:23placeholder object to control access to
- 18:25another
- 18:26object basically used to enhance
- 18:28security lazy initialization logging
- 18:31something like that yeah
- 18:33yeah okay okay so what happens if an
- 18:37exception is thrown by the main
- 18:41thread using the main thread yeah
- 18:45yeah so we are getting the any
- 18:48exceptions
- 18:52uhuh okay okay so uh do you know about
- 18:57uncaught exceptions
- 19:02you mean to say a compile time exception
- 19:04and time exception yeah yeah yeah yeah
- 19:08okay so can you tell me how you guys are
- 19:10uh maintaining or handling the exception
- 19:14things yeah so generally uh in a simple
- 19:18Java application we can handle using try
- 19:21and Cat block okay so using the try and
- 19:24catch block we can catch the particular
- 19:26exception MH and we can throw our P
- 19:29exceptions for example my application
- 19:32will be for the accounting and it will
- 19:36be IL legal argument exception we are
- 19:38thr so we can c that exception using the
- 19:40catch block and we can we can uh throw
- 19:45we can Define client that you are
- 19:47passing the wrong argument for
- 19:49the and in the springb micros service we
- 19:52have used the controller advisor for the
- 19:56uh same way we can ask
- 19:59catch and try and catch block but for
- 20:01the sending the user defend except
- 20:03exception we have used the controller
- 20:05adviser and controller advisor we have
- 20:10uh cat that particular exception and we
- 20:12can throw Uh custom status code and
- 20:15custom message
- 20:18M and also we have used expect aspect
- 20:23for oriented programing okay so uh there
- 20:27is annotation at the rate before so
- 20:32sorry at the rate after so in that
- 20:34method we can Define In from which
- 20:36method you you want to throw the
- 20:39exception and uh every every exception
- 20:43throws that method will be called and we
- 20:45can uh throw the ex we can handle
- 20:47something like okay
- 20:49okay okay so moving ahead
- 20:53uh so in uh in a springbot application
- 20:57uh you see there is a run
- 21:01method uh right uh so can you explain
- 21:05that run
- 21:07method
- 21:08uh I can explain not in but we can say
- 21:12that when springboard application run
- 21:15method will be called and all the uh
- 21:18string boot component will be uh instant
- 21:22instant which we haveed using the
- 21:25service atate component or uh at theate
- 21:30repository so all that classes will be
- 21:33instant and uh that variable or that
- 21:36class level variables or method static
- 21:39method will be instituted at that
- 21:42time that is I know and uh at
- 21:47application Level we
- 21:49can we can
- 21:51also Define that which class you want to
- 21:54exclude that excl exclusion strategy
- 21:58that
- 21:59start startup CL application startup
- 22:02class before
- 22:04the correct
- 22:06correct okay so moving ahead
- 22:10uh have you implemented all o
- 22:14to O2 in your
- 22:17application O2 yes we have implemented
- 22:21okay so what challenges did you face
- 22:22during its
- 22:25implementation
- 22:26implemented in simple or to there will
- 22:29be barrier token using that barrier
- 22:32token uh we have used it we have we have
- 22:38not implemented rather than we have
- 22:41implemented and our custom S ID system M
- 22:46okay okay all
- 22:48right uh what are the best coding
- 22:51principles and practices you have
- 22:53applied in your
- 22:56project so uh for the Bas coding so we
- 23:01first of all we we are always use the
- 23:04oops concept we have always try to reuse
- 23:08the existing codes MH and uh we are
- 23:12always point for the performance M we in
- 23:17my company we have defined that every
- 23:19every API should be return within one
- 23:21second so that that is the
- 23:23major we need to identify then uh uh
- 23:29any any warnings in a Cod should be not
- 23:32there we have for we have us the sonar
- 23:35Cube M finding the warnings and
- 23:40for method execution or method
- 23:43performance we have implemented unit
- 23:45test cases M that is the one main thing
- 23:48and we have also implemented automation
- 23:50testing for particular API testing and
- 23:55something are you guys following solid
- 23:57principles
- 23:59uh we can say yeah we Sol okay
- 24:03okay can you give me an example like
- 24:06anywhere you have you have applied the
- 24:08solid principle any principle in your
- 24:11piece of
- 24:17code let's go
- 24:19substitution simple object let's go
- 24:22substition inversion of control V in
- 24:26Implement interface segregation we have
- 24:29used in my application
- 24:32so uh in my application that as I so
- 24:35that we have
- 24:36implemented different different
- 24:38functionality into the different
- 24:40different module so we have created one
- 24:43root jar Ro Library so which contains
- 24:48all the main interfaces and something
- 24:50like that we have implemented we have
- 24:52use that Library into the different
- 24:53different
- 24:55modules different micros service and we
- 24:58mented that interfaces so that interface
- 25:01agregation we have used and let for
- 25:05substitution and one module should not
- 25:07be dependent
- 25:09on uh lower level higher level module
- 25:12should be not dep on that will be will
- 25:15be we have also implemented so okay
- 25:19okay how do you measure code
- 25:23quality uh for the code quality we are
- 25:26using the sonar Cube okay
- 25:28and yeah and we are we are we are going
- 25:31to raise the PO request inet so every
- 25:35single person has to review and also has
- 25:37to review by the developers so that
- 25:40developers can understand that what we
- 25:43have
- 25:44developed so that is the main thing for
- 25:47the compilation or Warnings to resolve
- 25:50it and for the breaking and something
- 25:54like that we have as as I told that unit
- 25:56test cases and Auto
- 25:59MH okay
- 26:02okay okay so
- 26:06MH uh as you said uh you recently
- 26:11migrating monolitic architecture to
- 26:13microservice F uh can you tell me a
- 26:16situation where adopting a microservice
- 26:19architecture might not be ideal
- 26:27[Music]
- 26:36yeah in some cases
- 26:41uh uh when yeah we have used the
- 26:44monolithic
- 26:45so we don't need more teams to manage
- 26:50that developers should be limited M so
- 26:54that is the main uh reason that is the
- 26:56main benefits into the monolithic mhm so
- 27:00that we can say that it's for the
- 27:02costing purposes of that for the compe m
- 27:05so in a monolithic everything should be
- 27:08in a one uh one one code one services so
- 27:14maintaining and managing is easy for
- 27:16that MH so that will be not t of steam
- 27:20so that is and when we are going to
- 27:22migrate it so there would be a different
- 27:25different microservices so every modules
- 27:28so we have a different team so that is
- 27:31the uh and managing it's very harder
- 27:35very very difficulties so we can at that
- 27:40time we feel that adopting micros servic
- 27:42is such a big big issue or not a good
- 27:45solution but uh uh at the end we found
- 27:50that if we have a good team and we have
- 27:52a good knowledge M then we can manage it
- 27:55easily but uh MH
- 27:58fall fall tolerance is very less if
- 28:00you're using the microservices in a
- 28:02monolithic what happen if you want to
- 28:04make any changes or you want to add any
- 28:07functionality so we need to take care
- 28:09that another functionality will be going
- 28:11to break or not and in a micros service
- 28:14that there is
- 28:16only single micros service for the
- 28:18particular model so we we can easily
- 28:22make changes into that particular
- 28:24service so that is the good things so
- 28:27both both proing cons for the minor EIC
- 28:30and
- 28:31microservices okay okay nice
- 28:34nice okay so NES uh are you comfortable
- 28:38in indexes of uh
- 28:42squ uh see uh there is I would like to
- 28:46be a Frank that would be a database
- 28:48developers in my team oh okay so they
- 28:51are managing the all the SPs and TBL
- 28:55index but I know how to create index and
- 28:59uh how to use and how the execution plan
- 29:02is executed inside the SQL so I have
- 29:06also knowledge about that okay so like
- 29:08do you know uh if you uh if we have a
- 29:12frequently updated table which type of
- 29:14index would you would we would should I
- 29:17mean we should use and why see there is
- 29:19a table index and column index should be
- 29:22there mhm as I noted uh using the table
- 29:26index if you creating in table index so
- 29:29when we are going to going to fire any
- 29:32query then in know SQL in the memory
- 29:36they are going to create index for that
- 29:38particular tables so when second time
- 29:40that same query will be executed then it
- 29:42will be use that
- 29:44tables in simple way we can say that it
- 29:47is working something like the caching
- 29:50mechanism if you know that for the
- 29:53casing casing mechanism we are not going
- 29:55to directly call to the database mhm
- 29:58between the API and server we can
- 30:00implement the one case casing so when
- 30:03first time user call then it directly
- 30:05call database and from getting a data it
- 30:07will store into the M base or M cach and
- 30:10when second time same query will be
- 30:12executed then it will be going to take a
- 30:14data from the M case same thing indexes
- 30:17is working like that so it will be
- 30:19become a faster for execution of any
- 30:22query that would be a table index and
- 30:26uh column index
- 30:28that I haven't tried to execute it okay
- 30:32okay yeah it's fine have you heard about
- 30:36balanced
- 30:37index no okay that's fine uh moving
- 30:42ahead do you know about circular
- 30:45dependency
- 30:47yeah go ahead yeah suppose if you are
- 30:51going to use any uh dependency and that
- 30:55dependency internally going to use that
- 30:58C dependency so it will be called a
- 31:00circular dependency for example there is
- 31:03a library one Library a it dependent on
- 31:07Library b Library b is dependent on
- 31:09Library C but internally Library C may
- 31:13be used the class of Library a so in
- 31:16that case it is a circular dependency we
- 31:19can say that
- 31:22okay
- 31:25okay moving ahead
- 31:33so why why are unit test cases important
- 31:36and uh what's a code coverage in your
- 31:39application and what is what is a
- 31:42standard percentage for the code
- 31:45coverage Yeah so basically standard
- 31:48percentage is 85 percentage okay of code
- 31:51coverage in standard but we are allowing
- 31:54developers to cover code into till 90
- 31:56percentage okay because we are going to
- 31:59ask developer to also write the unit
- 32:01test case for the excep and block Cas
- 32:04also and we are also going to ask them
- 32:06for the finally blocks will Al execute
- 32:10but we are so 90% should be uh
- 32:14compulsory but 85 percentage is fine so
- 32:17minimum is 85% minimum is and yeah why
- 32:20micro why unit this is important so the
- 32:23basic is that suppose if we we uh we we
- 32:27have mented one method and we have
- 32:30writing the unit T case for that right
- 32:33so when another developer is going to
- 32:35make any changes into that methods so uh
- 32:38they know that that functionality is
- 32:40already work before into that using that
- 32:43unit T cases so we are going to add then
- 32:47both the functionality that their
- 32:49implementation and previous Implement
- 32:50should be work so if they are adding
- 32:53then if unit will be failed then we know
- 32:56that that functionality is going to to
- 32:58break so is also important and it is
- 33:01also testing the behavior of methods
- 33:07m not actually functional testing but
- 33:09behaviors of method behaviors of methods
- 33:12business logic we can
- 33:15say Okay correct so nsh uh are you
- 33:19comfortable in
- 33:21writing coding by using uh stream API
- 33:25Java yeah I have uh I little bit know
- 33:28that
- 33:29Java okay so will you be able to write a
- 33:33code uh for uh I mean to merge two
- 33:37unsorted arrays into a single sorted
- 33:40array unsorted let's say you are given
- 33:43two unsorted arrays and you have to
- 33:45merge these uh unsorted arrays and
- 33:51output should be a single sorted array
- 33:53after merging these two unsorted array
- 34:04for example there is no requires for the
- 34:06stream so we can use right directly
- 34:08raing the simple Java there is two
- 34:11unsorted array and we
- 34:13can we can take a third array M third
- 34:17array and we can add to this two add all
- 34:20using the add all we can add the both
- 34:22two array into that third array and
- 34:24using the simple collection do sort we
- 34:26can sort that into the one so
- 34:30stream as I think so no no it's fine uh
- 34:34we can do without stream API as well but
- 34:36I just want to know like what would be
- 34:38your approach if uh you will solve
- 34:41through if if the constraint is only
- 34:43stream API
- 34:46ja yeah stream. collect inside of
- 34:49stream. collect that is you can try by
- 34:52sharing your screen and
- 34:54open Andor
- 35:00yes list
- 35:04of right
- 35:07yeah take list of
- 35:11integers and put array like in first
- 35:14array like array one take a r
- 35:20R1 you can take value 32 1
- 35:28and uh initialize second array and with
- 35:32the same instead of
- 35:46654 now merge these two array and uh add
- 35:50all the values uh in Array three and
- 35:54that should be sorted but
- 35:57I'm not sure but I can
- 36:22try uh can we use uh in stream.com
- 36:28conat stream. conet in
- 36:32in uh
- 36:34stream.
- 36:37conat caps I then n
- 36:43[Music]
- 36:47stream yeah then we can put uh two
- 36:50arrays
- 36:52[Music]
- 36:58stream
- 37:00stream yeah but before that we have to
- 37:02convert that arror into the
- 37:04stream AR stream something like
- 37:08[Music]
- 37:15[Music]
- 37:18that yeah okay so yeah nsh let's do uh I
- 37:22mean the way you are telling without
- 37:24using a stream API uh
- 37:33[Laughter]
- 37:50[Music]
- 38:01[Laughter]
About this transcript
This page contains the full transcript of Java Spring Boot 11 Years Interview Experience by GenZ Career, generated from the public captions YouTube serves with the video. The transcript has 4,763 words across 744 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.