Full Stack Development using Java - Viva-Voce questions

Full Stack Development Using Java – Short Notes

1. What is Full Stack?

Full Stack Development means working on Front-End, Back-End, and Database of a web application.

2. Front-End (Client Side)

  • HTML – Page structure
  • CSS – Styling and layout
  • JavaScript – Dynamic behavior
  • Bootstrap – Responsive UI
  • AJAX – Background data loading

Purpose: User interface, forms, buttons, layouts.

3. Back-End Using Java (Server Side)

  • Java Programming
  • Servlets – Handle HTTP requests
  • JSP – Dynamic web pages
  • JDBC – Connect Java to database
  • Spring MVC – MVC architecture
  • Spring Boot – Easy Spring applications

Purpose: Business logic, processing, sending data to front-end.

4. Database Layer

  • MySQL / Oracle
  • CRUD operations – Create, Read, Update, Delete
  • Hibernate ORM – Maps Java objects to tables

5. Important Tools

  • JDK – Java development
  • Eclipse / IntelliJ – IDEs
  • Apache Tomcat – Server
  • Maven – Dependency management
  • Git & GitHub – Version control

6. How a Full Stack App Works

  1. User interacts with Front-End
  2. Request goes to Java Back-End
  3. Back-End interacts with Database
  4. Output returned to Front-End
  5. User sees the result

7. Skills Required

  • Java, Servlets, JSP
  • Spring MVC / Spring Boot
  • HTML, CSS, JavaScript
  • SQL & Database
  • Git and deployment basics


EXERCISE 1 – IDE INSTALLATION (VIVA WITH ANSWERS)

  1. What is an IDE?
    Answer: An IDE is an Integrated Development Environment used for writing, compiling, debugging, and running programs.
  2. Give two examples of Java IDEs.
    Answer: Eclipse and IntelliJ IDEA.
  3. What is the purpose of JDK?
    Answer: JDK provides compiler, JVM, and libraries for Java development.
  4. Difference between JDK and JRE.
    Answer: JDK is for development; JRE is only for running programs.
  5. How to create a new project in Eclipse?
    Answer: File → New → Java Project → Provide name → Finish.
  6. What is a workspace?
    Answer: The place where Eclipse stores all projects.
  7. What is a package?
    Answer: A namespace that groups related classes.
  8. How to debug in IDE?
    Answer: Add breakpoints and run in Debug Mode.
  9. What is Build/Compile?
    Answer: Converts .java files to .class bytecode.
  10. How to import an existing project?
    Answer: File → Import → Existing Projects into Workspace.
  11. Use of Console window?
    Answer: Displays output and errors.
  12. What is MySQL?
    Answer: A relational database system.
  13. What is JDBC driver?
    Answer: Allows Java to connect to databases.
  14. Why use IDE instead of Notepad?
    Answer: Offers debugging, auto-complete, and tools.
  15. What is a Build Path?
    Answer: Configuration for JRE and libraries.



EXERCISE 2 – SERVLETS (VIVA WITH ANSWERS)

  1. What is a Servlet?
    Answer: A Java class that handles HTTP requests and responses.
  2. Servlet packages?
    Answer: javax.servlet and javax.servlet.http.
  3. Servlet lifecycle methods.
    Answer: init(), service(), destroy().
  4. Use of doGet()?
    Answer: Handles GET requests.
  5. Use of doPost()?
    Answer: Handles POST requests.
  6. What is PrintWriter?
    Answer: Sends HTML output to browser.
  7. How to link HTML to Servlet?
    Answer: Use form action="ServletName".
  8. What is session tracking?
    Answer: Maintaining user data across pages.
  9. Two session tracking methods.
    Answer: Cookies, HttpSession.
  10. What is a Cookie?
    Answer: A small file stored on browser.
  11. Auto-refresh a Servlet page?
    Answer: response.setHeader("Refresh", "5");
  12. Use of JDBC in Servlets?
    Answer: Database operations like insert/update.
  13. What is web.xml?
    Answer: Deployment descriptor.
  14. What is RequestDispatcher?
    Answer: Used to forward or include resources.
  15. Forward vs sendRedirect.
    Answer: forward is server-side; sendRedirect is client-side.



