Main

Explain IEnumerable in C# ( C# Interview Questions)

For more such videos visit http://www.questpond.com --------------------------------------------------------------------------------------- See our other Step by Step video series below :- For more such videos subscribe https://www.youtube.com/questpondvideos 30 Important C# Interview Questions : https://youtu.be/BKynEBPqiIM 25 Important ASP.NET Interview Questions : https://youtu.be/pXmMdmJUC0g 25 Angular Interview Questions : https://youtu.be/-jeoyDJDsSM 20+ SQL Server Interview Questions : https://youtu.be/SEdAF8mSKS4 10+ Power BI Interview Questions : https://youtu.be/Cozc9WNBRt4 20 PHP Interview Questions : https://youtu.be/1bpNSynUrl8 5 MSBI Interview Questions : https://youtu.be/5E815aXAwYQ Learn Angular tutorial step by step https://tinyurl.com/ycd9j895 ASP.NET MVC Core Interview Questions with answers:- https://youtu.be/pXmMdmJUC0g C# tutorial for beginners(4 hrs):- https://youtu.be/AxEGRBFwlmI Learn SQL Server Step by Step http://tinyurl.com/ja4zmwu Learn Azure Step by Step:- https://youtu.be/wdUK7bCMXqs Azure AZ-900 fundamentals certification :- https://youtu.be/hC9iGgJorz8 AZ- 204 certification Azure:- https://youtu.be/qI8PRn2C080 Learn MVC 5 step by step in 16 hours:- https://youtu.be/Lp7nSImO5vk Learn Design Pattern Step by Step https://goo.gl/eJdn0m Learn MSBI Step by Step in 32 hours:- https://goo.gl/TTpFZN Python Tutorial for Beginners:- https://youtu.be/KjJ7WzEL-es Learn Data Science in 1 hour :- https://tinyurl.com/y5o7qbau Learn Power BI Step by Step:- https://tinyurl.com/y6thhkxw ----------------------------------------------------------------------------------------------- For more details :- 🌐 Website : www.questpond.com 📱 Mob. No. : +91-9967590707 / +91 7700975156 / +91-22-49786776 📧Email : questpond@questpond.com / questpond@gmail.com / questpond@yahoo.com Share, Support, Subscribe and Connect us on!!! YouTube: https://www.youtube.com/questpondvideos Twitter: https://twitter.com/questpond Instagram : https://www.instagram.com/questpond/ Facebook : https://www.facebook.com/Questpond/

Questpond

1 year ago

