-
1
Write Route to fetch all data for viva that are happening todayTimes asked 1Official solution
SimpleLive Flask coding: chhota route likho, save, browser/curl se test. Syntax error terminal mein padho.
Example
@app.route('/ping') def ping(): return jsonify(ok=True) @app.route('/even/<int:n>') def even(n): return 'even' if n % 2 == 0 else 'odd'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
Write jinja code to show fetched dataTimes asked 1Official solution
SimpleJinja2 Flask ka template engine — HTML ke andar {{ }} variables, {% %} logic.
Example
{% for lot in lots %} <li>{{ lot.name }} — {{ lot.spots }}</li> {% else %} <p>No lots</p> {% endfor %}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
Jinja templates are server side or client sideTimes asked 1Official solution
SimpleClient storage: cookies, localStorage, sessionStorage, IndexedDB. Tokens often localStorage; sessions often 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
-
4
n+1 query problem in sql alchemyTimes asked 1Official solution
SimpleSQLAlchemy MAD1 ka common ORM. Flask-SQLAlchemy wrapper se db.Model, db.session.
Example
user = User(email='a@b.com') db.session.add(user) db.session.commit() users = User.query.filter_by(role='admin').all()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
Difference between error codes starting from 4 and 5Times asked 1Official solution
SimpleUngli rakhe to 4-line formula — panic ki jagah structure.
1) File ka role: model / Flask route / Vue SFC / celery task / config
2) Input kahan: JSON, params, token, props, $route
3) Kya kaam: query, cache, validation, .delay()
4) Output: jsonify, this.items, email, redirectUnknown keyword: import, decorator, if, commit — har ka reason. Bluff mat.
Suggested flow1) Kaunsi layer?
2) Input?
3) DB/cache/task?
4) Response/UI?Project example: Booking POST: jwt, seats check, commit, 201, Vue list push.
Viva tipUnknown keyword: import, decorator, if, commit — har ka reason. Panic mat.
Community answers
1 reply Browse student answers
Difference between 4xx and 5xx error codes
4xx errors → Client-side error: The request sent by the user/client is wrong or not allowed.Example404 Not Found, 401 Unauthorized, 403 Forbidden.
5xx errors → Server-side error: The request is valid, but something went wrong on the server.
Example500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable.
Easy way to remember:
👉 4xx = Client ki problem
👉 5xx = Server ki problemMy solution
Not submitted yet
-
6
Explain in detail for search functionality is working and question from code written for that.Times asked 1Official solution
SimpleSearch: form/query param → ilike filter → results template.
Example
q = request.args.get('q', '').strip() lots = Lot.query.filter(Lot.name.ilike(f'%{q}%')).all()Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet