-
1
Explain the project directory structure.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
-
2
Explain the project architecture (MVC).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
-
3
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
-
4
Explain the codebase.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
-
5
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
-
6
Explain one controller/route in detail and why it is used.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
-
7
Show the APIs in your project.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
-
8
Explain how requests are handled 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
-
9
If you had more time, what improvements would you make?Times asked 2Official 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
-
10
Advantages and disadvantages of SQLite.Times asked 2Official 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
-
11
What is lazy loading 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
-
12
Explain lazy loading parameters/options.Times asked 1Official solution
Simplelazy loading related objects tab load karta hai jab attribute access karte ho, pehle nahi.
user = User.query.get(1) # posts query nahiuser.posts # ab query
lazy=True / 'select' default. lazy='joined' eager join. lazy='dynamic' query object.
uselist=False One-to-One (single object, list nahi). Hataoge to list mil sakti hai.
Frontend lazy loading images alag cheez hai (viewport mein aaye tab load).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
Is your database normalized? Explain.Times asked 1Official solution
SimpleNormalization data ko split karke redundancy aur update-anomalies kam karti hai.
1NF: atomic values, repeating groups nahi (comma-separated skills mat rakho).
2NF: 1NF + non-key columns poori PK pe depend (composite keys pe).
3NF: 2NF + non-key columns ek doosre pe depend na hon (city→state alag table).Examplehar booking mein user ka poora address copy vs user_id se User table.
MAD1 project generally 3NF ke kareeb. Higher NF (BCNF) theoretically, practical apps denormalize speed ke liye (cached counts).
Leaderboard: alag table better agar history/rank chahiye; sirf count hai to query se bhi ho sakta 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
-
14
What is normalization?Times asked 2Official solution
SimpleNormalization data ko split karke redundancy aur update-anomalies kam karti hai.
1NF: atomic values, repeating groups nahi (comma-separated skills mat rakho).
2NF: 1NF + non-key columns poori PK pe depend (composite keys pe).
3NF: 2NF + non-key columns ek doosre pe depend na hon (city→state alag table).Examplehar booking mein user ka poora address copy vs user_id se User table.
MAD1 project generally 3NF ke kareeb. Higher NF (BCNF) theoretically, practical apps denormalize speed ke liye (cached counts).
Leaderboard: alag table better agar history/rank chahiye; sirf count hai to query se bhi ho sakta 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
-
15
What is referential integrity?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
-
16
Explain different database keys (Primary, Foreign, Candidate, etc.).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
-
17
What is backref?Times asked 12Official solution
Simplebackref relationship ki reverse side automatically bana deta hai.
class Post(db.Model): user_id = db.Column(db.Integer, db.ForeignKey('user.id')) user = db.relationship('User', backref='posts')Ab post.user milta hai, aur user.posts bhi — Post model pe sirf ek line.
secondary Many-to-Many junction table ke liye: relationship(..., secondary=likes_table, backref='liked_by').
Explicit chahiye to back_populates use 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
-
18
Difference between backref and back_populates.Times asked 10Official solution
Simpledono SQLAlchemy relationships ko do taraf se connect karte hain, farq sirf likhne ke style ka hai.
backref: relationship ek side pe likhte ho, doosri side SQLAlchemy khud bana deta hai. Short hai, lekin dono models dekh ke relationship clearly nahi dikhti.
back_populates: dono models pe relationship explicitly likhte ho. Code padhne wale ko turant samajh aa jaata hai ki User.posts aur Post.author linked hain.
Example
class User(db.Model): posts = db.relationship('Post', backref='author')Yahan Post.author automatically mil jaata hai.
Explicit version:
class User(db.Model): posts = db.relationship('Post', back_populates='author') class Post(db.Model): author = db.relationship('User', back_populates='posts')Viva tipexaminer ko bolo — MAD1 project mein back_populates zyada clear hai, isliye preferred.
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 an API?Times asked 8Official 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
-
20
What is a REST API?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
-
21
Are there alternatives to REST? (e.g., GraphQL)Times asked 1Official solution
SimpleREST multiple URLs/resources, GraphQL ek endpoint se exactly jo fields chahiye woh maango.
REST: GET /users/1, GET /users/1/posts — extra/under fetching ho sakti hai.
GraphQL: { user(id:1) { name posts { title } } } — ek call.
MAD1 REST/HTTP routes use karta hai; GraphQL extra complexity.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
What are the advantages of GraphQL over REST?Times asked 1Official solution
SimpleREST multiple URLs/resources, GraphQL ek endpoint se exactly jo fields chahiye woh maango.
REST: GET /users/1, GET /users/1/posts — extra/under fetching ho sakti hai.
GraphQL: { user(id:1) { name posts { title } } } — ek call.
MAD1 REST/HTTP routes use karta hai; GraphQL extra complexity.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
How would you implement search/filter using JavaScript only?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
-
24
How would you implement the same feature using Flask API endpoints?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
-
25
What is the DOM?Times asked 3Official solution
SimpleDOM = Document Object Model — HTML ka tree jo browser memory mein banata hai. JS isi ko change karta hai.
document.getElementById('btn').style.color = 'red'
Jinja server pe HTML banata hai, phir browser DOM parse karta hai. Vue DOM ko reactive update 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
-
26
Types of CSS (Inline, Internal, External).Times asked 3Official solution
SimpleCSS 3 tarikon se lagti hai, priority Inline > Internal > External (same specificity pe).
Inline: style='color:red' element pe. Highest priority, lekin reuse nahi. Debugging mushkil.
Internal: <style> tag HTML head mein. Us page tak limited.
External: style.css file. Large project ke liye best — ek jagah change, saari pages update.Example same button pe teeno:
/* external */ .btn { color: blue; }
/* internal */ .btn { color: green; }
<!-- inline --> <button class='btn' style='color:red'> → red jeetegaID (#box) class (.btn) se strong, class element (button) se strong.
!important sabko override karta hai — avoid karo.
Large project: external CSS preferred.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
CSS precedence/specificity.Times asked 1Official solution
SimpleCSS 3 tarikon se lagti hai, priority Inline > Internal > External (same specificity pe).
Inline: style='color:red' element pe. Highest priority, lekin reuse nahi. Debugging mushkil.
Internal: <style> tag HTML head mein. Us page tak limited.
External: style.css file. Large project ke liye best — ek jagah change, saari pages update.Example same button pe teeno:
/* external */ .btn { color: blue; }
/* internal */ .btn { color: green; }
<!-- inline --> <button class='btn' style='color:red'> → red jeetegaID (#box) class (.btn) se strong, class element (button) se strong.
!important sabko override karta hai — avoid karo.
Large project: external CSS preferred.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
What happens when multiple CSS classes are applied to the same element?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
-
29
Explain template inheritance with an example.Times asked 1Official 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
-
30
Center a text element on the page.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
-
31
Center a <div> on the page.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
-
32
Change the shadow of a box (offsets, blur, RGBA color).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
-
33
Change the size of a container.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
-
34
Change the color of a container.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
-
35
Make minor HTML/CSS styling adjustments.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
-
36
What is authentication?What is authorization?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
-
37
Explain different types of 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
-
38
Explain filters and how they work in your project.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
-
39
How would you add a new filter?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
-
40
Implement a feature to allow only one ad request per influencer in a campaign.Times asked 1Official solution
Yeh live coding / notepad task hai. Chhota, correct Flask snippet likho.
from flask import Flask, render_template, request, redirect, url_for @app.route('/do', methods=['GET','POST']) def do(): if request.method == 'POST': # request.form.get('field') ya request.args.get('q') # db.session.add(...); commit return redirect(url_for('dashboard')) items = Model.query.all() return render_template('page.html', items=items)Jinja: {% for x in items %}<li>{{ x.name }}</li>{% endfor %}
ID URL: @app.route('/item/<int:id>')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
Implement a check to prevent multiple ad requests without modifying models.py.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
Modify the request handling logic and explain the changes.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