Microservices interview question and answers | Architecture design and Best practices
Vložit
- čas přidán 24. 05. 2019
- This Microservices Interview Questions and Answers video will help you to prepare for the Microservices Interviews.
Below are the topics cover in this micro-services interview question and answers tutorial:
1) Basic Microservices Interview Questions
2) Microservices Architecture Interview Questions
3) Migration of monolithic application to microservices
4) Communication between micro-services
5) Continuous Deployment Interview Questions
6) Technologies used in Microservices
7) Microservices best practices
8) Drawbacks of microservices
----------------------------------------
⚙️Gears used⚙️
DJI Osmo Mobile 3 Handheld Smartphone Gimbal (Grey) : amzn.to/3bzeIZo
Boya BYM1 Omnidirectional Lavalier Condenser Microphone with 20ft Audio Cable (Black) : amzn.to/2DCUm4U
Canon EOS 200D II 24.1MP Digital SLR Camera + EF-S 18-55mm f4 is STM Lens (Black) : amzn.to/3buyx3T
Samsung Galaxy S20 (Cosmic Gray, 8GB RAM, 128GB Storage) with No Cost EMI/Additional Exchange Offers : amzn.to/3bssa12
Benro T880EX Digital Tripod Kit : amzn.to/3bzGzsb
Dell Inspiron 7570 15.6-inch UHD 4K with Touch Laptop--Intel Core i7 8th Gen || 16 GB || 512 GB SSD || Windows 10 Home with Office || 4 GB NVIDIA || Platinum Silver : amzn.to/3lVD9EU
Logitech MK345 Wireless Combo - Full-Sized Keyboard with Palm Rest and Comfortable Right-Handed Mouse : amzn.to/3bD13Aw
------------------------------------------------
Follow me on:
►CZcams : bit.ly/2W1X7zz
►Facebook : / e.codespace
►LinkedIn : / gourabpaul
►Twitter : / gourab_p
-----------------------------------------------
#Microservices #MicroservicesInterviewQuestions - Věda a technologie
Micro Services Interview Questions
01. so tell me what do you understand by microservices?
Ans: microservice basically decoupling of entire application into small small services. like if I take an example of Amazon or Uber or like you can say any application. so like take example of Amazon okay so in Amazon we'll have like many partners like seller then we will have buyers and at the end we'll have like persons from Amazon who will be managing all the applications or like we'll be seeing the transactions and every other details so we will mention it as an admin so this is an entire application say suppose it is written in Java so what happen is like if I need to change something like in buyer I need to change a small like I want to give an offer of 5% so what I need to do I need to write the code and deploy the entire application so instead of this we can use microservice based architecture where the seller will be a single application buyer will be another application and the admin would be another application so here what happen is like if the admin is down or like if the server is down the entire Amazon website is down so but in this case if admin is down people can use the buyer option or like if the seller is down seller will not be able to add any further items to his store but the buyer can able to check out from his cart and or you can add anything from other sellers or which are already in the stores and if suppose I want to change something in seller and want to deploy, so will just go and deploy this application and the seller what happened is like it may be written in Java it may be written in .net it may be written in node.js so you.
02. so you said that it is a decoupled architecture so coming to that can you explain what are the major differences between service-oriented architecture or monolithic application and a micro service?
Ans: so what happen is like as I already told that in service-oriented architecture or monolithic application is the entire application so the application monolithic application is the whole block of application service layer or SOA service-oriented architecture is like we define small small module but inside the same application only so we make it modular wise like we take the part of if you take the example of Java we created packages we create interface for particularly for DAO a particularly for seller particularly for customer and particularly for admin and in micro service what we have is like we'll have more granular level of breakdowns like in seller also we can have different types of sellers like from us we can have the part for us only which will be running on any servers on us or we can have clients of any other applications who will be interacting with or auth layer for particularly sellers and auth layer for particularly admin 2 different applications we can have so all these are completely segregated and talked to each other in like over an HTTP and not throw the application himself so if I draw an example like monolithic SOA and if I take the example of micro service I can say like microservice and there can be N number of microservices okay now I will give you
03. two scenarios first design a simple micro service architecture application and the second scenario is migrate the existing monolithic application to microservices and what will be your means approach or whatever your thought process to break down those into small small micro services like you took example of Amazon right so you can just show how Amazon can or if you are owner of Amazon that particulars software so how you would have broken it into small small micro services so how I design a micro service is like if it is a new application
Ans: as you already told since it is a new application so I'll just take the requirements so I will ask like who are the users what are the existing schema how the relationships are mapped like like what are the dependencies like I can have like buyers and sellers so both are actually correlated we can't segregate it out completely so the database, how will manage the databases and all so if I take example of buyer and seller only so buyer will have its own name ID and like items so we have three tables and seller will have like cart details and items brought so these means different tables so this item and this item is related so it is like it can't be like I have brought here like a pan and the buyer doesn't sell a pen or any of the buyers doesn't sell any pen so it it is related so how it interact is like I will call this and suppose he brought already one item or added it so it it will get deleted from here and it will be added here so this is how but these things are completely independent these and these are completely independent so we can keep it out and build two microservices micro-service one and microservices yeah this is how means generally we define micro-services for if I am going for a new application and say it is database and this is database and how we will break a micro surface actually this is a long term process it doesn't work so quickly or so nicely so what we can do is like in monolithic application there we need to change the existing application also side by side and there are micro services so suppose we have buyer-seller and we want to take this out and make it as a micro service so what we can do is like instead of buyer calling this we need to have like a mechanism to call an API so admin will also be there residing and API for admin also and it will point to this micro service so we'll build this micro service we'll take this part this is business logic from here and put it here and once it is done then we'll just point it out instead of calling this we will now call this and instead of calling this we will now call this so this is how we break down so we need to take care of similarly the table structure I mean the schema and we need to means slowly and gradually we need to take these and map so it's like a long term process
04. while breaking those micro services what so it's like a long term process so while breaking the micro services what are the advantages you have and what are the drawbacks while using all this micro service based architecture
Ans: so the main advantages of micro service is like earlier I told that we will deploy okay so how will define is like a we have buyer then we have seller and we have admin so like Independently we can deploy independently we can make the code change so it's fault tolerant like if it goes down it will be up it will be up then what else one more thing is like we can expand it like we can scale it so like independently we can have entire admin then admin and we can have a load balancer to navigate the traffic and one more thing is like as its mainly practiced by Netflix so like an individual contributor or an individual developer will take like the requirement then he will deploy he will make the code changes then he will deploy it in like cloud or any server independently so he takes a complete responsibility smaller tasks and more thing and one more thing is like it can be written in Java it can be written in node.js so there is no like dependence on any particular technology so anyone can use any technology this is the main criteria so the main problem is like we can have multiple layers of authentication like micro service one is talking to micro service to micro service 3 then it is talking to individually they are talking with each other then micro service 4 the micro service 5 and suppose like so first of all we need to have individual deployment strategy for each one and suppose if something goes failed here so we need to find out we need to find the root cause or why it got failed so we need to debug all the stages here and why it got failed you need to check and on the top of that we need to have multiple layers of authentications, so for micro service 3 it may able to access few of the applications or few of the API so this one will give like auth this one may have authorization type 2 so here we need to implement multiple types of authorization means like for each one individual applications we need to give multiple layers of authentication or authorizations
05. so you have hierarchical of micro services like micro service one and micro service 2 is talking to micro service 3 suppose which is an auth layer and the micro service 3 is talking to some other micro services like 4 and 5 respectively so if something goes wrong like in micro service layer third or layer 4 something went wrong so how you will know that that micro Service is failing and you need to debug that micro service application logs?
Ans: so to answer your question suppose I have multiple layers of micro services so what we can do is like we can traffic all the logs to Splunk or Kibana or we can say elasticsearch and for each request we can generate a correlation ID so this correlation ID would be passed through each of the headers and it will be logged in the Splunk or like elasticsearch and like suppose if anything goes wrong with this request we can later take out that request and see okay how we can process it from the backend so that's how and if something suppose this server went down so we can have a health check to look for all the servers and suppose this went down the health check will return to the Kibana or email notification like that we can have
guys i have converted his all questions and answer into script using google lens so please remember me in your prayers
Thank you for your effort. Keep up the good work
Good job 👍👍 thanks
@@infomahboobali thank you 😊
@@infomahboobali Sure bro :)
The diagrams are really helpful to see the overall concepts quickly.. thank you!
Welcome. My pleasure
Its funny that so many "Egoistic experts" are so triggered when a particular technology is not explained completely. Remember that this is not a tutorial about Microservice. Its just demonstrating a typical technical interview and how one can answer particular questions.
Thanks for your support.
My first video on microservices before an year, now I am software engineer at product based company working full time on designing and implementing microservices everyday. TBH I gave same answer in FAANG interviews too they were impressed too
Glad to know that it helped you to secure a job 😁✌️
99% companies are confused .
Have you heart about SCA ?
Hi yeshwanth, Can you please share the link of that video ?
I really appreciate your efforts, It was so good. Small confusion u took the same example for both SOA and MicroServices. Well said, MicroServices uses smallest possible independent Unit which can be easily modified and deployed. In your example - SOA Buyer module can be further be converted in to Customer-MS1, AddressAndDeliveryAddress-MS2 CommunicationDetails-Normal&ForOrderTracking-MS3 - Here Buyer module can be further divided in to smaller units - Tomorrow if delivery related any extra requirements comes then in that case AddressAndDeliveryAddress-MS2 will get effected and Customer-MS1 will be untouched. I am not sure my example suits in this case or not - I am just adding one more example for better understanding purpose.
Disadvantages of MicroServices not covered-
When it will be difficult to manage
How many maximum number of MS can an product can have, if huge number what are possible challanges, What kind of mechanisms will help to fix dependent issues when you have more and more microServices you have.
Which sectors are not suitable
MicroServices are not suitable for Finance sectors and few other where hudge number of business rules which are interrelated and huge data modifications and data depedndencies.
It is easy pick for CDN, videostream, social media networking related where data is not frequently changing and hence you can bring up more smaller units effortlessly and which becomes easy maintenance and also easy scaling for required ones
Noted
this is awsome way of helping people out there looking to crack Job interviews. Thanks a lot ! !
Welcome. My pleasure
This is really awesome interview discussion, which helps many who are looking to change jobs. Thank you so much for posing excellent video.
Glad it was helpful!
Thanks alot man, your method of explaining via creating diagrams on the go is amazing!
Welcome. My pleasure. Stay safe
Very Good Attempt. This video provides brief explanation of all the details for the Micro-service Architecture and Details. It would be helpful if you can make more videos on Spring, Hibernate, Databases, Restful like technologies too for Experienced levels. All the best. Thank you.
Noted. Java interview questions coming soon. Stay tuned
I got my solution just in 4min of this video, thanks for clean demo.
Welcome
Very helpful for quick interview prep. Thank you
Welcome. My pleasure
Nice attempt .video was simply good.great work .
Thank you
I really appreciate your efforts. Thanks!!
Welcome. My pleasure
I really liked it. Thanks for the video. Interviews are always hard!
My pleasure
All I can say is " Thanks a lot " .
Keep helping us .
Welcome. My pleasure
Really appreciated this video and your dedication. Thank you very much.
My pleasure 😊
Very elaborate and detailed answer to the higher level questions that can be expected.
As commented it would be nice to add other videos for topics at Java and related technologies at the programming level.
As for the video casting the same person in both roles was good too.
Java interview questions are coming soon. Stay tuned
Nice attempt and good work :) Just a word - At around 15 mins of speaking of best practices while developing a product in microservice pattern, you said we can separate out DB for each service. Actually that is the main point of microservice. Not only buisness functionalty is separate so is the data. In case two microserviecs share the same DS, it is more of a SOA pattern. So always each microservice, if they talk to a db should and will have their own DS and we can have MQ to sync data in case it is required and difff transaction mechanism/pattern to manage transaction across DB.
Martin Fowlers first words are each service is not only decoupled at its own business concern but should not share data from a common datascource, data should be passed along each microservice through an Endpoint.
Good luck . :)
Yes that whats microservices should be designed. Decoupled.
@@codespace Dude, What do you mean by Decoupled? So if you have 100 microservices you recommend 100 databases? HOW will you keep the data in sync across these DB? Don't take 1 service 1 DB too seriously, it can only be done for very few services that are totally independent and unique from rest of the application. For rest of the microservices you do not have the option to have independent DB and need to share DB or else you will have to forma new company to manage your databases!
Ravindra Kumar 🙏
Great Bro. Liked it. Understood clear picture as I had many broked pieces about it. You helped me give more clarity in different way. Super.
Welcome
great presentation ,questions and content delivery!
Welcome. My pleasure
Great video and very good explanations, thank you!
This is excellent preparation material for an interview! Congratulations on the video. Thanks!
Welcome
Nice job. Thank you! keep making more.
Welcome. My pleaure
very good, nicely answering all of the questions.
Thank you
thanks a lot! we need such high quality content.
Welcome. My pleasure
Great Job 👍 and well explained. Thank you so much for this video.
My pleasure 😊
Very easy to understand even if person does not have any background On Microservices. Thanks you for sharing it.
Welcome. My pleasure
Sir u r specilly born to motivate people and free from their difficulties and stress...U r inspirational and awesome..
My pleasure
You are awesome . This one video is enough to understand MicroService
Welcome. My pleasure
It's an undoubtedly awesome video. You the Indians are really joss engineers.
🙏
woah dude.... its been just one mint of the vid and i decided to subscribe and applaud... u really did tremendous work over there.... i m totally new to microservices but ur this vid helped me a lot.....
My pleasure 😊
u and your twin brother doing a great job . Thank you :)
Awesome. Thanks a lot. Great video!
My pleasure
Well explained and really helpful to understand concepts...
Welcome. My pleasure
Great ! It takes a lot of efforts to make such kind of video :)
Welcome. My pleasure
What a creatures. Nice articulation. Keep growing. All the best.
Thank you
Good Presentation you have given a overall picture of Micro services
Thank you :)
Total cinema in 20 min ... Awesome.. liked the explanations....
My pleasure 😊
@CodeSpace
In your video you demonstrated that one microservice directly using another microservice. That approach is still monolithic my friend. Microservice calling APIs of another microservice is not how microservices communicate. You didn't mention about service discovery/registry anywhere in the video which is one of the critical piece. Also there is no mention of fault tolerance, that is how to recover when an error occurs
This is one of the approach. There are other approaches using queues.
Nice video, please also add information about asynchronous modes of communication(e.g. a message broker) between microservices as it is a very widely used pattern.
Noted
Thanks for this video. Its really good. Pls keep making such videos.
My pleasure
Excellent explanation. Thank you.
Welcome
great work brother..request you to create similar video on micro services, more technically question answer for eg:- write a code snippet for how security is implemented in micro-service projects
Noted
I need this answer..please share the answer
Great content..... Could you please make video upon the communication between microservice using different messaging technology available in market like rabbitMQ , kafka.. Etc. With the scenarios in which they should be opted.
Noted
Very good and informative video session.
Keep up the good work.
Thank you
Explanation with examples is fantastic
Thank you
its really nice and easy to understand how to explain in proper way ..
Thanks for liking
Amazing ❣️Thanks for this video 🙏 Please bring us more videos like this❤
Sure
Amazing Contents bro very easy explanation and also Good Thought process of Communicate Microservices Architecture Thanks For Help ❤
You are most welcome
This way is really great🔥 Thanks buddy👍
My pleasure 😊
This is fantastic. Really useful to my SDET interviews
Welcome
AweSOME!!
Thank you
Good job.... :)
MS can be used for re-usability also.
Yes. Its called load balancing
Very good explanation. Need to add more information for transaction scope and db separation. How to divide a db to support micro services.. How to maintain a table which is common for multiple apps. for example, An Employee can create a sales order so Employee app and Sales app shares common table called employee.. How to maintain that? If a sales order is created (sales app) but during the credit card charge (accounting app), it is failed so how to rollback sales order? These are the some of the real life questions
Yup, the Q&A in this video are pretty basic. (Don't take it in the wrong way it is still good :) But if we delve in more depth of it there are lot of things (like mentioned by Kaushal above) that will be asked from any experienced developer.
Yes data integrity is not guaranteed all by default. So that's always a challenge, many people solve it in different ways. Also for microservices, if I have to deploy multiple instances and load balance between them, do each instance talk to a single DB or multiple?
1: You maintain a state/flag (say 1 for storing user name, 2 if MS2 return true) in MS1-DB1 and if MS2 (saves mobile and address of a user) fail it will return error code 5XX then either you delete the record from DB1 or keep the flag to 1 and can process from the point where error has occured
2: It will always be stateless and validated using various approach like JWT, openId, oauth
3: Monolithic application has 1 huge database. But best practice for MS is to build with individual DBs but not limited to
@arpan- Under LB/auto scaling group- all instances have same code base so they connect to same DB
Very nice Guarab....If possible please create a series of simplified tutorials focused only on Microservices.
Noted.
Really very well explained.. good help for guys like me. Could you please do similarly on Spring Boot and Angular
Noted
Very helpfull , thanks dude
Really Good one , Thanks for this video
Welcome. My pleasure
very different thought...u done good job..
Thank you
really good and useful thanks for you valuable time for us
Welcome. My pleasure
Thanks for the video. Appreciate!!
One question I was having here is when you say it is stateless then how authentication will be handle from second time( say for instance you are using redis or any cache mechanism for storing sessions) then how same user will be authenticated.
Appreciated if you can please elaborate.
All http requests are stateless. We need to determine by using userid and jwt token
@@codespace adding to point cookies will be utilized for handling sessions. also in return response JWT token would be placed in response header and every request time it will get checked.
very nice and easy way to tell on MS
Awesome work guys. Very interesting answers. Thanks aalot
Glad you enjoyed it!
Great tutorial!
Thanks
Big Thank You!
Welcome
Nice and Simple. Can you explain how the different versions of same ms available to more than one client. Also when should we go for API gateway?. Finally how the CDN gets updated for every deployment?.
I hope you are able to resolve it. If not let me know your query in details. Sorry for delayed response
Thank you for the simple explanation
My pleasure 😊
Great one, Thanks a lot; Kindly make similar video for Data Architect please.
Noted 😊
Simply Awesome.
Thank you
Awesome Bro. Good and clear explanation
My pleasure 😊
I am not very expert in the microservices or anything, but just observed one things fir your first question.. taking example for changing code for giving 5% discount is little wrong in the first place. this 5% should be associated with the product somewhere and store at some configurable place. might be FS or DB. if you means to say whole about discount feature, then you explanation is right.
The real intention is to put forward how microservices and distributed system works. Logically you are correct
Man...you are amazing. 😊
Thanks. My pleasure
Hi Friend,
Video is really cool and make sense for beginners as well as for experience people. You really rocks.
I have one request might be helpful for others as well.
Please list down few resources as well when you make any video. It will help the viewers to get deeper into these concept and try to learn by there own as well.
Sure noted. I will update the description
@@codespace amaze with your prompt response. Thank you
What I listen here for SOA is principle of modular programming that SOA shares, but what is SOA and what differ from Micrsoservices ? SOA is architecture that has separated e indipendent services and decribes what protocols to use for to comunicate each others, this common comunication is the ESB and it is its weakness. The aspect of separate and indipendent services brings SOA closer to microservices but the fundamental difference is that in microservices architecture there is no ESB and therefore the microservice is free to use the most appropriate comunication protocol for the situation.
🙂
can you make interview on full stack development ? Angular , Java with AWS . Spring Framework , devops , AWS Solution Artech
Noted. Keep and eye on the channel. Stay tuned
I want some clarification on Stateless microservice. So what I understand from your explanation is that, when buyer call the API for adding into the cart, it goes to one instance of MS1, so when the buyer want to delete it from the cart, (question starts here) will it go to session and find which instance is having the item and delete it from the particular instance? or how it will do? Please let me know.
By the way I found all the information what I'm searching for. Thanks a lot :) :)
It may or may not land on the same instance. So using jwt token and userid ms need to determine the user and perform the action
If one Microservice is dependent on other like a chain and result will show on 4th microservices ,what happen if one microservices is getting down ,will other 3 microservice will work or not.Please advice
Thanks for such a great video.
Glad you enjoyed it!
Also support us by subscribing to my other channel Oyekool- czcams.com/users/oyekool
Yes it is helpful. Please make videos for .net core, kubernetes etc.
thanks for this video... really appreciate..
My pleasure 😊
Thanks for your videos
My pleasure
Wonderful Explaination.
My pleasure 😊
Would appreciate if you could tell what tool are you using to draw on laptop? The amazon link to buy the same would be great.
Wacom
www.amazon.in/Wacom-DTH-1152-1-inch-Interactive-Display/dp/B079S9R7M3/ref=sr_1_5?keywords=Dth+1152&qid=1574448451&sr=8-5
Such a magnificent way to elucidate the things...Perfect
Do you have a .Net Core Interview question and answers | Architecture design videos/ articles, if so could you please share the details?
Thanks so much for this significant tutorial.
Thanks 😌
Greate video. thank you so much.
Welcome. My pleasure
Awesome. Very useful, please provide more example of microservices.
Noted
Can you please brief on how to perform manual and automated testing [A/B Testing] in micro-services..
Automation testing can be done through apis. And for manual testing you need to rely on postman but its not suggested
really appreciate your video content,i have one question all the micro services have to be using a separate Database instance or can be one database?
Separate
Super bro!!!
Thank you.. Happy new year
great work !! can you please make a video on the java developer interview? it will really helpful.
Few interviews qstn and ans r there. Check the channel page
Really good content!
Thanks
bro spring boot rest template is comes under the micro service or not?
Hey, nice video!!
What was the gear you used for white board writing ?? Wacom?
Yes. Wacom dth 1152
Great work...
Thanks
Nice Interview session with the better clarity..But need more clarity on one of the asked questions that, " HOW MICROSERVICES INTERACT WITH EACH OTHER AND HOW TO RESTRICT FEQ USERS FROM ACCESSSING SOME OF THE MICROSERVICES ?
MS interacts through rest apis and users are restricted through json based web token like jwt and all MS other then webapi MS are kept inside VPN
good set of questions , bro ..!!!
My pleasure 😊
Awesome !!
My pleasure
eye opener
Thank you
Make a video to manage sessions by taking the example of radis-cache and take atleast 2 microservice to explain the scenario.
Noted. Keep an eye. Stay tuned