TOP 5 Angular Interview Questions and Answers (for experienced, 2020)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Downvoted for no leetcode questions.

Just kidding! These are the questions that really matter if you want to find a good Angular dev. Nice summary.

👍︎︎ 5 👤︎︎ u/spacechimp 📅︎︎ Mar 22 2021 🗫︎ replies

Of course React is easier to learn than Angular, it is a simple view binding engine library, not a full framework. But learning to deliver a full application in Angular is easier than in React as you need to rely on so many other libraries. Once you ask yourself do I need Redux, it's all over move to Angular.

👍︎︎ 2 👤︎︎ u/NerdENerd 📅︎︎ Mar 25 2021 🗫︎ replies
Captions
hello guys my name is mitchumski since i started to run my youtube channel i have been getting questions from and other developers who want to start their career as angular developer and the most popular questions i'm getting is what i have to know in order to be a good angular developer and to get this job well since i was involved in the recording process on my previous job and i was interviewing people from my x team i found myself that i have some specific set of questions which i'm asking every interview and in this video i will share some of them of course i will give you some brief answers but in order to be perfectly prepared for the interview you have to do some homework the point of this video is just to give you some hints and show you direction so this is my top five interview questions which in my personal opinion should be answered by any good angular developer let's get started [Music] and the question number one is name all advantages and disadvantages which you know in angular i like to ask this question at the very beginning of every interview because it perfectly shows how broad knowledge has candidate and how many features in angular does he or she use here you actually can mention everything you like or don't like in angular and the more the better but if i was asked about this question my answer would be the next advantages first class typescript support powerful cli dependency injection and all in solution means that it's fully fledged framework which comes with its own routing animations form and so on so on disadvantages talking about disadvantages i would first of all highlight the complexity comparing two other frameworks like react or view besides some framework specific features you have to learn also typescript which takes some time and also rxgs library and the last one is even more challenging and without solid knowledge in rxgs trust me your code will turn into unmaintainable mess very very soon second disadvantage i would say it's a bundle size and yes that's true angular is quite thick but there are some ways how to decrease this bundle size especially in the shell bundle size and i will mention about this later and also angular team does very good job towards the optimization and usually it gets better with every major release and the last thing i would like to mention is community size and if comparing to react or view community angular community is smaller but it is not a small i mean that you have no any problems with third third-party libraries or answers at the stack overflow everything is completely perfect there but it's just smaller than react community that's it the second question change detection what is this and how it works so what is change detection well uh change detection this is a mechanism in angular which cares about viewer rendering in case if data was changed it is being triggered when one of the next events happened so when fired javascript event like click mouse enter mouse move and so on then when ajax call was performed and the last thing when some set interval or set timeout was ticked once it happens angular start traversing the tree of components and this traversing is a quite heavy operation and it can be cause of their performance issues and one the way of how to optimize it is ng on push strategy by setting up our own push change detection strategy you are telling angular to perform change detection only in next cases if input value has been changed if was fired template event inside component or its descendants like as example you have the button it has a click handler and when this function handler was executed angular will trigger change detection run and the third case when change detection was triggered manually sometimes developers are saying that a sync pipe triggers change detection as well but it's not actually true the only one thing which does a think pipe it subscribes of course to uh stream or promise then once some value a new value arrives it does only mark for check but it doesn't trigger change detection run and of course it's unsubscribes from the stream in case if component has been destroyed also you may asked about ng zone and what it is and ng zone it is a library which utilizes angular in order to track this event which i mentioned at the very beginning uh this fired events ajax call and intervals with timeouts and when it happens it notifies angular in order to trigger the change detection run that's it what it does and the third question is dependency injection and how it works dependency injection is an application design pattern which has its own implementation in angular and the main idea of this pattern is when a class delegates a creation and providing some external dependencies to some external resource then it worth to mention that there are two types of injectors model injector which can be configured inside ng model and injectable annotations and there is element injector injector which is being created for every dom element and can be configured inside the component or directive annotation and inside this directive or component annotation you have this provider's property this is the array where you provide some services whatever and these two injectors these two type of injectors they have its own hierarchy then you could be asked about how angular resolves these dependencies and you could answer like this so when component declares some dependency angular first of all tries to resolve it in its own element injector i mean element injector of these components which declares this dependency uh if there is no provider for it uh angular asks a parent element injector and then in continues to go up up up until it it finds it if angular cannot find it goes back to the same place where it started and tries to resolve it all already in module injector error here so it also asks the parent one if parent doesn't have it goes up up up and if it cannot resolve even in the model injector hierarchy you will get most probably the error like null inject or whatever i don't remember exactly right now but if it finds it will provide you result dependency as you requested then you most probably will be asked about resolution modifiers which are optional uh self skip self and uh what else host yeah as far as i remember this four them and to completely cover this part you may ask about class providers which are use class use existing use use use use use factory and use value but i'm not going to stop in details with these topics you have to that will be your homework so uh repeat this in angular docs links to these topics i will leave in video description and fourth question which you cannot avoid at all during the angular interview this is rxjs so what is rxjs rxgs this is the library which implements concept of reactive programming and this library is heavily used in angular application you are not able to avoid using angular or sorry rxjs in the angular application so you have to you must understand at least some k concepts of this the most popular question about this topic is what the difference between observables and streams comparing to promises and there are some of them the first one is observables are lazy so you have to call subscribe method in order to execute it when promise is being executed immediately and observable are consolable and promises are not then observable can be synchronous also unsynchronous and promise it's always a thing and also observable can emit multiple values promise can emit only one value then observable has different operators to transform the data and observable has only then and catch and finally uh methods right and i think i forgot nothing if i forgot please write me in the comments if i forgot to mention some different but this this is the key difference between them also i'm asking about which operators uh has candidates used and uh for which exactly use case and i really pay attention if candidate names such operator like switch map flat map contact or cat map and some combined latest probably because it is really bad signed if he or she doesn't know it it means that later on you can see in your code base something like subscribe inside subscribed and subs inside subscribed and so on then you may encounter the question about what is subject in rxjs and what kind of subject do you know so there are subject subjects just regular subject then behavior subject a sync subject and which else replay subject and i hope that's it if i again if i forgot something please uh leave correct me in the comment section then it makes sense also to ask about memory leaks and how to prevent it and you can say that you have to kill every subscription if you destroy some particular component and then of course you can mention about a sink pipe and say that a sink pipe we have to use as much as we can because it cares about unsubscription as well so very handy and the last but not least it is application optimization here i'm asking to name all optimization techniques doesn't matter if it's run times performance bundle size optimization whatever everything you know and the more the better and there i would mention definitely the aot compilation which means that application will be compiled during the build time rather than in runtime which means that app doesn't know uh to include a compiler into the bundle which decreases actually the bundle size in the end since angular 9 if i remember right it is enabled by default but it's still worth to know about it then you can also decrease your bundle size by using lazy loading and load some parts on demand and if you mention about also differentiation loading that would be also a big plus then uh you can decrease your bundle size if you will be using uh provided in route as example a feature in you know this injectable annotation and as a value you can provide the object and there is a provided in uh property and if you define this it makes us your service to shakeable and if you have some unused services they will not be included into the end bundle by the way i mentioned tree shaking what is to shaking talking about some runtimes performance the first thing which come to my mind is uh enabling the on push change detection strategy which i mentioned before in the change detection section and then in some cases track by function can help you optim to optimize your performance and yeah this function is being used inside the ng for loop then also try to avoid the function calls inside the template and use pure pipes instead and the benefit which has these pure pipes is that it triggers the data transformation or recalculation only in case if input has been changed when function will be executed every time change detection runs so if you have some complex transformation calculation whatever it makes sense to use the pure pipe because it will save you a lot of performance then you can mention also some i know com common techniques like graphic optimization yeah optimize your images on your web page uh or using i don't know um source set for attribute for image when you can provide as example for retina screens will be loaded i know two three times bigger image in order to be sharp on the retina screens or if it's a regular screen it will be a loaded image with the lower resolution so it means the lower size of this application and it will also allow your application to be more responsible and faster then also you can mention about cdn to quickly deliver your assets to user definitely it's not everything for sure i forgot something but there are really myriad of ways how you can decrease uh bundle sizes improve your performance if i forgot something please welcome to comment section i it would be interesting for me to know and other maybe optimization techniques and it would be useful for community as well so if you know something please welcome and here is some bonus question which is not actually technical but it's still very very important and this question is about how are you staying up to date how do you find out about new features of angular or i know typescript or whole this ecosystem and here you can mention any literally any block i know github twitter or medium or youtube channel definitely my youtube channel i would really appreciate it and it definitely worth to subscribe right now because i am posting the advanced angular topics and they would be really useful for you not only before the interview but also it would be valuable for you for your daily job as well once you successfully pass the interview and i wait for your subscription but what the purpose of this question why i'm asking this well in my opinion if candidate doesn't follow what happens in community it means he he just doesn't learn things he he's not interested in uh everything what happens in this area and when you are not involved in this you are you you cannot be just successful developer without interest in this area where are you working right now and also the one advice from you would be it's just relax relax and try to answer the questions you confident to not try to be smarter than you really are do not afraid to say that you don't know something it's completely fine it is way more better rather than bullshitting about the things which you learn somewhere in medium at the night just before the interview because you know sometimes happens when a candidate gives an answer about optimization as example and uh he or she says that all right i would use ng zone and some piece of code i would run outside of angular and when i'm asking okay uh what is this then in g zone which what kind of problem are you trying to solve and candidate says like oh you know ng zone it's like kind of ng and zone so it's some angular zone which is definitely not the answer you expect to get from the candidate and it shows that he actually doesn't understand what he's talking about but it would be way more nicer when when if you don't know you just say yeah i don't know that's fine we are all people we cannot know everything but again this how i thinking this is my personal opinion someone else can consider it like kind of benefit so means that at least candidate heard about this thing so here you you will never know okay that was it for today i hope i gave you some hints what you could prepare for your interview and of course it is not all the question you may be asked but this is in my opinion the core questions which i encounter during every interview when i am interviewing when i am being interviewed and yeah in my opinion this is the core which every good angular developer should know and it also would be great if you share in the comment section your favorite interview questions so we could uh collect some knowledge base and maybe i based on this question i could create the second part of this video if you are interested in such kind of videos so i think it would be interesting not also for me but also for community and if you are watching this video not just for fun or because angular for the reason recommended this video for you and you really have some interview in next days i wish you a successful interview don't panic everything will be cool you will definitely manage it i also wish you a productive week have fun and see you in the future
Info
Channel: Decoded Frontend
Views: 29,384
Rating: undefined out of 5
Keywords: angular interview questions and answers, angular interview questions, angular interview questions and answers for experienced 2020, angular interview questions for experienced professionals, angular interview preparation, angular interview answers, angular interview questions and answers - part 2, tutorial, angular
Id: KhUtM8skC5A
Channel Id: undefined
Length: 21min 49sec (1309 seconds)
Published: Sun Aug 16 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.