-
1
MAD-1 Level-2 Viva :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
explain database models and relationships between tablesTimes asked 1Official solution
Simpledb.relationship se object graph: lot.spots, booking.user. backref reverse side auto deta hai.
Example
spots = db.relationship('Spot', backref='lot', cascade='all, delete-orphan')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
explain MVC work flowTimes asked 1Official solution
SimpleMVC: Model=data (SQLAlchemy), View=Jinja HTML, Controller=Flask routes/business logic.
Flask loosely MVC follow karta hai — routes controllers, templates views, models.py models.
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
why do you use lazy=True ?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
-
5
explain all HTTP methodsTimes asked 1Official solution
SimpleCode explain formula: input kya aaya → auth/validation → DB change → response/UI.
Viva tipFunction signature + 3-4 important lines + edge case.
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 are the types of CSS and its precedence ?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
-
7
what is the difference between render template and redirect ?Times asked 1Official solution
Simpleredirect dusre URL pe bhejta hai. flash one-time message session mein rakh ke next page pe dikhata hai.
Example
flash('Login successful', 'success') return redirect(url_for('user.dashboard'))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
have you used flask blueprint in your project, why ?Times asked 1Official solution
SimpleBlueprint se app ko modules mein todte ho — auth, admin, user alag files. Scale + clean structure.
Example
auth_bp = Blueprint('auth', __name__, url_prefix='/auth') @auth_bp.route('/login') def login(): ... app.register_blueprint(auth_bp)Viva tipViva: 'kyun blueprint?' → separation of concerns, badi app maintainable.
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
code changes - username should be minimum 5 letters while registering(frontend validation)Times asked 1Official solution
SimpleValidation = input rules: required, email format, length, unique. Frontend UX, backend security — dono.
Example
if not email or '@' not in email: flash('Invalid email') return redirect(request.url) if User.query.filter_by(email=email).first(): flash('Email taken')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
code changes - User can register more than one account using same email-id(backend db modification)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