Full Stack Flashcards

1
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the approach used to integrate Vite with NestJS?

A

A monorepo setup where NestJS serves React at production and accommodates SSR.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What builder tool is used to manage a monorepo for NestJS and React?

A

Turbo (https://turbo.build/).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the steps to set up a monorepo for NestJS and React?

A
  1. Create a project folder, 2. Install Turbo, 3. Set up workspaces in package.json, 4. Create backend and frontend projects inside apps directory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you create a new NestJS backend project in a monorepo?

A

Run: nest new demo-backend inside the apps directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you create a new React frontend project in a monorepo?

A

Run: npm create vite@latest demo-frontend inside the apps directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of turbo.json in a monorepo?

A

To configure pipelines for simultaneous development and builds.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you start both frontend and backend applications simultaneously in a monorepo?

A

Run: npm run dev from the root directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you proxy backend requests from the frontend in Vite?

A

Add a proxy statement to vite.config.ts linking frontend paths to backend URLs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of adding SSR in a full-stack application?

A

To improve performance by rendering React components on the server before sending them to the client.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you configure SSR in NestJS?

A

Modify app.module.ts and use renderToPipeableStream for React server-side rendering.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you enable API versioning in NestJS?

A

Use NestJS versioning techniques such as global, controller-level, or route-level versioning.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you add PWA support to a Vite project?

A

Install vite-plugin-pwa and configure vite.config.ts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What files are created when enabling PWA in Vite?

A

manifest.webmanifest, registerSW.js, and sw.js.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you add code splitting and lazy loading in React?

A

Use React.lazy along with Suspense or loadable-components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the purpose of internationalization (i18n) in React?

A

To support multiple languages in a web application.

17
Q

How do you set up i18n in React?

A

Install react-i18next and i18next, then configure language detection and translation loading.

18
Q

How do you create a microservice in NestJS?

A

Use nest new <service-name> and set up gRPC as the transport layer.</service-name>

19
Q

What is gRPC and why is it used?

A

A high-performance RPC framework used for communication between microservices.

20
Q

How do you generate TypeScript definitions from .proto files for gRPC?

A

Use protoc along with ts-proto to generate TypeScript files from .proto definitions.

21
Q

What are the benefits of using a monorepo for full-stack applications?

A

Unified development workflow, shared dependencies, simultaneous builds, and easier deployment.