Solid Design Principle Interview Questions and Answers for fresher and experienced | Code Decode

  Рет қаралды 83,761

Code Decode

Code Decode

Күн бұрын

In this video of Code Decode we have covered Solid Design Principle Interview Questions and Answers for freshers and Experienced
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
openinapp.co/u...
Course Description Video :
yt.openinapp.c...
Solid Principle Interview Questions part 2 : • Solid Principles Inter...
SOLID Principles Covered with live demo. With steps on how to implement these in day to day life.
Why we need solid Principle?
The broad goal of the SOLID principles is to reduce dependencies so that engineers change one area of software without impacting others. Additionally, they’re intended to make designs easier to understand, maintain, and extend. Ultimately, using these design principles makes it easier for software engineers to avoid issues and to build adaptive, effective, and agile software.
they lead to better code for readability, maintainability, design patterns, and testability.
What are solid Principles?
The following five concepts make up our SOLID principles
Single Responsibility
Open/Closed
Liskov Substitution
Interface Segregation
Dependency Inversion
What is Single Responsibility Principle in solid principles?
It states that “One class should have one and only one responsibility”
Which specifically means - we should write, change, and maintain a class only for one purpose.
Change Class only when you need to change state of one particular object or instance
Example : POJOS follow SRP.
Suppose we have Employee and Address Class, If we want to change the state of Employee then we do not need to modify the class Account and vice-versa.
If you world have merged both as single POJO , then modification in one field for address (like state ) needs to modify and Whole POJO including Employee
Worst Design - which don’t follow SRP Hitting Database in POJO of Employee Class. That’s why we have service layer, DAP layer and Entities separated.
Why is Single Responsibility Principle IMP?
In Real world, Requirement changes and so does your code implementation to cater the changing requirement ,
The more responsibilities your class has, the more often you need to change it. To prevent frequent changes to same class,
Testing is easier - With a single responsibility, the class will have fewer test cases
Easier to Understand
Less functionality also means fewer dependencies to other classes.
So best practise says : Use layers in your application and break God classes into smaller classes or modules
What is Open/Closed Principle in solid principles?
It states that “Software components should be open for extension, but closed for modification”
The term “Open for extension” means that we can extend and include extra functionalities in our code without altering or affecting our existing implementation.
The term “Closed for modification” means that after we add the extra functionality, we should not modify the existing implementation.
In real world, You must have noticed that you change something to cater a new requirement and some other functionality breaks because of your change. To prevent that we have this principle in hand. It s one of the most imp concept in in solid principles
How to implement Open/Closed Principle in solid principles?
The application classes should be designed in such a way that whenever fellow developers want to change the flow of control in specific conditions in application, all they need to extend the class and override some functions and that’s it.
Example - created a pojo employee with id , name. now new functionality comes which says add Training location. your constructor will fail for employees who didnt do training. better extend employee class, name it Traineed employee then add constructor.
Code Decode Playlists
Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
Advance Java Interview Questions and Answers : • Advance Java Interview...
Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
Spring Boot Interview Questions and Answers : • Advance Java Interview...
Angular Playlist : • Angular Course Introdu...
GIT : • GIT
Subscriber and Follow Code Decode
Subscriber Code Decode : www.youtube.co...
Linkedin : / codedecodeyoutube
Instagram : / codedecode25
--------------------------------------------------------------------------------------------------------------------------------------
#solidprinciples #javainterviewquestions #codedecode

Пікірлер: 73
@dhareppasasalatti7102
@dhareppasasalatti7102 2 жыл бұрын
Please try to upload the 2nd part of this videos ASAP. This is really helpful for the interviews and thank you so so much for the content. ❤💯💯
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure we will upload it soon....
@abirchaudhary6359
@abirchaudhary6359 2 ай бұрын
Please add cqrs design pattern. I am big fan of your explanations.
@mohdfahimsaad3669
@mohdfahimsaad3669 2 жыл бұрын
Mam really most valueable content which you are providing. And lastly please share the ppt content with us in the form or pdf or whatever you want so that we refer those later as well. Love and support from Indore.......
@sureshkumar-kq1jm
@sureshkumar-kq1jm 2 жыл бұрын
Why can’t we create one more parameterised constructor instead of creating new class for open/close principle?
@ChristForAll-143
@ChristForAll-143 10 ай бұрын
yes we can, but what she explained is also a way
@saithonukunoori412
@saithonukunoori412 7 ай бұрын
See here the principle is our code should not be modified but want to extend functionalities in it so using classes we can enable this principle we can wrap a code in structure,functions,interfaces,abstract classes and classes so on. Which of these concepts make your code actually support the respective principle,hope you got it
@nandkishor_patil_
@nandkishor_patil_ 2 жыл бұрын
Please upload second part of this vedio. It will be really helpful to understand SOLID in easy manner. Thanks 👍
@CodeDecode
@CodeDecode 2 жыл бұрын
kzfaq.info/get/bejne/sNRihtFo0bPSfIE.html Here you go 🙂👍
@KumarGaurav-xDsoCH
@KumarGaurav-xDsoCH 2 жыл бұрын
With your every video lecture, I am getting some clarity that I didn't come to know, although practicing the same for a quality time. Thanks a ton again !! When I saw title this time, I thought it's something irrelevant to me and was about to skip it. But fortunately, I started playing and then it's only you and your voice for next 15:50 minutes 😁😁
@CodeDecode
@CodeDecode 2 жыл бұрын
🙂🙂Glad u found it helpful. Keep learning, keep rocking Man 👍👍
@dpkpk1573
@dpkpk1573 2 жыл бұрын
Thanks for covering this Topic..... Yes please make a continuation on this
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure we will upload soon 👍👍
@Rohit-yo4ik
@Rohit-yo4ik 2 жыл бұрын
Please create remaining part of this soon.... getting better understanding of concepts. Thank you so much
@CodeDecode
@CodeDecode 2 жыл бұрын
Publishing it today 👍👍🙂🙂
@vulligadlarohith5541
@vulligadlarohith5541 2 жыл бұрын
Excellent , thanks again! 👍I was waiting for this topic from Code Decode ✌️
@CodeDecode
@CodeDecode 2 жыл бұрын
Sorry for keeping you waiting. Will upload next part very soon 👍
@HkH103
@HkH103 2 жыл бұрын
Hi madam, your explanation is good with suitable example, plz complete solid principles L,I and D
@CodeDecode
@CodeDecode 2 жыл бұрын
sure we will complete it soon
@VoyageofLittleLiya
@VoyageofLittleLiya Жыл бұрын
This part was clear, well explained. Can you please provide link, if you have already done second part of this? If have not done second 2nd part, can you please do it?
@CodeDecode
@CodeDecode Жыл бұрын
kzfaq.info/get/bejne/sNRihtFo0bPSfIE.html
@suryanarayansubudhi9439
@suryanarayansubudhi9439 2 жыл бұрын
Thank you for making this video. In a recent interview, This question is asked to me.
@CodeDecode
@CodeDecode 2 жыл бұрын
you are welcome suryanarayan
@pulkitkhandelwal1414
@pulkitkhandelwal1414 2 жыл бұрын
Yes please complete all remaining solid principles.
@CodeDecode
@CodeDecode 2 жыл бұрын
sure pulkit we will make it
@rahulshukla7883
@rahulshukla7883 2 жыл бұрын
Good job !! Nice explanation of 2 solid principles for fresher and experience. Please make video for rest 3 . Waiting...
@CodeDecode
@CodeDecode 2 жыл бұрын
sure Rahul we will make it soon....
@dnyaneshwarjadhav102
@dnyaneshwarjadhav102 8 ай бұрын
Very well explained mam. Thanks a lot👍.
@CodeDecode
@CodeDecode 8 ай бұрын
you're welcome
@akhileshyaduwanshi6008
@akhileshyaduwanshi6008 2 жыл бұрын
Thankyou for this video, Please make another video for other three remaining principle.
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure next we will upload that 👍👍
@dynamicdeveloper6658
@dynamicdeveloper6658 2 жыл бұрын
Such a great informative explanations. 👍
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks alot 🙂👍
@gauravjaiswal7923
@gauravjaiswal7923 2 жыл бұрын
Nice explanation...Can you please upload the second part of it. Thank you!!
@CodeDecode
@CodeDecode 2 жыл бұрын
We have it here kzfaq.info/get/bejne/sNRihtFo0bPSfIE.html
@ummarfarooq4160
@ummarfarooq4160 2 жыл бұрын
Ma'am pls make to video on other principles also.. your explanation gives good clarity to the concepts
@CodeDecode
@CodeDecode 2 жыл бұрын
sure ummar we will create it soon
@aa-xe5gq
@aa-xe5gq 2 жыл бұрын
please do the rest three! thanks!
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure, we will upload that next 👍
@bsarvani5845
@bsarvani5845 2 жыл бұрын
Thank you for clear explanation. Please cover other three principles also
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure, we will post it next.
@SharifulIslam-nv7dq
@SharifulIslam-nv7dq 2 жыл бұрын
It will be great, if you can explain the other 3 as well. Thanks.
@CodeDecode
@CodeDecode 2 жыл бұрын
sure shariful we will create it soon
@riyanayak9836
@riyanayak9836 10 ай бұрын
Thanks!
@CodeDecode
@CodeDecode 10 ай бұрын
Thanks Riya 😊
@vengateshm2122
@vengateshm2122 2 жыл бұрын
Thank you please cover the remaining too.
@CodeDecode
@CodeDecode 2 жыл бұрын
sure vengatesh we will make it soon
@manojkumarshirapure107
@manojkumarshirapure107 2 жыл бұрын
Very Helpful !!!!
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks Manoj 🙂👍
@swapnilmishra697
@swapnilmishra697 2 жыл бұрын
Mam what is PoJo I can't understand what we meant by pojo
@CodeDecode
@CodeDecode 2 жыл бұрын
Pojo is plain old java objects, it's same as dto data transfer object,. As name suggests it's a simple java object nothing else 🙂👍
@abhinavpandey3356
@abhinavpandey3356 2 жыл бұрын
In that open closed example what I f we make another constructor with 3 parameters ie instead of separate class
@nagarajjaladi5888
@nagarajjaladi5888 2 жыл бұрын
Good work
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks Nagaraj
@venkatb8317
@venkatb8317 2 жыл бұрын
HI Team,please make video on remaining things
@CodeDecode
@CodeDecode 2 жыл бұрын
Hi Venkat . Please check below link for part 2 kzfaq.info/get/bejne/sNRihtFo0bPSfIE.html
@venkatb8317
@venkatb8317 2 жыл бұрын
@@CodeDecode thanks lot
@APersonOnTheWeb
@APersonOnTheWeb Жыл бұрын
11:30 I have a doubt, Instead of creating another class, why can't we create a new constructor with that address parameter?
@SaketAnandPage
@SaketAnandPage Жыл бұрын
Why not class for EmployeeName in Single Responsibility?
@gopikrishnagurram5780
@gopikrishnagurram5780 6 ай бұрын
It will very hard to create new class fir every field addition. Please help us to understand with service logic.
@divanshugupta4427
@divanshugupta4427 2 жыл бұрын
Waiting for the rest three....
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Divanshu we will upload it next 👍👍
@sravankumar9609
@sravankumar9609 Жыл бұрын
Part 2 please ?
@CodeDecode
@CodeDecode Жыл бұрын
kzfaq.info/get/bejne/sNRihtFo0bPSfIE.html
@sravankumar9609
@sravankumar9609 Жыл бұрын
@@CodeDecode thanks
@CodeDecode
@CodeDecode Жыл бұрын
👍👍
@maankhurana5814
@maankhurana5814 2 ай бұрын
Interviewer asked me this today and I was unable to answer
@amitkale1284
@amitkale1284 2 жыл бұрын
🙏🙏
@CodeDecode
@CodeDecode 2 жыл бұрын
🙂👍
@rakeshs1935
@rakeshs1935 2 жыл бұрын
👌🙏👍
@CodeDecode
@CodeDecode 2 жыл бұрын
🙂👍
@shreya1487
@shreya1487 2 жыл бұрын
Ur cursor is reminding something
@zafariqbal92
@zafariqbal92 2 жыл бұрын
the second log did not print the address 😄
SOLID Design Principles in java with Example | JavaTechie
34:44
Java Techie
Рет қаралды 185 М.
나랑 아빠가 아이스크림 먹을 때
00:15
진영민yeongmin
Рет қаралды 3,7 МЛН
7 Days Stranded In A Cave
17:59
MrBeast
Рет қаралды 96 МЛН
هذه الحلوى قد تقتلني 😱🍬
00:22
Cool Tool SHORTS Arabic
Рет қаралды 54 МЛН
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Рет қаралды 1 МЛН
SOLID  Principal - Interview Questions and Answers
24:04
Interview Happy
Рет қаралды 104 М.
Learn SOLID Principles with CLEAN CODE Examples
28:35
Amigoscode
Рет қаралды 269 М.
10 Coding Principles Explained in 5 Minutes
5:44
ByteByteGo
Рет қаралды 140 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
SOLID Principles: Do You Really Understand Them?
7:04
Alex Hyett
Рет қаралды 163 М.
나랑 아빠가 아이스크림 먹을 때
00:15
진영민yeongmin
Рет қаралды 3,7 МЛН