0% found this document useful (0 votes)
5 views2 pages

Angular SpringBoot Viva Questions

The document outlines the roles of various components in a project using Angular and Spring Boot, including the Entity class for database representation, the use of HttpClient for API communication, and the Repository for database operations. It explains the importance of annotations like @Autowired and @CrossOrigin, as well as the routing mechanism in Angular. Additionally, it provides deployment steps and mentions challenges faced during development, such as CORS errors and version mismatches.

Uploaded by

romitsaha.bumba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Angular SpringBoot Viva Questions

The document outlines the roles of various components in a project using Angular and Spring Boot, including the Entity class for database representation, the use of HttpClient for API communication, and the Repository for database operations. It explains the importance of annotations like @Autowired and @CrossOrigin, as well as the routing mechanism in Angular. Additionally, it provides deployment steps and mentions challenges faced during development, such as CORS errors and version mismatches.

Uploaded by

romitsaha.bumba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1. What is the role of the Entity class in your project?

Entity classes represent database tables. For example, in my project, Product or User classes are

entities, and each field becomes a column in the database.

2. How does your Angular frontend communicate with your Spring Boot backend?

I use Angular's HttpClient service to make HTTP calls (GET, POST, PUT, DELETE) to backend

REST APIs created using Spring Boot's @RestController.

3. What is a Repository in Spring Boot and how did you use it?

Repository extends JpaRepository and provides built-in methods like save(), findAll(), deleteById(). I

used it to perform database operations without writing manual SQL queries.

4. What is the use of @Autowired annotation in your project?

@Autowired automatically injects required classes (like services or repositories) into controllers, so

we don't have to manually create objects using new.

5. Why did you use *ngFor in your Angular code?

I used *ngFor to loop through the list of products or users and dynamically display them in the

dashboard page.

6. How does the CRUD operation flow work in your project?

Frontend: User clicks to add/update/delete a product.

Service.ts: Angular calls an API using HttpClient.

Backend: Spring Boot controller method handles the request, uses Repository to save or modify

data in the database.

7. What is @CrossOrigin in Spring Boot and why is it important here?

@CrossOrigin allows my Angular frontend (running on localhost:4200) to access the backend APIs

(running on localhost:8080). Without it, browser CORS policy would block the request.

8. How do you handle routing in your Angular project?

I use Angular's RouterModule and define routes like /dashboard, /login, /profile inside
app-routing.module.ts to navigate between different pages.

9. What command do you use to run your Angular project?

I use ng serve to start the Angular frontend server.

10. If you had to deploy your project, how would you do it?

I would:

- Build the Angular project using ng build.

- Host the Spring Boot backend (possibly on a server like AWS EC2, Azure, or a local server).

- Serve the frontend using Nginx or include it inside the Spring Boot project using resources/static

folder.

Bonus Tip for Viva

If they ask "Did you face any challenges?"

You can say:

Yes, I faced issues like CORS errors, version mismatch of Node.js during Angular setup, and

backend API connectivity. I solved them by using @CrossOrigin and proper HttpClient integration.

You might also like