welcome to quespond's youtube channel and what are we learning today today we'll be discussing a very very very very simple a very simple c sharp interview question what is i enjoyable why do we need i invitable what is the importance of it and so on right now this question is a very simple question right but it is very surprising that many developers either don't know the answer or many of them who answer the question they just answer 50 part of it and remember that you know questions uh around
collections or or simple questions you know shisha fundamental questions uh you know like array arraylist and i enumerable and i queryable i enumerator yield keyword you know these are some of the questions that if you're not able to answer it sends a very wrong signal in the interview right so let us try to answer this question now when this question comes up right many developers would write away answers saying that the goal of i enumerable is to [Music] enable iterations or in other words yo
u know to enable this fantastic forage loop over a collection right so if you have an array list or if you have a list right and if you want to do a for each loop over it you know then i enumerable is needed or innovable helps you to do that now this answer is 50 right and if you are lucky and the interviewer does not cross question you you are good but let us say the interviewer cross questions you let us say that if it is a bad day and the interviewer cross questions and says that well without
the knowledge of i enumerable you can see the screen you can see the code on the screen without the knowledge of i enumerable we are still able to iterate over an array list or a list or a collection or a dictionary or anything right so um when we are able to do that right why do we have to explicitly know about i any variable because you can always do a for each loop over our arraylist over a list right you don't have to specifically do something right so now you are stuck with this googly rig
ht uh and that's why i always say a little bit of advertisement that's why i always say that please go prepared for interviews right remember when you say that you want to crack an interview one is that you should know the technology for example let us say you want to go and crack c sharp right so you should know she sharp step by step you should do a project you should do mvc project but at the same time you should also do interview questions you should go through the basic concepts right so on
questpond.com you know we have uh you know both the things you know you can learn step by step as well as you know you can go through the interview question so you can learn msbs step by step and you can have the interview question you can learn angular step by step and then you will have somewhere an angular interview question right in the same way you can learn asp.net mvc at the same time you will have interview questions right so we have this step-by-step and interview question both of them
together and please you know this week also i am having the weekend training on architecture so please attend my architecture training it's going on for i think now this would be the 10th or the 11th session all the recordings are uploaded please go ahead and join this training as well as you know exciting you know offline on saturday and sunday in mumbai we are having the learn angular training so in case if you're interested you can join the same as well right so let us go back to the topic s
o that's why i always say go prepared go prepared you know when you get such kind of cross questions it is something you know it's it's not that you don't know the answer it is just that you have to be prepared right so the complete answer must be the complete answer is i enumerable helps to iterate without knowing the actual type of collection you have at the back so it acts like an abstraction so now let us try to understand it with an example remember that when you say you are preparing for i
nterviews it does not mean that you have to mug up you have to understand the concept you have to know how to answer those cross questions so you can see that here here we have the simple get function out here and this get function depending on situation if it is monday it is giving out an array list if it is not monday it is giving out a list so this get function is you know giving out different type of collections right and now let us say you want to go and iterate over it right so if you want
to do a forage over it then what you do you expose out an i enumerable so you'll say okay just expose out an iron variable that's it and now you can go and you can do a for each loop over the get function easily so you can say for each over the get right so you can see now this this for each loop out here does not know that he will get an arraylist or he will get a list right so that's what the use of i enumerable is it is an abstraction it is an abstraction and also you know this i enumerable
becomes very useful you know for example if you want to go and pass a generic collection so let us say if you have a method here called a sort right so in this sort you want to go and pass a collection but you don't you know but it you want it to be generic you know so let's say the sort function actually can take any kind of collection it can be a list it can be a dictionary and he can do the sort right so what you can do is you can again go and pass just i enumerable right and then uh the sort
can go and sort take this i enumerable collection and he can say okay if it is a list then he will sort in a different way if it is a dictionary it will sort in a different way and so on so now you know the client can call this sort function and he can pass in an arraylist so no problem in this he can also go and pass in probably a list he can pass in a dictionary so you can see now the sort function says that you just passed me i enumerable i don't want to get into the details of the data type
s you know that it is a dictionary or it is a generic list or it is a list it is an array list you know i will just sort it out right so must be the complete answer you know when this question comes up in she shop interviews is that i enumerable acts like an abstraction it lack it it acts like an abstraction and it hides you know that what kind of collection exists at the back right so must be the complete answer is ian variable helps to iterate without knowing the actual type of collection at t
he back it acts like an abstraction right now when this question comes up i enumerable there are 80 to 90 percent chance you know the interviewer can ask you a question saying that what is the difference between i enumerable and i enumerator what is the difference between i enumerable iq variable i enumerator yield keyword and so on right so must be you can go prepared for these kind of situations remember that a prepared developer a prepared developer has more chance of getting a job than an un
prepared superhero so you can be a superhero in a project you know but when you get such kind of cross questions be prepared you are asking for a big salary so why not go prepared right so please go to my website questspawn.com and we have lots of these courses you know which are specifically meant uh you know so that you clear interviews so that you get good knowledge right now before i end this video i want to ask a simple question out here and if you know the answer of this question below in
the youtube comments please go ahead and put the answer which design pattern which design pattern does i enumerable or i enumerator implement so which design pattern from gang of four does i enumerable and i enumerator implement right so that brings us to the end of this session please hit the like subscribe and the bell icon so that when such videos are uploaded you are informed right away who knows you know that one of these questions you know can be a deciding factor in interviews so happy le
arning happy job hunting thank you you

Comments