EXERCISE 3 – MVC (VIVA WITH ANSWERS)

  1. What is MVC?
    Answer: Model–View–Controller architecture.
  2. What is Model?
    Answer: Handles business logic and data.
  3. What is View?
    Answer: User interface (JSP, HTML).
  4. What is Controller?
    Answer: Handles requests and connects Model and View.
  5. Why use MVC?
    Answer: To separate logic and UI.
  6. What is MVC mapping?
    Answer: Linking URLs to controllers.
  7. Role of Controller?
    Answer: Processes input and returns View.
  8. What is deployment?
    Answer: Running application on server.
  9. Which file defines routing?
    Answer: web.xml.
  10. Example of View technology.
    Answer: JSP.
  11. Benefit of MVC.
    Answer: High maintainability.
  12. Example of Controller in Java.
    Answer: Servlet.



EXERCISE 4 – SPRING MVC (VIVA WITH ANSWERS)

  1. What is Spring MVC?
    Answer: A Java framework using MVC design.
  2. What is DispatcherServlet?
    Answer: The front controller of Spring MVC.
  3. Where is DispatcherServlet configured?
    Answer: In web.xml.
  4. Use of @Controller?
    Answer: Marks a class as a Controller.
  5. Use of @RequestMapping?
    Answer: Maps URLs to methods.
  6. What are Spring Beans?
    Answer: Objects managed by Spring container.
  7. Where to define beans?
    Answer: XML or annotations.
  8. What is ViewResolver?
    Answer: Finds which JSP page to load.
  9. What is applicationContext.xml?
    Answer: Spring configuration file.
  10. Use of Maven?
    Answer: Dependency management.
  11. What is Model?
    Answer: Carries data to the View.
  12. How to return JSP?
    Answer: Return the logical view name.
  13. How to run Spring MVC?
    Answer: Deploy on server like Tomcat.
  14. What is InternalResourceViewResolver?
    Answer: Maps view names to JSP paths.
  15. Why is Spring MVC popular?
    Answer: Lightweight and annotation-based.



EXERCISE 5 – HIBERNATE (VIVA WITH ANSWERS)

  1. What is Hibernate?
    Answer: A Java ORM framework.
  2. What is ORM?
    Answer: Object Relational Mapping.
  3. What is POJO?
    Answer: Simple Java class with getters/setters.
  4. What is hibernate.cfg.xml?
    Answer: Hibernate configuration file.
  5. What is SessionFactory?
    Answer: Creates Session objects.
  6. What is Session?
    Answer: Used to interact with database.
  7. How to save an object?
    Answer: Using session.save().
  8. What is HQL?
    Answer: Hibernate Query Language.
  9. Hibernate annotations?
    Answer: @Entity, @Id, @Table etc.
  10. What is inheritance mapping?
    Answer: Mapping parent-child classes.
  11. What are associations?
    Answer: One-to-One, One-to-Many, Many-to-Many.
  12. What is a Transaction?
    Answer: A unit of work using beginTransaction().
  13. What is Criteria API?
    Answer: Programmatic query building.
  14. What is lazy loading?
    Answer: Loads data only when required.
  15. Benefit of Hibernate?
    Answer: Reduces boilerplate code.

EXERCISE 6 – DEBUGGING TOOLS (VIVA WITH ANSWERS)

  1. What is debugging?
    Answer: Finding and fixing errors.
  2. Two Java debugging tools.
    Answer: Eclipse, IntelliJ.
  3. What is a breakpoint?
    Answer: A point where execution stops.
  4. What is Step Into?
    Answer: Goes inside method calls.
  5. What is Step Over?
    Answer: Skips entering method.
  6. What is Step Return?
    Answer: Exits a method and returns.
  7. Debug perspective?
    Answer: Shows variables, stack, breakpoints.
  8. Watch window?
    Answer: Shows values of variables.
  9. What is runtime error?
    Answer: Error during execution.
  10. What is Exception?
    Answer: Abnormal event breaking flow.
  11. How to inspect variables?
    Answer: Using the Variables window.
  12. Why is debugging important?
    Answer: Ensures correctness and stability.