-
1
Today's viva questions:Times asked 1Official solution
SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest 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
-
2
How did you handle unique email registration? (IntegrityError handling)Times asked 1Official solution
SimpleInt column mein string daalne pe SQLAlchemy/DB type error ya Integrity/StatementError. Empty table pe bhi same validation fail — row count matter nahi.
Example
# SQLite may coerce sometimes; Postgres: invalid input syntax for integer Spot(status='free', lot_id='abc') # lot_id int → errorCommunity answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
3
Theory: - ORM - Difference between "redirect()" and "render_template()"Times asked 1Official solution
Simplerender_template Jinja HTML file ko data deke final HTML banata hai.
Example
return render_template('dashboard.html', user=user, lots=lots)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
Frontend change: Move the login container to the top-left.Times asked 1Official solution
SimpleLive UI change: relevant CSS/HTML template kholo — color, margin, flex, bootstrap class. Save + hard refresh.
Example
/* button red */ .btn-primary { background: red; } /* center navbar item */ .navbar { justify-content: center; }Viva tipDevTools se pehle try, phir file mein permanent change.
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
In the app: Are you handling the overbooking/duplicate booking case?Times asked 1Official solution
SimpleDoosri booking same slot: unique constraint + query.exists + 400 message.
Frontend disable UX. Backend source of truth. Race: two users unique(slot).
Pehle 1-line definition, phir related MAD2 layer (Vue SFC / Flask route / models.py / tasks.py / Redis).
4-line formula: input kahan se aaya, auth/validation kaunsa, DB ya cache ya Celery, kya return.
Related mix mat karo — cache ≠ Celery, authentication ≠ authorization, v-if ≠ v-show, Beat ≠ Worker. Follow-up ke liye ek difference ready rakho.
Example
if Booking.query.filter_by(user_id=uid, slot_id=sid).first(): return jsonify(message='Already booked'), 400Project example: Click book twice. Second 400 Already booked. DB 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
-
6
What did you use to show the field value on the profile page? → "value"Times asked 1Official solution
SimpleDemo script pehle se practice: 5–7 min, Admin + User roles, saare mandatory features.
Suggested flow1) Register/login user
2) Admin login — CRUD
3) Approval/blacklist
4) Booking/apply + edge case
5) Search
6) LogoutViva tipBolte-bolte dikhao. Code tab kholna jab poochhein.
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 is used to make a form field compulsory? → "required" attribute in HTML.Times asked 1Official solution
SimpleORM = Object Relational Mapping. Tables → Python classes. Raw SQL kam likhte ho.
Example
class User(db.Model): id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(120), unique=True) User.query.get(5) # SELECT ... WHERE id=5Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet