-
1
Based on the video of the viva, here are the technical and conceptual questions asked by the proctor to the student:Times asked 2Official 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
* **Celery Delay Method**: What is the functionality of the `.delay()` method when using Celery for background tasks in Python?Times asked 2Official solution
SimpleCelery = background naukri. HTTP request ko 10 second email bhejne ke liye mat rokna.
Distributed task queue: aap function ko abhi nahi, worker process mein later/retry/schedule pe chalaate ho.
MAD2 typical jobs: daily reminder mail, monthly HTML report, user-triggered CSV export.
Web request 200ms hona chahiye. 10,000 emails request thread mein = timeout. Worker alag CPU pe kaam kare.
Redis broker chahiye. Beat alag process schedule ke liye.
Example
@celery.task def daily_reminder(): for u in User.query.filter_by(active=True): send_mail(u.email, 'Book something today!')Project example: User Export click → 202 Accepted. Worker CSV + email. Daily 6pm Beat reminder.
Viva tipWorker + Redis bina Beat ke user-triggered chalega. Scheduled jobs ke liye Beat bhi 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
-
3
* **Redis Usage**: How are you using Redis in your application (e.g., message broker between Celery and Flask, and caching Vue front-end pages)?Times asked 2Official solution
SimpleFlask lightweight Python web framework — routes, request/response, templates. MAD1 ka backend yahi hai.
Example
from flask import Flask app = Flask(__name__) @app.route('/') def home(): return 'Hello'Viva tipFlask micro hai: jo chahiye (DB, login, forms) khud jodte 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
-
4
* **Authentication**: How are you authenticating users (e.g., using JSON Web Tokens / JWT)?Times asked 2Official solution
SimpleAuthentication: tu kaun hai? (login). Authorization: tujhe permission hai? (role check).
Example
# auth if check_password_hash(user.password, pwd): session['user_id'] = user.id # authz if user.role != 'admin': abort(403)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
* **Page Refresh Session Persistence**: If a user is logged in with a JWT-based authentication system and refreshes the page, will they get logged out?Times asked 2Official solution
SimpleMAD1 mein usually session-based auth: login pe session['user_id'], har request pe verify.
Example
session['user_id'] = user.id uid = session.get('user_id') user = User.query.get(uid)Viva tipSECRET_KEY set karo warna session insecure. logout pe session.clear().
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
* **Browser Close Behavior**: What happens if you close the browser and restart the application? Will the JWT token persist in local storage?Times asked 2Official solution
Simplevenv activate → dependencies → DB create/migrate → flask run. Browser pe localhost dikhao.
Example
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt flask runCommunity answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
7
* **Storage Comparison**: How does local storage differ from session storage and cookies?Times asked 2Official solution
SimpleMAD1 mein usually session-based auth: login pe session['user_id'], har request pe verify.
Example
session['user_id'] = user.id uid = session.get('user_id') user = User.query.get(uid)Viva tipSECRET_KEY set karo warna session insecure. logout pe session.clear().
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
* **Database Re-generation**: If you delete the SQLite database file (`.placement-portal.db`) and restart the Flask server, will the database file get generated again, and will all the tables get recreated?Times asked 2Official solution
SimpleSQLite file-based DB — setup easy, MAD1 ke liye perfect. Production heavy traffic pe Postgres better.
Example
SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'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
* **CORS**: Are you using cross-origin resource sharing (CORS) in your application, and how is it configured?Times asked 2Official solution
SimpleDifferent origin Vue vs Flask — browser CORS check. Server Allow-Origin.
Failed = frontend error even if curl works. Examiner curl vs browser.
HTTP verbs + status REST ki zabaan. GET read, POST create, PUT replace, PATCH partial, DELETE remove. GET typically no body.
Status: 200 OK, 201 created, 202 accepted (Celery task), 400 bad input, 401 no/bad token, 403 role nahi, 404 missing, 409 conflict (double book), 500 server.
AJAX/fetch page reload nahi. SPA poori isi pe. Postman se bina Vue ke API prove karo — examiner pasand.
Example
from flask_cors import CORS CORS(app, resources={r'/api/*': {'origins': 'http://localhost:8080'}})Project example: Flask-CORS localhost:8080.
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
* **JavaScript Variable Declarations**: Why did you choose `const` instead of `let` or `var` for variable declarations in JavaScript?Times asked 2Official solution
Simplevar old function-scope, let block-scope changeable, const block-scope reassign nahi.
var x = 1; // hoisted, function scoped — avoid
let count = 0; count = 1; // theek
const PI = 3.14; // reassign error, object ke andar field change ho sakti hai
Modern JS: let/const use karo, var 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
-
11
* **JavaScript Typing**: Is JavaScript a statically typed language or a dynamically typed language?Times asked 2Official solution
SimpleJavaScript browser/Node pe chalta hai — DOM, events, fetch/axios. MAD1 mein thoda JS; MAD2 mein Vue JS pe.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet