Top 50 OOPS C# Interview Questions - .NET
Вставка
- Опубліковано 23 лип 2024
- 1. Full .NET Interview Course (with PDF Book)
C# / ASP.NET Core / MVC / API - Top 500 Interview Questions
Coupon code DOTNETOFFERAUG2024 applied in below URL- 80% Off - Limited Time Offer
www.udemy.com/course/csharp-o...
Don't worry if course not helping you, Udemy has 30 days Free Refund Policy.
2. Quick Revision Book (PDF format)
Top 500 .NET Interview Questions - OOPS/ C#/ ASP .NET/ MVC/ SQL /.NET Core /Web API
imojo.in/interviewhappy
50% Off - Limited Time Offer Applied on above link.
Don't worry if book not helping you, I will return 100% of your money with in 7 days of purchase. Just mail me at anuragrawat123@gmail.com.
My best wishes are with you.
This video contains the top 50 interview questions asked in interviews.
00:00 - Introduction
01:16 - Q1. What are the main concepts of OOPS? What are classes and objects?
07:18 - Q2. What is Inheritance? Why Inheritance is important?
10:33 - Q3. What are the different types of Inheritance?
14:38 - Q4. How to prevent a class from being Inherited?
16:22 - Q5. What is Abstraction?
19:30 - Q6. What is Encapsulation?
23:52 - Q7. What is Polymorphism and what are its types?
26:47 - Q8. What is Method Overloading? In how many ways a method can be overloaded?
30:41 - Q9. What is the difference between Overloading and Overriding?
34:45 - Q10. What is the difference between Method Overriding and Method Hiding?
37:37 - Q11. What are the advantages and limitations of OOPS?
41:31 - Q12. What is the difference between an Abstract class and an Interface (atleast 4)?
46:45 - Q13. When to use Interface and when Abstract class?
50:39 - Q14. Why to even create Interfaces?
54:38 - Q15. Do Interface can have a Constructor?
56:17 - Q16. Can you create an instance of an Abstract class or an Interface?
58:54 - Q17. What are Access Specifiers? What is the default access modifier in a class?
03:47 - Q18. What is Boxing and Unboxing?
01:06:35 - Q19. What is the difference between “String” and “StringBuilder”? When to use what?
01:10:12- Q20. What are the basic string operations in C#?
01:12:56- Q21. What are Nullable types?
01:14:42 - Q22. Explain Generics in C#? When and why to use them?
01:20:18 - Q23. How to implement Exception Handling in C#?
01:24:05 - Q24. Can we execute multiple Catch blocks?
01:25:35 - Q25. What is a Finally block and give an example when to use it?
01:27:22 - Q26. Can we have only “Try” block without “Catch” block?
01:28:45 - Q27. What is the difference between “throw ex” and “throw”?
01:33:14 - Q28. What are the Loop types in C#?
01:37.04 - Q29. What is the difference between “continue” and “break” statement?
01:40:52 - Q30. What is the difference between Array and ArrayList (atleast 2)?
01:43:39 - Q31. What is the difference between Arraylist and Hashtable?
01:45:23 - Q32. What are Collections in C# and what are their types?
01:48:49 - Q33. What is IEnumerable in C#?
01:52:15 - Q34. What is the difference between IEnumerable and IEnumerator in C#?
01:55:06 - Q35. What is the difference between IEnumerable and IQueryable in C#? Why to use IQueryable in sql queries?
01:58:30 - Q36. What is the difference between “out” and “ref” parameters?
02:05:06 - Q37. What is the purpose of “params” keyword?
02:07:04 - Q38. What is a Constructor and what are its types?
02:17:59 - Q39. When to use Private constructor?
02:19:27 - Q40. What are Extension Methods in C#? When to use them?
02:24:53 - Q41. What you mean by Delegate? When to use them?
02:29:35 - Q42. What are Multicast Delegates?
02:34:23 - Q43. What are Anonymous Delegates in C#?
02:36:37 - Q44. What are the differences between Events and Delegates?
02:40:28 - Q45. What is “this” keyword in C#? When to use it?
02:44:09 - Q46. What is the purpose of “using” keyword in C#?
02:48:42 - Q47. What is the difference between “is” and “as” operators?
02:52:09 - Q48. What is the difference between “Readonly” and “Constant” variables (atleast 3)?
02:57:35 - Q49. What is “Static” class? When to use it?
03:00:26 - Q50. What is the difference between “var” and “dynamic” in C#?
03:03:17 - Q51. What is Enum keyword used for?
Hi Sir. This question bank helped me a lot to clear more than 5 interviews where I was finding difficulty in clearing one interview, a great salute to you for helping in building someone's career. Will keep supporting you💗🙂
Well done and Congrats Rakesh.... May you keep getting success in your career in future.
Hello rakesh, can you please share you interview experience. and how to get new job. at present i am working with dotnet technology only, but unable to take out preparation time. Can we form any group and discuss there.
Hi sir I cleared first round but I'm getting problem in second round like practical round if u guide about practical round plss it's humble request
@@kiranpyllayes definitely make a group
@@AbhaySingh-lf4oyi am also in. Let's connect Nd form a group
Thank you for your nice tutorial. I am finishing the first hour.
For the moment I have two little notes. I think members of the interface do not have access specifiers and I think I have seen books saying that interfaces can also have property members and events.
I also think that the main reason for boxing and unboxing was to achieve universal data type - object, which could be send as params to any class ctors and methods. Then generics came and send those to the unemployment department.
This is great Man. Very Nice explanation. Every one should go once at least once for quick revision. Salute.💛💛
Thanks Navin, Appreciate you liked it.
@@interviewhappyhow to contact with you?
Perfect...it clears all of my doubt...hats off...keep it up !!
You are so amazing with this question. You teach this concept so easily that no can do that. I understand so many things from you. Thank you sir
. 😀
Thanks for appreciating my friend your words are very kind and means a lot to me. Thank you much @rihamhossain9662
This is a fantastic video and helped me quickly brush-up the concepts. I loved the delegated part. This was by far the simplest explanation of it I have heard of...👏
Great to hear and Thanks @catherine
Thank you so much. very nice explanation with examples. it consolidated everything at single place. so no need to go other place. once again thank you so much.
Thanks Vikram... I appreciate you liked it..
Really best explanation for each every question. Thank you very much your videos. I'm always thankful you 🙏
Thanks Hareesh. All the best if you are preparing for interviews.
i'm preparing for interviews ...by watching your vedios sir... tqq so much these are very helpful..to growup
Thanks Jyothi and all the best for your career.
thanks for your effort that you put togethor all imp questions in one video
Amazing work. Probably the best c# video to date!
Wow, thanks!
IEnumerable Interface should be used for the IN Memory object Collection to fetch the data while IQuerable should be used when you are fetching the from the resources like DbContext , XML etc because if you want the collect the data on filter criteria then IQuerable useful in this case.
Superb interview series of question with explanation.
Hi Happy,
Your videos(Angular,SQL,OOP,.Net Core) was very helpful to me to get the new position.
Thank You♥♥
Great... congrats man.... enjoy the moment. Happy is happy for you.
Thanks a lot! This is really helpful
About encapsulation: you could add an example of errornous direct assign of experience to a negative value and add checks to a setter to show why the property setter is needed. Trivial setter just slows the things.
Yes that is one good example
Great
Thank you for your nice tutorial. An interface can have properties as well.
one of the best ever interview guide for any discipline I came across. Hats off to you sir.
Glad it was helpful @mohamedsilmy5294
Interface can contain not only methods but also properties, events and indexers with signature only.
Very nice explanation sir, thank you for bringing this it will be very helpful during the c# interview.
Thanks Sreeni... Sounds great this helped you
Hi sir ..Can you provide questions for 5+ years experience vb.net and asap.net. Thanks
@@jamunadevi7635 I love vb.net. worked in it a lot. But now a days its not in demand. But soon i will try to make some content for it.
Now I am able to clear the interview after seeing your video.thanks
You are most welcome. All the Best Gopi
Excellent Bro. Well-articulated and examples . Thanks it helps
Glad it was helpful!
such great effort bro.. really appreciate it!! :) those examples were really helpful in relating to use case...! this was awesome man!!
Thanks Vipul, wish you all the best for your career.
Thanks a ton for your effort. You are helping the techies to land their dream jobs.
Thanks Raj. Yes my goal is to help the candidates in their interview process.
great video! keep up with the great work :)
Thank you so much for great explanation!
Your most welcome for appreciating @noranora847
Very nice explanation..thank you so much sir🙏
wc Meenu and all the best for your career.
Excellent video. Thank you sir.
Glad it was helpful!
Thank you sir for providing with this valuable resource)
It's very useful for most of the questions covered from the material. Nice explanation in videos. Happy you tube channel and questpond you tube channel is enough to crack the interview for 2 to 4 year experience level of dotnet developer. Mostly 80 % expected questions. But presenting the level we need to practice
thanks man . you helped me so much thank you again and again
welcome
I’m learning so much from your videos.
That's great, thanks Maranta
Thank you sir for providing such a valuable resource
Thanks and welcome Eshwar Moorthy
Good FAQs
Dear sir, can you make logical program series which should be contain 50 program based on String, Array, Collection...or if you have already please share link...i am automation Tester
Thank you so much!!!!! It is very useful
welcome Alice
thanks Man, you are a gem :)
Thanks Abhishek
No one can explain like this 👍
Thanks
Abstract classes should have Protected constructor right ? so when derived class gets instantiated it will invoke the abstract members,?
Please clarify
Thank you
Very good video. It includes everything for revision purpose. Kindly make a video on .Net Core also. Thanks.
Thanks Anupam, I already post a video on .NET Core also. Please check videos in my channel.
Wooooow excellent explaination ... i encourage you to continue ..make us a design pattern video I couldn't find any good one
Thanks, sure
❤
Masterpiece 👍💖✨⭐✌️👏👌
Thanks Deepak
Hi Sir, I have a question which was asked by an interviewer, what is the of the constructor in Abstract class.plz give me one example sir. and one more question is why do we need static fields/methods/constructors in application.what is the use of the that static thing.plz explain with example sir.
Thanks Happy!
2.29.23 Delegate example , really SUPER
Thanks Archu
At 2:29:22 if we want to do multiply also then we should again create object?
Very nice info
Good explanation
No words to explain, appreciate the effort keepup the good work
Thanks Raj
thanks a lot sir u r super
Thanks Amit. All the best for your career.
Awesome video, very informative!
Thanks Bryan. All the best for your career.
@@interviewhappy Thanks!
Thank you so much sir.
Most welcome @ prabhatverma955
Hi,Nice video.. you explain everything in detail.
Thank you so much 🙂
very good vedios Sir Keep it up
Thanks Yogesh
1:23:20 what is the need of finally block in try catch ? If we write the code what inside in the finally block after the catch block the code will excecute same as finally block so, what makes "finally" so important?
There are some scenarios where code written directly below a catch block might not execute as below:
1. If an exception is not handled within the catch block and is instead propagated, any code written after the catch block will not execute.
2. If a return statement is executed in the try or catch block, the control flow will exit the method, and the code following the catch block will not execute.
3. If the method exits due to an exception, and there is no higher-level exception handler, the code following the catch block will not execute.
The finally block executes no matter what happens in the try or catch blocks, including exceptions, return statements, or method termination.
I have a question about abstraction you said that client show only nessasary detail in real example i understand butt in programing client show anly view UI page soo we hum kis se hide kerty hain background detail
Hi sir, in abstraction examples i have doubt ( 18:06 ) like we can still access calculateHra() method and calculateBasicSalary() method. So how we can achieve abstraction here.
Can you please explain.
Because one of the interviewer asked me.
Those methods should be PRIVATE. I hade the same question come into my head
Just want to say, amazing
Thanks Babar. Glad you liked it. All the best for your career.
@@interviewhappy Well, I am a software engineer doing job. I watched your video to clear OOP Concepts. Thank you for mind blowing content. Keep posting stuff like that.
You are an amazing teacher. Hats Off.
Thanks Touseef and all the best for your career man.
C# an abstract class can have multiple interfaces just like any other class
This video leaves me feeling quite discombobulated after listening to its definitions of the terms abstraction and encapsulation!!
The video gives the defintion of abstraction as "Showing only required things". But that definition matches the Wikipedia definition for encapsulation, Wikipedia states encapsulation as being "the limiting of direct access to some of that data".
I'm familiar with a very different definition of abstraction, which is the one you'll also find in the Webster dictionary, which is "disassociated from any specific instance".
Hi Sir, Thankyou for the detailed class. But 1 correction - In C#, the default access specifier for class members (fields, methods, properties, etc.) is private. If no access modifier is specified, members are implicitly considered private.
Yes, you are right
Thank you sir
Welcome Rasheed
God bless u
nice video Sir, one question is there, in abstract class also we can declare method and use it in dervied class , eg. SetSalary() and SetProject() can be only declared in abstract class also, then why should we use interface? Am I missing something?
Because later if you want to do multiple inheritance than it is only possible via interfaces not via abstract classes.
@@interviewhappy yes sir, got it now
I think feilds can be defined in interface as per my memory.. correct me if jts wrong
Is Ienumarable a namespace given at the top
17. What are Access Specifiers What is the default access modifier in a Class?
What is the Other CODE?
Sir excellent explanation sir..
But video quality little bit low pls sir
Hi Sir,
My doubt is here we created instance for delegate and passed Add method right.
If i want to call Mul() then aslo, do i need to create one more instance and pass values again????
If one more delegate instance creation is required then directly we can create class instance and we can call two methos right then what is use of this delegate.
It depends on the situation. Are method definitions the same(except method names)? What about delegate calling preferences? Are you passing func as a parameter and so on ..
Thank you for explaining. Can overloading achieve by different return type
No Sourav, different return type, same parameters will lead to error.
good job male, thanks!
welcome Ashraf. All the best.
welcome Ashraf. All the best.
hello sir plzz provide web api concept video and how it is created and also provide fresher level interview video. i like ur video and explanation.
Thanks Ashvini. I poted a web api interview question series also. In starting questions, I have explained why web api is needed.
thankyou🥰🥰
Your Welcome Ahmed Ebrahem
You are like... A textbook... 😍
Thanks man
Sir Question 22 . Generics class not required object creation ?
Interface use property also not only methods
Where can i get your ppt?
Hi @interviewHappy sir. If possible, can you please create one video for explicit calling concepts in multiple inheritance
Sure will try to do it soon @vigneshvk4940
I really need a mentor like you 'HAPPY JI'. Kindly accept my request. I will be grateful to you. One more request - can you please demonstrate on each language by creating a new fresh project. It will be helpful for us to understand on each module as how they interact with each other. And for architect level for whose year of experience is atleast 10years must have the knowledge to work from scratch so kindly request you to provide the inputs. It will be helpful for us in this output driven era. Thanks
Q14 - why don't we just inherit a class and override the method instead here? Is it some kind of "safety feature" that prevents us from implementing the same method the same way in two separate classes?
Please make videos about Entity Framework interview questions
I think I already posted some of them
2:34:17 I'm not sure if this is important but why did you initialize the delegate outside of the program class? Thank you you're the best C# interview teacher out there, I only watch yours!
becz deligates are meant to be used from outside classes. They work as a representative of things happening inside class.. So that anyone who wants to use them do not need to create instance of that class to use the delegate. instead they can directly call it and use it.
why is throw ex used then? in which case it is beneficial ?
In some 5% cases, we do not need complete stack info then we can use this.
@@interviewhappy Thank you for the information sir. Your videos are exponentially increasing my knowledge.
if i pass my interview tomorrow i will donate you 50$ haha , thank you , really great job
You will definitely pass Theo. My best wishes are with you.
@@interviewhappy I got the job today, you owe me fifty dollars
Happy, really thanks for this. This is so useful. Advice - stop explaining things by saying "This is nothing but ...". That's a wrong English Indians school teach.
Very nice video Sir but can you make a roadmap to become .net developer for fresher means step by step how to prepare to become .net developer
Thanks Pranjali, sure
Please provide this ppt link
superb
Thanks Balwant
can you make video on solid principal in c# i didn't found better video
even after 2x it seems slow! Great Content Though👍
Thanks Rajat. I will try to increase speed from my side.
🔥🔥🔥
:)
How i contact you brother?
❤❤❤
Hi happy I'm too impressed by your content. Can you please also create videos on entityframework interview questions thanks ..expecting it can possible for you asap
Sure I will, I have scheduled it but entity framework will take some time. Sorry for delay.
Hi sir, can you please provide the interview questions on azure developer
Right now I don't have but soon I will create on Azure developer also.
Hi Happy, Which context
we define class as sealed?
Hi Deepak, When you want any other developer can create the objects of your class but cannot inherit it.
Static can be also used but then object creation is not possible.
Could you do a video about design patterns and IQs on design pattrens.
Because ur all tutorials are superb and u elaborate each from very basic and understandable 😌😊
Sure Sreeni.. I will in future
your explaining away is superb keep making vidoes on new features of latest version of c#
Thanks Krishna, sure and its a good idea. Once I will cover all important topics then we will cover new features in C#