0% found this document useful (0 votes)
6 views3 pages

Viva Question Are Based On The Code

The document provides explanations for various web development concepts including HTML forms, CSS types, Flask framework, database normalization, and the workings of a web solution. It details how HTML forms send data to a server, the types of CSS used, the purpose of Flask and its routing, as well as database normalization forms. Additionally, it describes the interaction between front-end and back-end components, and explains the differences between GET and POST methods in web applications.

Uploaded by

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

Viva Question Are Based On The Code

The document provides explanations for various web development concepts including HTML forms, CSS types, Flask framework, database normalization, and the workings of a web solution. It details how HTML forms send data to a server, the types of CSS used, the purpose of Flask and its routing, as well as database normalization forms. Additionally, it describes the interaction between front-end and back-end components, and explains the differences between GET and POST methods in web applications.

Uploaded by

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

Viva question are based on the code you have implemented and how it works.

1. How HTML form works, what is action in HTML form


2. Which type of CSS you have used
3. What is Flask, what is routes in flask
4. Explain your DB Model, which normalisation form you have applied
5. Explain the working of your solution
ChatGPT said:
ChatGPT
Here are the answers to your viva questions:

1. How HTML Form Works, What is Action in HTML Form


An HTML form allows users to input data, which can be sent to a server for
processing. It uses the <form> tag.
Action in an HTML form specifies the URL where the form data will be sent for
processing. It is typically used to point to the server-side script or endpoint
that handles the data when the form is submitted. Example: <form action="/submit"
method="POST">
In this example, the form data is sent to the /submit URL when the form is
submitted.
2. Which Type of CSS You Have Used
External CSS: If the styles are defined in a separate CSS file that is linked to
the HTML document using the <link> tag. Example: <link rel="stylesheet"
type="text/css" href="styles.css">
Internal CSS: If the styles are written directly inside the <style> tag within the
<head> section of the HTML document. Example: <style> body { background-color:
#f0f0f0; } </style>
Inline CSS: If the styles are applied directly to an HTML element using the style
attribute. Example: <div style="color: red;">
3. What is Flask, What Are Routes in Flask
Flask is a micro web framework for Python that allows developers to build web
applications easily. It is lightweight and flexible, providing the essentials for
developing web apps, such as URL routing, handling requests, and rendering
templates.
Routes in Flask define the URL patterns that map to specific functions. These
routes are used to handle different HTTP methods (GET, POST, etc.). Each route is
associated with a function that will be executed when the route is accessed.
Example:
python
Copy code
@app.route("/home")
def home():
return "Welcome to the Home Page"
4. Explain Your DB Model, Which Normalization Form You Have Applied
The DB Model typically refers to how the database schema is designed, including
tables and relationships.
Normalization is a technique used to organize database tables to reduce redundancy
and improve data integrity.
First Normal Form (1NF): Each column contains atomic values, and each record is
unique.
Second Normal Form (2NF): The database is in 1NF, and all non-key columns are fully
dependent on the primary key.
Third Normal Form (3NF): The database is in 2NF, and all columns are non-
transitively dependent on the primary key (i.e., no non-key column depends on
another non-key column).
Example: If you have a Student table, it will not store redundant student details
in multiple rows but instead relate to other tables like Course through a foreign
key.
5. Explain the Working of Your Solution
The solution works by integrating a web front-end (HTML, CSS) with a back-end logic
(Flask, database).
Form Handling: Users interact with forms (like student registration, login) on the
front end, and data is submitted to the Flask server.
Flask Routes: Flask handles the routes, processes the submitted data, and interacts
with the database to store or retrieve information.
Database: The database is structured based on the normalized schema to store
information like student details, courses, and assignments.
Logic: The back-end processes involve validating user inputs, performing necessary
calculations or queries, and returning the response to the front-end.
Example: When a student logs in, the server checks their credentials in the
database. If valid, they are redirected to their dashboard; otherwise, an error is
shown.
These explanations should help you in the viva!

You said:
GET, POST,
ChatGPT said:
ChatGPT
Here’s an explanation of GET and POST methods commonly used in web development:

GET Method
Purpose: Used to request data from a server. It is primarily used to retrieve
information.

Characteristics:

The data is sent as part of the URL, appended as query parameters.


Example: http://example.com/search?query=python
The parameters are visible in the URL, making it less secure for sensitive data.
GET requests can be bookmarked and cached by browsers.
It has size limitations for the URL (varies by browser).
It is idempotent, meaning repeated requests produce the same result.
Example in Flask:

python
Copy code
@app.route("/search")
def search():
query = request.args.get("query")
return f"Searching for {query}"
POST Method
Purpose: Used to send data to the server for processing, such as submitting a form.

Characteristics:

The data is sent in the body of the HTTP request, making it more secure for
sensitive information.
It does not have size limitations like GET.
POST requests are not idempotent, meaning repeated requests can result in different
outcomes (e.g., submitting a form twice might create two entries).
It cannot be bookmarked or cached by browsers.
Example in Flask:
python
Copy code
@app.route("/submit", methods=["POST"])
def submit():
data = request.form["name"]
return f"Hello, {data}"
Key Differences:
Aspect GET POST
Purpose Retrieve data Submit data
Data Visibility Visible in the URL Hidden in the request body
Data Length Limited Unlimited
Use Case Fetching data (e.g., search) Submitting forms
Both methods are essential in web applications and are used depending on the
specific use case.

You might also like