-
1
Show your College ID.Times asked 16Official solution
SimpleCamera pe clearly IITM/college ID dikhao — naam photo match.
Pehle se ID haath mein rakho. Glare mat aane do. Examiner screenshot/verify karta hai. Iske baad GitHub + project run.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
2
Verify GitHub collaborator access.Times asked 3Official solution
SimpleGitHub repo public/private policy ke hisaab, MAD-1 collaborator add, commits dikhao.
Repo → Settings → Collaborators → instructor added.
Commits: git log / GitHub History — regular commits better, ek dum 1 commit suspicious.
README + report mein AI usage likha hona chahiye agar use kiya.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
3
Download the project from the Viva Portal.Times asked 7Official solution
SimpleExaminer submitted ZIP chahta hai, local extra changes nahi.
Portal se ZIP download → extract → venv → pip install -r requirements.txt → flask run / python app.py.
Checksum maange to hash match karke dikhao. Camera/OPPE setup unke instructions.
Linux/Mac: paths, gunicorn; Windows paths alag ho to relative paths use karo.
Do browsers: admin + user parallel demo impressive lagta hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
4
Show your project report (to verify LLM/AI usage declaration).Times asked 1Official solution
SimpleSach bolo. AI se boilerplate/docs theek, logic samajh ke explain karo.
'Boilerplate aur CSS ke liye AI use kiya, models/routes khud design kiye. Report mein X% mention hai.'
Line-by-line nahi explain kar paoge to examiner pakad lega. Documentation: official Flask/SQLAlchemy + course lectures.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
5
Demonstrate the complete application.Times asked 33Official solution
SimpleDemo script pehle se practice karo, 5-7 minute, saari roles.
Suggested flow
1) Register/login user 2) Admin login — CRUD 3) Approval/blacklist 4) Booking/apply 5) Search 6) Validation edge (slots 0, duplicate) 7) Logout
Bolte-bolte dikhao: 'Yahan overbooking rokta hoon'. Code tab kholna jab poochhein.
Crash ho to debug calmly: terminal error, typo, DB path.
Mandatory features skip mat karna — examiner list tick karta hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
6
Demonstrate CRUD operations.Times asked 1Official solution
SimpleCRUD = Create, Read, Update, Delete — kisi bhi resource ke 4 basic operations.
Create: POST, db.session.add(new_user); commit() — register, add trek.
Read: GET, User.query.all() — dashboard list.
Update: POST/PUT, user.name = 'Ram'; commit() — edit profile.DeletePOST/DELETE, db.session.delete(obj); commit().
REST mapping: POST create, GET read, PUT/PATCH update, DELETE delete.
Admin panel mein yeh 4 dikhana viva demo ka common task hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
7
Show any additional features you implemented beyond the project requirements.Times asked 1Official solution
Simple2-3 honest improvements + 1 security + 1 UX.
Example
password hashing/CSRF tighter, Redis cache, tests, pagination, email verify, rate limit login, better mobile CSS.Challenges: relationships/cascade, concurrent booking, Jinja inheritance.
Rate: 7-8/10 with reason — 10/10 arrogant, 3/10 confidence khatam.
Security extra: HTTPS, hashed passwords, CSRF, SQL injection (ORM), login attempts, file type check.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
8
Explain how you prevent duplicate submissions (e.g., student applying multiple times).Times asked 1Official solution
SimpleDuplicate/overbook rokne ke liye DB constraint + route check dono.
Pehle query: Booking.query.filter_by(user_id=uid, trek_id=tid).first()
Agar exists: flash('Already booked'); return
Slots: if trek.available <= 0: reject else trek.available -= 1; commit
Race condition: unique(user_id, trek_id) constraint — do tabs se double click pe bhi ek hi row.
Blacklist: login pe is_blacklisted check.
Active drive limit: if Company ke paas status=open drive hai to naya mat banne do.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
9
Explain the backend logic for a booking/application workflow.Times asked 1Official solution
Examiner code pe ungli rakh ke poochta hai — panic mat karo, 4-line formula bolo.
1) Yeh file/line kya role hai (model / route / template / config)?
2) Input kahan se aata hai (form, URL <id>, session, JSON)?
3) DB pe kya query/write?
4) Output kya (render_template / redirect / jsonify)?Example
@app.route('/book/<int:id>', methods=['POST']) — logged-in user session se, trek id URL se, Booking add, slots--, redirect history.Unknown line: imports (request, url_for, flash), decorators, if checks, commit — har keyword ka reason ready rakho.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
10
Explain how you would implement duplicate prevention if it is not already implemented.Times asked 1Official solution
SimpleDuplicate/overbook rokne ke liye DB constraint + route check dono.
Pehle query: Booking.query.filter_by(user_id=uid, trek_id=tid).first()
Agar exists: flash('Already booked'); return
Slots: if trek.available <= 0: reject else trek.available -= 1; commit
Race condition: unique(user_id, trek_id) constraint — do tabs se double click pe bhi ek hi row.
Blacklist: login pe is_blacklisted check.
Active drive limit: if Company ke paas status=open drive hai to naya mat banne do.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
11
Explain models.py.Times asked 21Official solution
Simplemodels.py har table ki class hai — columns, PK/FK, relationships. Yeh Model layer hai.
Viva mein file khol ke bolo:
1) Kaunsi classes/tables hain (User, Role-specific, Booking...)
2) Har table ka kaam 1 line
3) Relationships: 1-1 / 1-M / M-M, backref, cascade, lazy
4) Constraints: unique email, nullable, default statusExample skeleton
class User(db.Model): id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(120), unique=True, nullable=False) role = db.Column(db.String(20), default='user') bookings = db.relationship('Booking', backref='user', cascade='all, delete-orphan')ER diagram: rectangles entities, lines relationships, PK/FK mark. Schema = yahi structure.
Tables create: db.create_all() ya migrations. SQLite file SQL viewer se dikha sakte ho.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
12
Explain one complete route from your project.Times asked 1Official solution
SimpleRoutes/controllers URLs handle karte hain. app.py app banata hai, models.py data, templates/ views, static/ CSS-JS.
Typical structure:
app.py / __init__.py → Flask app, db.init, register blueprints
models.py → tables
routes.py / views → @app.route functions
templates/ → Jinja HTML
static/ → css, images
instance/*.db → SQLiteEk route explain karne ka template:
1) URL + methods 2) Auth/role check 3) Form/query se data 4) Business rule (duplicate, slots) 5) db.session 6) render ya redirectExample GET+POST same route: GET form, POST save.
Data HTML se: form name= → request.form. Data HTML ko: render_template(..., items=query).
Nayi .py file: import karke use karo, warna Flask ko pata nahi. Folder rename: imports/paths/templates check.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
13
Explain the login logic.Times asked 1Official solution
SimpleLogin GET form dikhata hai, POST credentials check karke session set karta hai.
@app.route('/login', methods=['GET','POST']) def login(): if request.method == 'POST': u = User.query.filter_by(email=request.form.get('email')).first() if u and check_password_hash(u.password, request.form.get('password')): if getattr(u, 'blacklisted', False): flash('Blocked'); return redirect(url_for('login')) session['user_id'] = u.id session['role'] = u.role return redirect(url_for('dashboard')) flash('Invalid') return render_template('login.html')Logout: session.clear(); redirect login. Incognito alag cookie jar — logged out dikhega.
Single login page: role se redirect alag dashboards.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
14
Explain the logic for blocking specific users/routes.Times asked 1Official solution
SimpleRoutes/controllers URLs handle karte hain. app.py app banata hai, models.py data, templates/ views, static/ CSS-JS.
Typical structure:
app.py / __init__.py → Flask app, db.init, register blueprints
models.py → tables
routes.py / views → @app.route functions
templates/ → Jinja HTML
static/ → css, images
instance/*.db → SQLiteEk route explain karne ka template:
1) URL + methods 2) Auth/role check 3) Form/query se data 4) Business rule (duplicate, slots) 5) db.session 6) render ya redirectExample GET+POST same route: GET form, POST save.
Data HTML se: form name= → request.form. Data HTML ko: render_template(..., items=query).
Nayi .py file: import karke use karo, warna Flask ko pata nahi. Folder rename: imports/paths/templates check.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
15
Show and explain all project files.Times asked 1Official solution
Examiner code pe ungli rakh ke poochta hai — panic mat karo, 4-line formula bolo.
1) Yeh file/line kya role hai (model / route / template / config)?
2) Input kahan se aata hai (form, URL <id>, session, JSON)?
3) DB pe kya query/write?
4) Output kya (render_template / redirect / jsonify)?Example
@app.route('/book/<int:id>', methods=['POST']) — logged-in user session se, trek id URL se, Booking add, slots--, redirect history.Unknown line: imports (request, url_for, flash), decorators, if checks, commit — har keyword ka reason ready rakho.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
16
Show all HTML files.Times asked 1Official solution
SimpleDemo script pehle se practice karo, 5-7 minute, saari roles.
Suggested flow
1) Register/login user 2) Admin login — CRUD 3) Approval/blacklist 4) Booking/apply 5) Search 6) Validation edge (slots 0, duplicate) 7) Logout
Bolte-bolte dikhao: 'Yahan overbooking rokta hoon'. Code tab kholna jab poochhein.
Crash ho to debug calmly: terminal error, typo, DB path.
Mandatory features skip mat karna — examiner list tick karta hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
17
Explain a Jinja for loop from your HTML template.Times asked 1Official solution
SimpleJinja2 Flask ka template engine hai. HTML ke andar Python-jaisa data print/loop/if kar sakte ho.
Bina Jinja har user ke liye alag HTML file. Jinja se ek template + data.
{{ user.name }} print, {% for x in items %} loop, {% if %} condition, {% extends %} layout.Example routereturn render_template('dash.html', treks=treks)
dash.html: {% for t in treks %}<li>{{ t.name }}</li>{% endfor %}
HTML files templates/ folder mein isliye kyunki Flask default wahan dhundhta hai. render_template Jinja ko run karta hai.
Boolean Jinja handle karta hai: {% if user.is_admin %}.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
18
Explain where you handled a specific error in your project.Times asked 1Official solution
Examiner code pe ungli rakh ke poochta hai — panic mat karo, 4-line formula bolo.
1) Yeh file/line kya role hai (model / route / template / config)?
2) Input kahan se aata hai (form, URL <id>, session, JSON)?
3) DB pe kya query/write?
4) Output kya (render_template / redirect / jsonify)?Example
@app.route('/book/<int:id>', methods=['POST']) — logged-in user session se, trek id URL se, Booking add, slots--, redirect history.Unknown line: imports (request, url_for, flash), decorators, if checks, commit — har keyword ka reason ready rakho.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
19
What is MVC?Times asked 9Official solution
SimpleMVC = Model-View-Controller. Code ko 3 hisson mein baant ta hai taaki mix na ho.
Model: data + DB. models.py — User, Trek, Booking classes.
View: jo user dekhta hai. templates/*.html + Jinja.
Controller: beech ka logic. routes / app.py — request lo, model se data, view ko do.Example flow (register):
Browser form POST → Controller register() → User model save → redirect → View dashboard.htmlDraw: Browser → Controller → Model → DB, phir Controller → View → Browser.
ORM na ho to bhi MVC ho sakta hai — Model raw SQL functions ho sakte hain. Structure matter karta hai, library nahi.
MVP/MVVM doosri architectures hain; MAD1 mein MVC expected hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
20
Difference between Authentication and Authorization (with examples from your project).Times asked 1Official solution
SimpleAuthentication poochta hai "tu kaun hai?", Authorization poochta hai "tujhe yeh kaam karne ki permission hai?"
Authentication: login. Username + password check karke prove karte ho ki tum genuine user ho. Success pe session/token milta hai.
Authorization: uske baad role check. Admin hi parking lot delete kar sakta hai, normal user nahi.Example (Flask):
# Authenticationif user and check_password_hash(user.password, form_password): session['user_id'] = user.id # Authorization if session.get('role') != 'admin': abort(403) # logged in ho, lekin allowed nahiProject example: student login = authentication. Student admin dashboard nahi khol sakta = authorization.
Validation alag cheez hai (form sahi bhara hai ya nahi, jaise age 18+).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
21
Explain all HTTP request methods.Times asked 3Official solution
SimpleHTTP methods batate hain request kya karna chahti hai. Common: GET POST PUT PATCH DELETE.
GETread/fetch. Safe, URL se. Page kholna, search.
POSTcreate/submit. Form, login.
PUTpoora replace/update. Idempotent.
PATCHpartial update.
DELETEhataana.
HEAD: sirf headers. OPTIONS: CORS preflight.
Flask: @app.route('/x', methods=['GET','POST'])
Agar methods na likho to default sirf GET.
HTML form native sirf GET/POST. PUT/DELETE JS/fetch ya hidden _method se.
GET se data fetch ho sakta hai, create nahi karna chahiye. POST se theoretically fetch ho sakta hai lekin cache/semantics galat.
DELETE fetch ke liye nahi. GET POST ka kaam officially nahi karta — side effects GET pe mat rakho.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
22
Difference between POST and PUT.Times asked 4Official solution
SimplePOST nayi cheez create karta hai, PUT existing cheez ko replace/update karta hai.
POST /books → naya book add. Har baar naya ID banega. Idempotent nahi — 2 baar POST = 2 records.
PUT /books/5 → id=5 wale book ko poora update. Same PUT dubara bhejo to same result (idempotent).PUT se create bhi ho sakta hai (agar ID client decide kare), lekin REST convention: create = POST, replace = PUT, partial = PATCH.
Example
@app.route('/user', methods=['POST']) # register naya user @app.route('/user/<int:id>', methods=['PUT']) # poora profile replaceHTML <form> PUT nahi bhejta, isliye Flask apps mein edit pe bhi POST use hota hai. Examiner ko yeh reason clearly bolo.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
23
Difference between PUT and FETCH.Times asked 1Official solution
SimpleGET read karta hai, PUT existing resource replace/update karta hai.
GET /users/1 → data lao, side-effect nahi. PUT /users/1 → poora user update, idempotent.
PUT vs FETCH: FETCH HTTP method nahi, JS fetch() function hai jo GET/PUT/POST kuch bhi bhej sakta hai.
Search GET, edit-save PUT/POST. GET se create mat karo.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
24
What is Template Inheritance?Times asked 10Official solution
Simpleextends poora layout inherit karta hai, include chhota piece insert karta hai.
extends: child page base.html ka structure use karti hai, blocks override karti hai. Ek hi parent.
include: navbar.html / footer.html jahan chaho insert. Kai baar use ho sakta hai.base.html:
{% block content %}{% endblock %} home.html: {% extends 'base.html' %} {% block content %}<h1>Home</h1>{% endblock %} {% include 'navbar.html' %} → navbar har page peFayda: header/footer ek jagah, change once — saari pages update. MAD1 mein almost har project use karta hai.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
25
What is Cascade (Cascading) in databases?Times asked 1Official solution
SimpleCascade parent ke saath child pe automatic action (generally delete).
Company delete → uski drives bhi delete, warna orphan rows / FK error.
SQLAlchemy: db.relationship('Drive', cascade='all, delete-orphan', backref='company')
SQL: ForeignKey(..., ondelete='CASCADE')Cascade sirf delete nahi: save-update, merge, refresh-expire, expunge, delete-orphan.
Cascade Update: parent PK change to child FK update (rare, PK mat badlo).
Parent delete jab children active hon: constraint error, ya cascade se children gayab, ya pehle children handle karo — design choice examiner poochta hai.
CSS cascading alag topic hai (styles inherit/override).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
26
What does lazy=True mean in SQLAlchemy?Times asked 1Official solution
SimpleSQLAlchemy Python ka sabse popular ORM hai. MAD1 mein Flask-SQLAlchemy wrapper use hota hai.
db = SQLAlchemy(app)
class Book(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(80), nullable=False) Operations: db.session.add(obj), .commit(), .delete(obj), Model.query.all(), .filter_by(), .get_or_404(id). db.Model ek class hai (function nahi). db object engine + session + metadata hold karta hai.SQLALCHEMY_TRACK_MODIFICATIONS=False extra signals band karta hai, performance warning hatati hai.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
27
What are Flash Messages?Times asked 1Official solution
Simpleflash() ek baar dikhne wala message session mein store karta hai — 'Login successful'.
flash('Invalid password', 'danger')
Template
{% with messages = get_flashed_messages(with_categories=True) %}JS se auto-hide bhi kar sakte ho.
SECRET_KEY chahiye kyunki flash session use karta hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
28
If an admin deletes a parking lot (or similar parent record) that has active bookings, what will happen?Times asked 1Official solution
Yeh MAD-1 viva question tumhare project ke context se linked hai. Short answer is structure se do:
Pehle 1 line definition/purpose, phir tumhare project ka example, phir chhota code/flow.
Typical Flask flowBrowser request → @app.route controller → SQLAlchemy model/DB → Jinja template response.
Auth: session['user_id'] + role check. CRUD: add/commit, query.all, field update, delete.
Live change maange to: related model → route → template, phir browser refresh karke dikhao.Example (generic create):
obj = Model(name=request.form.get('name'))db.session.add(obj); db.session.commit() return redirect(url_for('list_view'))Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
29
How would you change the appearance/layout of the Admin Dashboard?Times asked 1Official solution
Yeh live UI/CSS change hai. Examiner jo element bole uski CSS turant badlo.
Bootstrap class badlo (btn-primary → btn-success, bg-dark → bg-warning) ya inline style='color:red; background:#eee'.
Center: d-flex justify-content-center text-center. Navbar neeche: navbar fixed-bottom.Example
<button class='btn btn-success' style='background:#16a34a'>Book</button>Pehle browser inspect karke class dhundo, phir template mein change karke refresh.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
30
Write a simple Hello World route in Notepad.Times asked 1Official solution
Simple Hello World — notepad mein yeh likh ke run karke dikhao:
from flask import Flask app = Flask(__name__) @app.route('/') def home(): return 'Hello World' if __name__ == '__main__': app.run(debug=True) Jinja version: return render_template('hello.html', name='Shubham')hello.html: <h1>Hello {{ name }}</h1>
POST-only: @app.route('/x', methods=['POST'])Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
31
Write a route that accepts two numbers as input and returns their sum along with the string "Hello".Times asked 1Official solution
SimpleURL parameters se numbers lo, calculate karke return/render.
@app.route('/sum/<int:a>/<int:b>') def add(a, b): return f'Hello, sum is {a+b}'Product: a*b. Square: n*n. Even/odd: 'even' if n%2==0 else 'odd'.
Form se: request.form.get('a', type=int). Background color even/odd:
color = 'green' if n%2==0 else 'red'return render_template('page.html', color=color)CSS: body { background: {{ color }}; }
Patternfilter query → template/JSON. Examiner jo entity bole us class ka naam use karo.
@app.route('/admin/blacklisted') def blacklisted(): rows = User.query.filter_by(is_blacklisted=True).all() return render_template('list.html', rows=rows) JSON: return jsonify([{'id': r.id, 'name': r.name} for r in rows]) ID se: User.query.get_or_404(id) Do filters: .filter(Drive.approved==False, Drive.title=='Data Scientist')Join example: students jinhone blacklisted company ke drive pe apply kiya — join Application-Drive-Company.
PUT@app.route('/x/<int:id>', methods=['PUT']) + request.get_json()
url param display: @app.route('/show/<int:id>') return render_template('show.html', id=id)
Form → next page: POST values render_template('out.html', **request.form)
Count: return str(User.query.filter_by(is_blacklisted=True).count())Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet