Expert level Angular Interview Questions Part -2
3 min readApr 11, 2021
PART 1 <<. — — — — — — — — — — — — — — — — — — — — — — — — — >> PART 3
HTTP Client
- How to consume an JSON REST api (server)?
- Which service is used for hitting an api?
- Differentiate between get and post?
- What is a header?
- In Auth 2 how to manage token expire scenario by renew it using refresh token without impact of user experience?
- Where do we put http params in the request ?
- What are different type of response type available in angular?
- What is role of observe in request ?
- How get upload progress of file request ?
- How t request a typed response?
- How to read the full response?
- How to make and consume a jsonp request?
- How to request non json data ? like download a file.
- Write code for interceptor ? also where do we need it to inject?
- In provider array we use multi true what it does ?
- How can we apply caching in request?
- How to apply debouncing in request?
- How you can secure the requests?
- How to handle more than one request suppose need to get path of 100 of images in an array ?
Testing
- Write the code for testing a service ?
- Why we need before each?
- Difference between equal to and tobe()?
- Why we need fake service?
- Testing without before each ?
- How to test http service?
- What is needed for component dom test?
- Use of by.css
- What is the debug element?
- How to test attribute directive?
- Explain tick , discard periodic task , component fixture auto detect?
- Explain compilecomponent?
- How replace meta data ?
- How to reset the test environment?
- Please enlist the component fixture methods?
- What is isStable ?
- What is listener in testing?
- What is By.directive ?
Internationalization (i18n)
- How to change the currency according to timezone?
- Name the local package?
- How to support the translation?
- In which file we put localize configuration ?
Animation
- Enlist the some animation functions we import from modules?
- Write and animation code ?
- Explain delay and easing?
- What is trigger in animation Where we put the trigger?
- What is use of animateChild ?
- How to create reusable animation?
- How to add animation in route transition?
- How to add animation in ngFor for element for leaving and entering?
Schematics
- How to make custom schematics?
- How to add any third party library?
- How to update the angular apps?
- What is an angular dev kit ?
- Can we run angular app without ng serve?
PWA and Service worker
- How to support PWA in angular?
- What are the benefits of service worker?
- Which file contain service worker configuration?
- What is app shell?
RxJS
- Difference between Observable and Promise ?
- What is next , error complete?
- Difference between of and from ?
- How to convert promise to Observable and vice-versa?
- How to create observable?
- List the operators ?
- Explain the combineLatest, concat , zip, takeuntil debounceTime, DistinctUntil change, switchmap buffertime, tap and share, shareplay?
- Can we replace interval with observable if yes then how?
- Make an observable from keystrokes ?
Security
- How to prevent cross site scripting?
- How to trust safe values?
- What is CSP Content security policy?
- What are all possible vulnerabilities ?
- How we can audit an angular app?