Unit6 - Subjective Questions

INT219 • Practice Questions with Detailed Answers

1

Explain the difference between Interface and Type aliases in TypeScript. When should you prefer one over the other?

2

Describe the concept of Generics in TypeScript. How do they contribute to creating reusable component logic? Provide a code example.

3

What are TypeScript Utility Types? Explain the usage of Partial<T>, Pick<T, K>, and Omit<T, K> with examples.

4

Explain the strategy for typing API responses in a TypeScript project. How do you ensure the data received from the backend matches the expected type?

5

Discuss the process of integrating TypeScript into an existing JavaScript frontend project. What is the recommended migration strategy?

6

What is Static Code Analysis? Explain the roles of ESLint and Prettier in maintaining code quality.

7

Explain the importance of Source Maps in the debugging workflow of a TypeScript application.

8

Compare Unit Testing and End-to-End (E2E) Testing in the context of frontend development. Mention one popular tool for each.

9

What are Discriminated Unions in TypeScript, and how do they improve type safety in state management (e.g., Redux or generic reducers)?

10

Describe the Arrange-Act-Assert (AAA) pattern in testing fundamentals.

11

What is Code Coverage, and why is it an important metric for Quality Assurance? Define Statement, Branch, and Function coverage.

12

Explain the SOLID principles and how they apply to frontend component design and maintainability.

13

Define Technical Debt. How does strict TypeScript configuration help in reducing technical debt over time?

14

What are Code Smells? List three common code smells in frontend applications and how to resolve them.

15

Explain the concept of Mocking in testing. Why is it necessary when testing frontend components that interact with APIs?

16

What are the key configuration options in tsconfig.json that control the strictness and output of a TypeScript project? Explain strict, target, and module.

17

Discuss the workflow for Code Reviews in a team environment. What specific things should a reviewer look for in a TypeScript pull request?

18

Derive the benefits of using Test Driven Development (TDD). How does the TDD cycle function?

19

Explain the difference between unknown and any in TypeScript. Why is unknown considered the type-safe counterpart of any?

20

How does Continuous Integration (CI) support Quality Assurance in frontend projects? Describe a typical CI pipeline for a TypeScript application.