-
1
Tell me about yourself.Times asked 6Official solution
Simple20-30 second intro, phir ID nikaal ke rakhna.
Example'Namaste, main <Name> hoon, IITM BS degree, MAD-1 project <ProjectName> — Flask, SQLAlchemy, Jinja. Roles: Admin, Staff, User. CRUD, auth, search implement kiye.'
Interest poochhe to ek genuine cheez (ML, web, cricket) + 1 line. Fake buzzwords mat maaro.
End mein feedback maangna theek hai: 'Koi improvement suggest karenge?'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
Explain the project/problem statement.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
-
3
Give a complete demo of your application.Times asked 2Official 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
-
4
Explain all functionalities of your application.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
-
5
What additional features have you implemented?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
-
6
What challenges did you face while building the project?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
-
7
What did you learn from this project?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
Create a Reset/Clear button on the login page to clear username and password.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
-
9
Delete all users from the database (handling foreign key constraints).Times asked 1Official solution
SimpleForeign Key doosri table ki PK ko refer karti hai, relationship + referential integrity.
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)Invalid user_id insert nahi hoga. FK unique nahi hona zaroori — One-to-Many mein same user_id kai rows.
FK + PK same column: 1-1 sharing, jaise AdminProfile.id = FK to user.id.
Should FK always unique? Nahi. Tab One-to-One chahiye ho tab unique.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
Handle duplicate usernames using database constraints/validation.Times asked 1Official solution
SimpleConstraints rules hain jo galat data rok te hain. Referential integrity FK valid parent ko point kare.
PK, FK, UNIQUE, NOT NULL, CHECK (age >= 18). ORM Column flags yahi map karte hain.
SQL = language tables se baat. Database organized data store.
SQL View: saved query, table jaisi dikhti hai, data copy nahi.
Cluster: kai DB servers together (HA/scale) — MAD1 SQLite single file.
Entity mapping: class User → table user, attributes → columns.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
Change a Bar Chart to a Pie Chart.Times asked 1Official solution
SimpleChart.js frontend library. Backend counts bhejta hai, JS graph banata hai.
stats = {'booked': 10, 'cancelled': 2}
render_template('summary.html', stats=stats) new Chart(ctx, {type:'bar', data:{labels:[...], datasets:[{data:[...]}]}})Dynamic: har load pe query. Pie vs bar: Chart type change. Colors: backgroundColor array.
Swap graphs: HTML do canvas ki jagah badlo.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
Change chart colors.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
-
13
Add admin search functionality.Times asked 1Official solution
SimpleSearch box GET form, backend query filter, results template mein.
q = request.args.get('q', '').strip() results = Doctor.query.filter(Doctor.name.ilike(f'%{q}%')).all() if q else [] return render_template('search.html', results=results, q=q)Jinja: {{ results|length }} matches. Empty: 'No results'.
JS-only filter: saara data pehle load, client filter — chhote lists. Bada data: server search.
Search generally GET (shareable URL). Count: len(results) ya db.func.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
-
14
Create a Delete All button.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
-
15
Delete multiple selected records.Times asked 1Official solution
Yeh feature demo hai. Account ready rakho, steps bol ke dikhao.
Role ke hisaab login → action (create/approve/book) → DB/UI pe result → edge case (fail when slots=0 / blacklisted).
Do browser windows: admin + user. Search/filter alag se dikhao.
Agar feature nahi hai to sach bolo aur 2 minute mein kaise add karoge (query + template) explain 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
-
16
Delete a specific searched record.Times asked 1Official solution
Yeh feature demo hai. Account ready rakho, steps bol ke dikhao.
Role ke hisaab login → action (create/approve/book) → DB/UI pe result → edge case (fail when slots=0 / blacklisted).
Do browser windows: admin + user. Search/filter alag se dikhao.
Agar feature nahi hai to sach bolo aur 2 minute mein kaise add karoge (query + template) explain 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
-
17
Add a discount/promo code feature during checkout.Times asked 1Official solution
Yeh project-specific feature add/modify hai. 4 layers touch karo: model, route, template, validation.
1) Data chahiye to models.py mein column/relationship + DB update (ALTER / migrate / create_all).
2) Route: GET pe form/page, POST pe request.form se save, flash + redirect.
3) Template: input name=... Jinja se {{ obj.field }} display.
4) Rule: duplicate, range, role check backend pe.Example naya field 'city':
user.city = db.Column(db.String(50)) user.city = request.form.get('city') <input name='city'> ... {{ user.city }}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
Change rating input from radio buttons to star ratings.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
-
19
Add a button to redirect Admin to the User/Login page.Times asked 1Official solution
Simpleredirect browser ko naya URL pe GET karne ko kehta hai (generally 302).
return redirect(url_for('dashboard'))Login/register/delete ke baad use karo taaki refresh duplicate POST na kare.
Doosra page dikhana hai with new request — redirect. Same request pe HTML — render_template.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
Create a single login page for multiple user roles.Times asked 1Official solution
Yeh project-specific feature add/modify hai. 4 layers touch karo: model, route, template, validation.
1) Data chahiye to models.py mein column/relationship + DB update (ALTER / migrate / create_all).
2) Route: GET pe form/page, POST pe request.form se save, flash + redirect.
3) Template: input name=... Jinja se {{ obj.field }} display.
4) Rule: duplicate, range, role check backend pe.Example naya field 'city':
user.city = db.Column(db.String(50)) user.city = request.form.get('city') <input name='city'> ... {{ user.city }}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
Implement password validation: Minimum/maximum length Uppercase Lowercase Number Special characterTimes asked 1Official solution
SimpleValidation galat data rok ti hai — frontend turant, backend must.
Frontend: required, min='18', maxlength='8', pattern='(?=.*[A-Z]).{8,}'
Backend example:pwd = request.form.get('password','') if len(pwd) < 8 or not re.search(r'[A-Z]', pwd) or not re.search(r'[0-9]', pwd): flash('Weak password')Haan, regex se password rules ho sakte hain.
Age 18-99, date >= today, slots <= 30 and > 0, confirm password == password, email '@' .
Duplicate username: User.query.filter_by(email=email).first() or unique=True catch IntegrityError.
Past date: if date < date.today(): reject. Negative slots: if slots < 0: reject; book pe available > 0 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
-
22
Add password security (hashing/protection).Times asked 1Official solution
Yeh project-specific feature add/modify hai. 4 layers touch karo: model, route, template, validation.
1) Data chahiye to models.py mein column/relationship + DB update (ALTER / migrate / create_all).
2) Route: GET pe form/page, POST pe request.form se save, flash + redirect.
3) Template: input name=... Jinja se {{ obj.field }} display.
4) Rule: duplicate, range, role check backend pe.Example naya field 'city':
user.city = db.Column(db.String(50)) user.city = request.form.get('city') <input name='city'> ... {{ user.city }}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
Add a new field (e.g., City) to the registration form and database.Times asked 1Official solution
Simple 4-step: Model → DB → Form → Route → Template. Yeh sabse common live-coding hai.
1) models.py: age = db.Column(db.Integer, nullable=True)
2) DB: SQLite viewer se column, ya DB delete karke create_all, ya ALTER TABLE user ADD COLUMN age INTEGER; production mein Flask-Migrate.
3) register.html: <input type='number' name='age' min='18' required>
4) route: user.age = request.form.get('age', type=int); commit
5) dashboard: {{ user.age }} admin table mein <td>{{ u.age }}</td>Print terminal: print('AGE', request.form.get('age'))
Phone/city same pattern, String(20). Openings on Drive: integer column + form + create_drive route.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
Change background color/image of pages.Times asked 1Official solution
Simpleexaminer UI tweak maangta hai — CSS class ya inline, instantly dikhao.
Button color: <button class='btn btn-success'> ya style='background:#22c55e;color:#fff'
Navbar: navbar-dark bg-success / style='background:yellow' / fixed-bottom se neeche.
Center: .wrap { display:flex; justify-content:center; align-items:center; min-height:100vh; }
text-align:center heading ke liye. Bootstrap: d-flex justify-content-center, mx-auto, text-center.
Hover: .btn:hover { opacity:0.8; transform:scale(1.02); }
Half width: class='col-6' ya width:50%. Row→column: flex-direction:column / col-12 stack.
Login card: card shadow p-4 mx-auto (max-width:400px).
Table header green: th { background:green; color:white; } Bold column: td:nth-child(2){font-weight:bold}
Box shadow: box-shadow: 4px 4px 12px rgba(0,0,0,.3);
Background image: body { background: url('/static/bg.jpg') center/cover; }
Reset button: <button type='reset'>Clear</button>
Move button: ms-auto / position / flex order.
Jinja dashboard heading: <h1>{{ user.name }}'s Dashboard</h1>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
Create a table inside another table.Times asked 1Official solution
Yeh project-specific feature add/modify hai. 4 layers touch karo: model, route, template, validation.
1) Data chahiye to models.py mein column/relationship + DB update (ALTER / migrate / create_all).
2) Route: GET pe form/page, POST pe request.form se save, flash + redirect.
3) Template: input name=... Jinja se {{ obj.field }} display.
4) Rule: duplicate, range, role check backend pe.Example naya field 'city':
user.city = db.Column(db.String(50)) user.city = request.form.get('city') <input name='city'> ... {{ user.city }}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
Display dashboard summary in an HTML table.Times asked 1Official solution
Yeh list filter/sort/display task hai. Query badlo, template same rakh sakte ho.
rows = Model.query.filter_by(status='approved').order_by(Model.name.asc()).all()Jinja: {% for r in rows %}<tr><td>{{ r.name|upper }}</td></tr>{% endfor %}
{{ rows|length }} count dikhane ke liye.Alphabet sort: order_by(Model.name). Status filter: filter_by(status='pending').
Assigned staff column: relationship se {{ booking.staff.name }}.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
Change Flask application port.Times asked 1Official solution
SimpleFlask default port 5000. Change: app.run(port=8000) ya env PORT, ya flask run --port 8000.
if __name__ == '__main__': app.run(debug=True, host='0.0.0.0', port=8000)Do apps ek saath: alag ports. Occupied port: error, doosra number try.
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
Make the project compatible with Linux/Mac.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
Implement search functionality with proper matching.Times asked 1Official solution
SimpleSearch box GET form, backend query filter, results template mein.
q = request.args.get('q', '').strip() results = Doctor.query.filter(Doctor.name.ilike(f'%{q}%')).all() if q else [] return render_template('search.html', results=results, q=q)Jinja: {{ results|length }} matches. Empty: 'No results'.
JS-only filter: saara data pehle load, client filter — chhote lists. Bada data: server search.
Search generally GET (shareable URL). Count: len(results) ya db.func.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
-
30
Approve all professionals using one button.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
-
31
Why did you use Flask?Times asked 1Official solution
SimpleFlask Python ka micro web framework hai — routes, templates, request/response handle karta hai.
from flask import Flask app = Flask(__name__) @app.route('/') def home(): return 'Hello' app.run(debug=True) # default port 5000__name__ se Flask ko pata chalta hai templates/static kahan se load karni hai. Hataoge to resource paths toot sakte hain.
Faydesimple, flexible, MAD1 syllabus. Nuksaan: bade features (admin, auth) khud jodne padte hain.
app.run() development server start karta hai. Production mein gunicorn/waitress.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
32
Advantages and disadvantages of Flask.Times asked 1Official solution
SimpleFlask halka aur flexible hai, lekin bade features khud jodne padte hain.
Faydesimple syntax, MAD1/docs abundant, jo chahiye woh library (SQLAlchemy, Login).
NuksaanDjango jaisa ready admin/auth nahi, structure khud decide, badi team mein inconsistency.
Example10 line Hello World vs Django startproject. Course isliye Flask sikhata 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
-
33
Explain your project structure.Times asked 3Official 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
-
34
Explain app.py.Times asked 3Official 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
-
35
Explain routes.py.Times asked 3Official 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
-
36
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
-
37
Explain controllers.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
-
38
Explain utility/helper modules.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
-
39
Explain imported packages/modules in app.py.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
-
40
Explain your database schema.Times asked 3Official 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
-
41
Explain the ER diagram.Times asked 1Official 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
-
42
Explain relationships between models.Times asked 3Official solution
SimpleRelationships tables ko jodti hain taaki related data object se mil jaaye.
One-to-Many: User → kai Posts. posts = relationship('Post', backref='author'). FK post.user_id.
One-to-One: User → Profile. uselist=False + unique FK. Profile.user_id unique.
Many-to-Many: Student ↔ Drive. Junction/secondary table (student_id, drive_id).Example 1-1:
class Profile(db.Model): user_id = db.Column(db.Integer, db.ForeignKey('user.id'), unique=True) user = db.relationship('User', back_populates='profile', uselist=False)1-M ko 1-1: child FK pe unique=True + uselist=False.
Parent-child: parent PK, child FK. Junction table extra columns bhi rakh sakti hai (applied_on).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
43
Explain database constraints.Times asked 1Official solution
SimpleConstraints rules hain jo galat data rok te hain. Referential integrity FK valid parent ko point kare.
PK, FK, UNIQUE, NOT NULL, CHECK (age >= 18). ORM Column flags yahi map karte hain.
SQL = language tables se baat. Database organized data store.
SQL View: saved query, table jaisi dikhti hai, data copy nahi.
Cluster: kai DB servers together (HA/scale) — MAD1 SQLite single file.
Entity mapping: class User → table user, attributes → columns.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
44
Why SQLite?Times asked 1Official solution
SimpleSQLite file-based chhota DB, MySQL/Postgres server-based production DB.
SQLite fayde: zero setup, ek .db file, MAD1/dev ke liye perfect, portable.
Nuksaanconcurrent writes kam, user/password nahi, network access nahi, production scale nahi.
MySQL: users, permissions, concurrent, replica. App factory mein URI change karke switch: sqlite:///app.db → mysql://...
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
45
SQLite vs MySQL.Times asked 1Official solution
SimpleSQLite file-based chhota DB, MySQL/Postgres server-based production DB.
SQLite fayde: zero setup, ek .db file, MAD1/dev ke liye perfect, portable.
Nuksaanconcurrent writes kam, user/password nahi, network access nahi, production scale nahi.
MySQL: users, permissions, concurrent, replica. App factory mein URI change karke switch: sqlite:///app.db → mysql://...
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
46
What is ORM?Times asked 49Official solution
SimpleORM = Object Relational Mapping. Database tables ko Python classes/objects se map karta hai, raw SQL kam likhni padti hai.
Bina ORM: cursor.execute('SELECT * FROM user WHERE id=?', [5])
ORM se: User.query.get(5) ya db.session.get(User, 5)Example model
class User(db.Model): id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(120), unique=True)FaydePython mein soch sakte ho, SQL injection se protection (parameterized), relationships easy, DB switch thoda aasan.
Nuksaancomplex queries slow/abstract, seekhne ki layer extra, kabhi raw SQL phir bhi chahiye.
MAD1: SQLAlchemy (Flask-SQLAlchemy). Tables db.create_all() ya migrations se banti hain.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
47
Advantages/disadvantages of 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
-
48
Uses of 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
-
49
Explain CRUD operations.Times asked 4Official 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
-
50
Difference between TRUNCATE and DROP.Times asked 1Official solution
SimpleDELETE rows hataata hai, TRUNCATE poori table empty karta hai, DROP table hi mita deta hai.
DELETE FROM user WHERE id=5; — specific rows, WHERE chal sakta hai, trigger/rollback possible.
TRUNCATE TABLE user; — saari rows, tez, identity reset, WHERE nahi.
DROP TABLE user; — table structure bhi gayi.
ORM: db.session.delete(obj) = DELETE. Table drop rarely Flask se.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
51
Difference between PRIMARY KEY and FOREIGN KEY.Times asked 1Official solution
SimplePrimary Key row ki unique ID hai, Foreign Key doosri table ki Primary Key ko point karti hai.
Primary Key: unique + not null. Har table mein hota hai. Example: user.id = 5
Foreign Key: relationship banati hai. post.user_id = 5 matlab yeh post user 5 ki hai.Example
class User(db.Model): id = db.Column(db.Integer, primary_key=True) class Post(db.Model): id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey('user.id'))FK Primary Key bhi ho sakti hai (1-to-1 profile table). FK unique ho to One-to-One, nahi to One-to-Many.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
52
Difference between PRIMARY KEY and UNIQUE KEY.Times asked 1Official solution
SimplePrimary Key table ki main identity hai (ek hi), Unique Key extra unique column ho sakta hai (kai).
PK: NOT NULL + UNIQUE, sirf ek clustered identity. Example: id
Unique: duplicate nahi, lekin NULL allow ho sakta hai. Example: email, usernameUNIQUE + NOT NULL + AUTO_INCREMENT PK jaisa behave karta hai, lekin table ki official PK nahi. Relationships/FK generally PK ko refer karti hain.
Isliye alag Primary Key rakhna better 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
-
53
Types of SQL constraints.Times asked 1Official solution
SimpleConstraints rules hain jo galat data rok te hain. Referential integrity FK valid parent ko point kare.
PK, FK, UNIQUE, NOT NULL, CHECK (age >= 18). ORM Column flags yahi map karte hain.
SQL = language tables se baat. Database organized data store.
SQL View: saved query, table jaisi dikhti hai, data copy nahi.
Cluster: kai DB servers together (HA/scale) — MAD1 SQLite single file.
Entity mapping: class User → table user, attributes → columns.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
54
What are NULL and NOT NULL?Times asked 1Official solution
Simplenullable=False matlab column khali nahi. default seedha value. Query objects lazy hote hain jab tak .all/.first.
age = db.Column(db.Integer, nullable=True) # optional status = db.Column(db.String(20), default='pending')__tablename__ = 'users' # table name override
User.query.all() → list of User. .first() → User ya None. .get_or_404(id) → User ya 404.
filter_by(...) Query object return karta hai, execute .all() pe. Type: BaseQuery / list after all().
db.func.count(User.id) aggregate. Empty table render: loop 0 baar, crash nahi agar code sahi.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
55
What is a SQL View?Times asked 1Official solution
SimpleConstraints rules hain jo galat data rok te hain. Referential integrity FK valid parent ko point kare.
PK, FK, UNIQUE, NOT NULL, CHECK (age >= 18). ORM Column flags yahi map karte hain.
SQL = language tables se baat. Database organized data store.
SQL View: saved query, table jaisi dikhti hai, data copy nahi.
Cluster: kai DB servers together (HA/scale) — MAD1 SQLite single file.
Entity mapping: class User → table user, attributes → columns.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
56
What is a RESTful API?Times asked 4Official solution
SimpleAPI = Application Programming Interface — do systems predefined rules se baat karti hain. REST API HTTP + JSON use karti hai.
Controller/route HTML bhi return kar sakta hai. REST API generally JSON return karti hai, frontend alag ho (Vue/Postman).
Example
@app.route('/api/users/<int:id>') def get_user(id): u = User.query.get_or_404(id) return jsonify(id=u.id, name=u.name)MAD1 HTML apps mein 'API' kabhi-kabhi routes ko hi keh dete hain. Agar Vue nahi to bolo: server-rendered Flask, JSON APIs optional.
Boolean return: technically jsonify(True) ho sakta hai, lekin meaningful JSON object better. Flask view None return kare to error.
Test: Postman se GET/POST.
Parsing: request.get_json() body se, request.args query se.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
57
Why did you use REST APIs?Times asked 1Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example 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
-
58
Why didn't you use APIs in your application?Times asked 1Official solution
SimpleAPI = Application Programming Interface — do systems predefined rules se baat karti hain. REST API HTTP + JSON use karti hai.
Controller/route HTML bhi return kar sakta hai. REST API generally JSON return karti hai, frontend alag ho (Vue/Postman).
Example
@app.route('/api/users/<int:id>') def get_user(id): u = User.query.get_or_404(id) return jsonify(id=u.id, name=u.name)MAD1 HTML apps mein 'API' kabhi-kabhi routes ko hi keh dete hain. Agar Vue nahi to bolo: server-rendered Flask, JSON APIs optional.
Boolean return: technically jsonify(True) ho sakta hai, lekin meaningful JSON object better. Flask view None return kare to error.
Test: Postman se GET/POST.
Parsing: request.get_json() body se, request.args query se.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
59
Advantages of REST APIs.Times asked 1Official solution
SimpleAPI = Application Programming Interface — do systems predefined rules se baat karti hain. REST API HTTP + JSON use karti hai.
Controller/route HTML bhi return kar sakta hai. REST API generally JSON return karti hai, frontend alag ho (Vue/Postman).
Example
@app.route('/api/users/<int:id>') def get_user(id): u = User.query.get_or_404(id) return jsonify(id=u.id, name=u.name)MAD1 HTML apps mein 'API' kabhi-kabhi routes ko hi keh dete hain. Agar Vue nahi to bolo: server-rendered Flask, JSON APIs optional.
Boolean return: technically jsonify(True) ho sakta hai, lekin meaningful JSON object better. Flask view None return kare to error.
Test: Postman se GET/POST.
Parsing: request.get_json() body se, request.args query se.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
60
HTTP request methods (GET, POST, PUT, DELETE, etc.).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
-
61
Difference between GET and PUT.Times asked 2Official 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
-
62
HTTP response codes.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
-
63
What is status code 501?Times asked 1Official solution
SimpleStatus code number batata hai request ka result.
200 OK — success, page/data mil gaya.
201 Created — POST se naya resource.
302/303 Found/See Other — redirect (login ke baad).
304 Not Modified — cache use karo.
400 Bad Request — galat input.
401 Unauthorized — login nahi (ironically authentication missing).
403 Forbidden — login hai, permission nahi.
404 Not Found — route/record nahi.
500 Internal Server Error — server crash (DB error, NoneType). debug=True pe traceback.
501 Not Implemented — method server nahi sambhalta.abort(404) Flask mein. get_or_404(id) record na ho to 404.
User ID GET pe exist na kare to 404 return karo, 500 nahi.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
64
Difference between HTTP and HTTPS.Times asked 6Official solution
SimpleHTTP plain text bhejta hai, HTTPS encrypted bhejta hai.
HTTP: data beech mein koi padh sakta hai (password, session). Port 80. Padlock nahi.
HTTPS: SSL/TLS se encrypt. Port 443. Certificate verify hota hai. Man-in-the-middle mushkil.Examplecafe WiFi pe HTTP login karo to password sniff ho sakta hai. HTTPS pe attacker ko garbage dikhega.
Viva: HTTPS = HTTP + encryption + identity (certificate). Production apps hamesha HTTPS.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
65
Why use jsonify()?Times asked 1Official solution
SimpleJSON = JavaScript Object Notation — data exchange ka text format.
{"name": "Ram", "age": 20}
APIs, localStorage, Chart.js data. Python dict ↔ JSON.
Structured data: tables, fixed schema (SQL). Unstructured: images, logs, free text. JSON semi-structured.
SQL structured relational. Mongo unstructured/document.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
66
Difference between List and Tuple.Times asked 1Official solution
SimpleList changeable ordered, Tuple fixed ordered, Dict key-value.
list: [1,2,3] — append, mutable, duplicate ok. Arrays jaisa lekin mixed types.
tuple: (1,2) — immutable, dict key ban sakta hai.
dict: {'name':'Ram'} — fast lookup by key. JSON objects dict ban jaate hain.
set: unique items.
Array (JS) ≈ Python list. JS object ≈ Python dict.
Mutable: list, dict. Immutable: tuple, str, int.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
67
Difference between List and Dictionary.Times asked 1Official solution
SimpleList changeable ordered, Tuple fixed ordered, Dict key-value.
list: [1,2,3] — append, mutable, duplicate ok. Arrays jaisa lekin mixed types.
tuple: (1,2) — immutable, dict key ban sakta hai.
dict: {'name':'Ram'} — fast lookup by key. JSON objects dict ban jaate hain.
set: unique items.
Array (JS) ≈ Python list. JS object ≈ Python dict.
Mutable: list, dict. Immutable: tuple, str, int.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
68
What is a Dictionary?Times asked 1Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example 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
-
69
How are dictionaries stored in memory?Times asked 1Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example 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
-
70
How do you read key-value pairs (items(), etc.)?Times asked 1Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example 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
-
71
Mutable vs Immutable.Times asked 1Official solution
SimpleList changeable ordered, Tuple fixed ordered, Dict key-value.
list: [1,2,3] — append, mutable, duplicate ok. Arrays jaisa lekin mixed types.
tuple: (1,2) — immutable, dict key ban sakta hai.
dict: {'name':'Ram'} — fast lookup by key. JSON objects dict ban jaate hain.
set: unique items.
Array (JS) ≈ Python list. JS object ≈ Python dict.
Mutable: list, dict. Immutable: tuple, str, int.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
72
Exception handling.Times asked 1Official solution
SimpleException error object. try-except se app crash ki jagah friendly message.
try: age = int(request.form['age']) db.session.commit() except ValueError: flash('Age number hona chahiye') except SQLAlchemyError: db.session.rollback() flash('Database error')ArithmeticError/ZeroDivisionError, KeyError, TypeError common. SQLAlchemy type errors: sahi Column type, form ko int() se convert.
User ko 500 ka traceback mat dikhao production mein.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
73
Types of exceptions (e.g., Arithmetic Exception).Times asked 1Official solution
SimpleException error object. try-except se app crash ki jagah friendly message.
try: age = int(request.form['age']) db.session.commit() except ValueError: flash('Age number hona chahiye') except SQLAlchemyError: db.session.rollback() flash('Database error')ArithmeticError/ZeroDivisionError, KeyError, TypeError common. SQLAlchemy type errors: sahi Column type, form ko int() se convert.
User ko 500 ka traceback mat dikhao production mein.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
74
Difference between packages and modules.Times asked 1Official solution
Difference question hai — 3 cheezein bolo: meaning, kab use, 1 example.
Pehle concept A ek line, phir B ek line, phir table-jaisa farq (input/output/side-effect).
Example hamesha MAD1 se: GET search page, POST register, PUT/PATCH API update, session vs cookie login.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
75
What is Namespace?Times asked 1Official solution
Simple mix of small concepts examiners poochte hain:
Enum: fixed choices (status = pending/approved). Python Enum ya DB Enum column.
Lambda: one-line anonymous function. key=lambda x: x.name sort ke liye.
datetime: dates/times. timedelta(days=1) yesterday. default=datetime.utcnow.
os.getenv('SECRET_KEY') environment se config, hardcode nahi. .env alternative: actual OS env, config.py, vault.
HTML metadata: <meta charset>, <meta name='viewport'> — page ke baare mein, body content nahi.
HTTP metadata: headers (Content-Type, Set-Cookie).
Request payload: body data (JSON/form).
Namespace: naam collide na hon (Blueprint name, Python packages).
Plugins: extra packages (Flask-Login). Package vs module: package folder with __init__, module ek .py file.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
76
What is Bootstrap?Times asked 5Official solution
SimpleBootstrap CSS/JS framework — ready classes se responsive UI.
<button class='btn btn-primary'>Save</button>Red button: btn btn-danger. Navbar, cards, grid (row/col).
CDN: <link href='https://cdn.jsdelivr.net/npm/bootstrap@5...'> — internet na ho to style toot sakti hai. Local copy safer viva ke liye.
CSS vs Bootstrap: Bootstrap faster consistent UI, custom CSS fine-control. Dono saath use ho sakte hain.
aria-current='page' accessibility — current nav item screen readers ko.
CDN fayda: cache, quick setup. Nuksaan: offline, privacy, version lock.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
77
Uses of Bootstrap.Times asked 1Official solution
SimpleBootstrap CSS/JS framework — ready classes se responsive UI.
<button class='btn btn-primary'>Save</button>Red button: btn btn-danger. Navbar, cards, grid (row/col).
CDN: <link href='https://cdn.jsdelivr.net/npm/bootstrap@5...'> — internet na ho to style toot sakti hai. Local copy safer viva ke liye.
CSS vs Bootstrap: Bootstrap faster consistent UI, custom CSS fine-control. Dono saath use ho sakte hain.
aria-current='page' accessibility — current nav item screen readers ko.
CDN fayda: cache, quick setup. Nuksaan: offline, privacy, version lock.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
78
Why Bootstrap?Times asked 1Official solution
SimpleBootstrap CSS/JS framework — ready classes se responsive UI.
<button class='btn btn-primary'>Save</button>Red button: btn btn-danger. Navbar, cards, grid (row/col).
CDN: <link href='https://cdn.jsdelivr.net/npm/bootstrap@5...'> — internet na ho to style toot sakti hai. Local copy safer viva ke liye.
CSS vs Bootstrap: Bootstrap faster consistent UI, custom CSS fine-control. Dono saath use ho sakte hain.
aria-current='page' accessibility — current nav item screen readers ko.
CDN fayda: cache, quick setup. Nuksaan: offline, privacy, version lock.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
79
Why didn't you use Bootstrap?Times asked 1Official solution
SimpleBootstrap CSS/JS framework — ready classes se responsive UI.
<button class='btn btn-primary'>Save</button>Red button: btn btn-danger. Navbar, cards, grid (row/col).
CDN: <link href='https://cdn.jsdelivr.net/npm/bootstrap@5...'> — internet na ho to style toot sakti hai. Local copy safer viva ke liye.
CSS vs Bootstrap: Bootstrap faster consistent UI, custom CSS fine-control. Dono saath use ho sakte hain.
aria-current='page' accessibility — current nav item screen readers ko.
CDN fayda: cache, quick setup. Nuksaan: offline, privacy, version lock.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
80
What are Bootstrap classes?Times asked 1Official solution
SimpleBootstrap CSS/JS framework — ready classes se responsive UI.
<button class='btn btn-primary'>Save</button>Red button: btn btn-danger. Navbar, cards, grid (row/col).
CDN: <link href='https://cdn.jsdelivr.net/npm/bootstrap@5...'> — internet na ho to style toot sakti hai. Local copy safer viva ke liye.
CSS vs Bootstrap: Bootstrap faster consistent UI, custom CSS fine-control. Dono saath use ho sakte hain.
aria-current='page' accessibility — current nav item screen readers ko.
CDN fayda: cache, quick setup. Nuksaan: offline, privacy, version lock.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
81
What is CSS?Times asked 2Official solution
SimpleCSS page ko style karti hai — color, layout, font. HTML structure, CSS look.
h1 { color: navy; } .card { padding: 16px; } #logo { width: 80px; }
Selectors: element (h3), class (.btn), id (#nav), pseudo (:hover).
display:flex — ek line/row mein items, justify-content/align-items se center.
Multiple classes: saari apply, conflict pe specificity/order.
Responsive: media queries / Bootstrap grid. Bina CSS limited (old tables) — practically CSS chahiye.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
82
How did you add CSS?Times asked 1Official solution
SimpleCSS page ko style karti hai — color, layout, font. HTML structure, CSS look.
h1 { color: navy; } .card { padding: 16px; } #logo { width: 80px; }
Selectors: element (h3), class (.btn), id (#nav), pseudo (:hover).
display:flex — ek line/row mein items, justify-content/align-items se center.
Multiple classes: saari apply, conflict pe specificity/order.
Responsive: media queries / Bootstrap grid. Bina CSS limited (old tables) — practically CSS chahiye.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
83
Static vs Dynamic web pages.Times asked 1Official solution
SimpleStatic page har user ko same HTML file. Dynamic server pe data se HTML banati hai.
Static: about.html. Dynamic: dashboard Jinja + DB ({{ user.name }}, loops).
Flask templates dynamic pages hain. static/ folder CSS/images ke liye.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
84
Difference between Frontend and Backend.Times asked 1Official solution
SimpleFrontend user jo dekhta/click karta hai, Backend server logic + database.
Frontend: HTML, CSS, Bootstrap, Jinja templates, thoda JS. Browser pe chalta hai.
Backend: Flask routes, SQLAlchemy, session, validation. Python server pe.
Data flow: form POST → Flask request.form → DB save → render_template/redirect → HTML dikha.
MAD1 typical stack: Flask + Jinja + SQLAlchemy + SQLite + Bootstrap.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
85
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
-
86
Explain MVC in your project.Times asked 1Official 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
-
87
Difference between 2-tier and 3-tier architecture.Times asked 1Official solution
Simple2-tier = client seedha database se baat karta hai. 3-tier = beech mein application server hota hai.
2-tier: UI + DB. Jaise desktop app directly SQLite. Simple, lekin security/scaling kam.
3-tier: Presentation (browser) → Application (Flask) → Data (SQLite/MySQL). MAD1 project yahi hai.Examplebrowser HTML dikhata hai, Flask business logic (booking, auth), DB data store.
Fayda: DB expose nahi, logic central, scale alag-alag tiers pe kar 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
-
88
What are Sessions?Times asked 1Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example 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
-
89
Sessions vs Cookies.Times asked 1Official solution
SimpleCookie browser mein save hoti hai, Session server pe data rakhta hai aur browser ko sirf ID deta hai.
Cookie: key-value browser pe. JS padh sakta hai (agar HttpOnly nahi). Size chhoti (~4KB).
Session: server-side dict. Flask default mein session data signed cookie mein hi store hota hai (client pe, lekin tamper-proof).Example
session['user_id'] = 12 # login ke baad
# browser ko Set-Cookie milti haiTab close: default Flask session cookie browser close pe delete (session cookie). Permanent session alag hota hai.
Incognito: cookies isolated, isliye logged-in nahi dikhega.
SECRET_KEY se session sign hota hai — key nahi to session insecure/kaam nahi karega.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
90
What is a Cookie?Times asked 1Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example 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
-
91
Authentication vs Authorization.Times asked 10Official 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
-
92
How did you implement authorization?Times asked 1Official solution
SimpleAuthentication session se, Authorization role/ownership check se.
def admin_required(f): @wraps(f) def wrap(*a,**k): if session.get('role') != 'admin': abort(403) return f(*a,**k) return wrapJinja: {% if session['role']=='admin' %}<a href='/admin'>Admin</a>{% endif %}
Yeh hide hai, security nahi — route pe check zaroori. Admin authenticated bhi hai (logged in) aur authorized bhi (role).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
93
How did you ensure session management?Times asked 1Official solution
SimpleFlask session request-across data store karta hai, generally signed cookie mein.
session['user_id'] = user.id
uid = session.get('user_id')
session.clear() # logoutType: dictionary-like (SecureCookieSession). SECRET_KEY se sign — tamper detect.
Store kahan: default client cookie. Server-side Redis/filesystem bhi laga sakte ho.
Browser storage: cookies, localStorage, sessionStorage. Session cookie tab-close pe jaa sakti hai.
Remember-me: permanent session ya alag token cookie.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
94
Email validation.Times asked 1Official solution
SimpleValidation galat data rok ti hai — frontend turant, backend must.
Frontend: required, min='18', maxlength='8', pattern='(?=.*[A-Z]).{8,}'
Backend example:pwd = request.form.get('password','') if len(pwd) < 8 or not re.search(r'[A-Z]', pwd) or not re.search(r'[0-9]', pwd): flash('Weak password')Haan, regex se password rules ho sakte hain.
Age 18-99, date >= today, slots <= 30 and > 0, confirm password == password, email '@' .
Duplicate username: User.query.filter_by(email=email).first() or unique=True catch IntegrityError.
Past date: if date < date.today(): reject. Negative slots: if slots < 0: reject; book pe available > 0 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
-
95
Explain password validation logic.Times asked 1Official solution
SimpleValidation galat data rok ti hai — frontend turant, backend must.
Frontend: required, min='18', maxlength='8', pattern='(?=.*[A-Z]).{8,}'
Backend example:pwd = request.form.get('password','') if len(pwd) < 8 or not re.search(r'[A-Z]', pwd) or not re.search(r'[0-9]', pwd): flash('Weak password')Haan, regex se password rules ho sakte hain.
Age 18-99, date >= today, slots <= 30 and > 0, confirm password == password, email '@' .
Duplicate username: User.query.filter_by(email=email).first() or unique=True catch IntegrityError.
Past date: if date < date.today(): reject. Negative slots: if slots < 0: reject; book pe available > 0 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
-
96
Can password validation be implemented using Regex?Times asked 1Official solution
SimpleValidation galat data rok ti hai — frontend turant, backend must.
Frontend: required, min='18', maxlength='8', pattern='(?=.*[A-Z]).{8,}'
Backend example:pwd = request.form.get('password','') if len(pwd) < 8 or not re.search(r'[A-Z]', pwd) or not re.search(r'[0-9]', pwd): flash('Weak password')Haan, regex se password rules ho sakte hain.
Age 18-99, date >= today, slots <= 30 and > 0, confirm password == password, email '@' .
Duplicate username: User.query.filter_by(email=email).first() or unique=True catch IntegrityError.
Past date: if date < date.today(): reject. Negative slots: if slots < 0: reject; book pe available > 0 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
-
97
What types of testing did you perform?Times asked 1Official solution
SimpleTesting code sahi hai verify. Unit = chhote functions, Integration = route+DB, System = poora flow.
Pytest: test_*.py, assert. Markers: @pytest.mark.slow skip/select. Keywords: pytest -k login.
Unit testing se regression kam, viva ke alawa CI mein fayda. Manual: demo scenarios (overbook, blacklist).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
98
Why unit testing?Times asked 1Official solution
SimpleTesting code sahi hai verify. Unit = chhote functions, Integration = route+DB, System = poora flow.
Pytest: test_*.py, assert. Markers: @pytest.mark.slow skip/select. Keywords: pytest -k login.
Unit testing se regression kam, viva ke alawa CI mein fayda. Manual: demo scenarios (overbook, blacklist).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
99
What testing did you do apart from unit testing?Times asked 1Official solution
SimpleTesting code sahi hai verify. Unit = chhote functions, Integration = route+DB, System = poora flow.
Pytest: test_*.py, assert. Markers: @pytest.mark.slow skip/select. Keywords: pytest -k login.
Unit testing se regression kam, viva ke alawa CI mein fayda. Manual: demo scenarios (overbook, blacklist).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
100
What is Bootstrap class?Times asked 1Official solution
SimpleBootstrap CSS/JS framework — ready classes se responsive UI.
<button class='btn btn-primary'>Save</button>Red button: btn btn-danger. Navbar, cards, grid (row/col).
CDN: <link href='https://cdn.jsdelivr.net/npm/bootstrap@5...'> — internet na ho to style toot sakti hai. Local copy safer viva ke liye.
CSS vs Bootstrap: Bootstrap faster consistent UI, custom CSS fine-control. Dono saath use ho sakte hain.
aria-current='page' accessibility — current nav item screen readers ko.
CDN fayda: cache, quick setup. Nuksaan: offline, privacy, version lock.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
101
What is a Model?Times asked 1Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example 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
-
102
Explain company templates.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
-
103
Difference between CSV and JSON.Times asked 1Official solution
SimpleCSV table jaisa text (comma rows), JSON nested objects/lists.
CSV: name,age\nRam,20 — Excel/export ke liye. Nested data mushkil.
JSON: {"name":"Ram","age":20,"roles":["admin"]} — APIs ka standard.
Project: CSV export reports, JSON APIs/Chart.js data.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
104
Why use JSON?Times asked 1Official solution
SimpleJSON = JavaScript Object Notation — data exchange ka text format.
{"name": "Ram", "age": 20}
APIs, localStorage, Chart.js data. Python dict ↔ JSON.
Structured data: tables, fixed schema (SQL). Unstructured: images, logs, free text. JSON semi-structured.
SQL structured relational. Mongo unstructured/document.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
105
Explain checksum.Times asked 1Official solution
SimpleChecksum file ka hash (jaise SHA256) — file change hui ya nahi verify.
Portal pe submitted ZIP ka checksum diya hota hai. Local file ka hash nikaalo, match hona chahiye.
Linux: sha256sum project.zip
Mismatch = galat file / corrupt download. Examiner integrity check karta hai ki tumhari submitted copy hi run ho rahi 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
-
106
Show/download checksum.Times asked 1Official solution
SimpleChecksum file ka hash (jaise SHA256) — file change hui ya nahi verify.
Portal pe submitted ZIP ka checksum diya hota hai. Local file ka hash nikaalo, match hona chahiye.
Linux: sha256sum project.zip
Mismatch = galat file / corrupt download. Examiner integrity check karta hai ki tumhari submitted copy hi run ho rahi 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
-
107
Show ID card.Times asked 6Official 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