โ
Frontend Frameworks Interview Q&A โ Part 1 ๐๐ผ
1๏ธโฃ What are props in React?
Answer: Props (short for properties) are used to pass data from parent to child components. They are read-only and help make components reusable.
2๏ธโฃ What is state in React?
Answer: State is a built-in object used to store dynamic data that affects how the component renders. Unlike props, state can be changed within the component.
3๏ธโฃ What are React hooks?
Answer: Hooks like useState, useEffect, and useContext let you use state and lifecycle features in functional components without writing class components.
4๏ธโฃ What are directives in Vue.js?
Answer: Directives are special tokens in Vue templates that apply reactive behavior to the DOM. Examples include v-if, v-for, and v-bind.
5๏ธโฃ What are computed properties in Vue?
Answer: Computed properties are cached based on their dependencies and only re-evaluate when those dependencies change โ great for performance and cleaner templates.
6๏ธโฃ What is a component in Angular?
Answer: A component is the basic building block of Angular apps. It includes a template, class, and metadata that define its behavior and appearance.
7๏ธโฃ What are services in Angular?
Answer: Services are used to share data and logic across components. Theyโre typically injected using Angularโs dependency injection system.
8๏ธโฃ What is conditional rendering?
Answer: Conditional rendering means showing or hiding UI elements based on conditions. In React, you can use ternary operators or logical && to do this.
9๏ธโฃ What is the component lifecycle in React?
Answer: Lifecycle methods like componentDidMount, componentDidUpdate, and componentWillUnmount manage side effects and updates in class components. In functional components, use useEffect.
๐ How do frameworks improve frontend development?
Answer: They offer structure, reusable components, state management, and better performance โ making development faster, scalable, and more maintainable.
๐ฌ Double Tap โค๏ธ For More
Post #3385
2.98K
- โค 10