Interview Questions

JavaScript

Theory


Angular JS

Theory-based

  1. Components vs Directives
  2. componentFactoryResolver
  3. Decorator design pattern
  4. What are the modules, component and service?
    • How many types of modules are there?
    • Can you add multiple modules in a single angular application?
  5. How to detect changes in the input property passed from parent to child component?
  6. How to pass data from child to parent component?
  7. Lifecycle methods in angular
  8. Observables vs Promises in angular
  9. Data sharing between parent to child using -
    @Input
  10. Data sharing between child to parent using -
    @ViewChild, @Output and Event-emitter
  11. AOT vs JIT, which one is better
  12. Dependency injection
  13. How would you create a filter using angular?
  14. On which life cycle hook component/framework is already created?
  15. Constructor vs ngOnInit
  16. What are different change detection strategies available and how to forcefully detect changes?
  17. DOM Sanitization
  18. Security Practices in angular
  19. View Encapsulation
  20. IVY
  21. Route guards
  22. What is the default loading strategy in angular - eager or lazy?

Scenario-Based

  1. If the same service is added to the root and feature module, what will be the behavior?
  2. An observable returning a stream of data and if you subscribe at a later stage then how can you get previous data that have been missed?
  3. Digest cycle vs Change detection
  4. Can you load and unload an angular feature module?

HTML

  1. datalist tag in HTML
  2. Semantic tags
  3. What's new in HTML 5?
  4. What is the difference between async and defer attribute in script tag?

CSS

  1. How to align a div vertically and horizontally centered?
    • With fixed dimension Read
    • With variable dimension Read
    • Using a flex-box
  2. What is a box model in CSS?
  3. Pseudo classes (:hover, :active) vs pseudo elements (:after, :before)
  4. Explain different types of positions in CSS
    fixed, relative, absolute, static, sticky
  5. Explain the following CSS selectors
    div, p
    div p
    div > p
    div + p
    div ~ p
  6. What are CSS media queries and what are they used for?
  7. Bootstrap
  8. CSS Pre-processors
  9. Flexbox in CSS Read
  10. box-shadow
  11. box-sizing
  12. Display properties - none, block, inline, inline-block
  13. vm, em, rem, vh, vw font-size properties
  14. CSS Animations
  15. What is a float property in CSS? How do the other elements surrounding it work? Why is the clear property required? Read
  16. How would you align an image to a circular div, just like on Instagram?
  17. How would you write a code to freeze the top row and column of a table?
  18. CSS Specificty

TypeScript

  1. Static vs dynamic typing
  2. Generics in typescript
  3. How can you define an optional value without using a question mark?
  4. never vs any
  5. Basics of typescript Read
  6. Basics of typescript 2024 Read

React JS

  1. What are Higher order components in React?
  2. React Thunk vs React Saga

Redux

  1. How can you create Redux library polyfill? Read