Viva prep · Real questions · Student experiences Enroll in Bootcamp

Study workspace

Viva Prep

Prepare in structure for the Project Mentorship.

18881 Questions
267 Proctors

Lazy IITians

Who are we?

A student-built prep community for IITM BS — real viva questions, shared experiences, and structured practice so you walk into mentorship confident.

Fill the form and join us

Enroll in Bootcamp

Find questions

Search by question text across the whole library, then narrow with subject, level, and proctor.

Share your experience Add your viva experience here

Question sets

  1. 1
    Demo of application core functionality
    Times asked 2
    Official 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) Logout

    Viva tipBolte-bolte dikhao. Code tab kholna jab poochhein.

  2. 2
    Show models.py asked to explain it.
    Times asked 2
    Official solution

    Simplemodels.py = har table ki class: columns, PK/FK, relationships. Yeh Model layer hai.

    Suggested flow1) Classes list karo
    2) Har table ka kaam 1 line
    3) Relationships (1-M / M-M)
    4) Constraints (unique, nullable)

    Example

    class Lot(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        name = db.Column(db.String(80), nullable=False)
        spots = db.relationship('Spot', backref='lot', lazy=True)
  3. 3
    While explaining tell me to explain the relationship between tables i used.
    Times asked 2
    Official 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')
  4. 4
    Difference between primary key and unique
    Times asked 2
    Official solution

    SimplePrimary key row ka unique identity — usually id Integer autoincrement.

    Example

    id = db.Column(db.Integer, primary_key=True)
  5. 5
    What is foreign key?
    Times asked 2
    Official solution

    SimpleForeign key dusri table ke PK ko point karti hai — relationship banati hai.

    Example

    lot_id = db.Column(db.Integer, db.ForeignKey('lot.id'), nullable=False)
  6. 6
    Tell me to show admin’s staff management page then he asked me to change the colour of table’s row which i used to show staff information. ( like status approve and blacklisted ).
    Times asked 2
    Official 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=5
  7. 7
    After this he told me to add a button on the same admin’s staff management page to delete an existing staff from the application. ( both html template part and also the delete route for the same )
    Times asked 2
    Official solution

    SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest hai.

  8. 8
    Rapid fire questions: what is vertical and horizontal scaling? Difference between them.
    Times asked 2
    Official solution

    SimpleVertical badi machine. Horizontal aur boxes + load balancer. JWT stateless horizontal friendly.

    10k users: Postgres, Redis, gunicorn, CDN, pagination, indexes.
    Millions: replicas, queue partition, more workers.

    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.

    Project example: Course app vertical enough. Design answer scale-out.

  9. 9
    Authentication vs Authorisation
    Times asked 2
    Official 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)
  10. 10
    Structured vs unstructured database
    Times asked 2
    Official solution

    Difference question hai — 3 cheezein bolo: meaning, kab use, 1 example.

    Pehle concept A ek line, phir B ek line, phir table-jaisa farq (input/output/side-effect).
    Example hamesha MAD1 se: GET search page, POST register, PUT/PATCH API update, session vs cookie login.

  11. 11
    I can’t remember more theory part now but similar questions to other reviews available on the sheet.
    Times asked 2
    Official solution

    SimpleTheory = concepts: ORM, MVC, auth vs authz, Jinja inheritance, sessions. 1-line def + project example.

Advice: You should have well known to code base and he will thoroughly go through your code and will ask you to explain any part.
  1. 1
    - Download code from portal and run it.
    Times asked 2
    Official solution

    SimpleExaminer portal wala submitted ZIP chahta hai. Local extra changes mat dikhana.

    Suggested flow1) Portal ZIP download
    2) Extract
    3) venv + pip install -r requirements.txt
    4) flask run / python app.py

  2. 2
    - Show login page and login route code.
    Times asked 2
    Official solution

    SimpleLogin flow pehle poochta hai "tu kaun hai?", token milne ke baad har API pe wohi proof dikhate ho.

    Authentication step: Vue form email + password JSON POST karta hai. Flask user dhoondhta hai, check_password_hash se prove karta hai ki tum genuine ho. Galat 401. Sahi pe JWT + role milta hai — yeh session/token hai.

    Vue localStorage (ya cookie) mein token rakhta hai, dashboard pe router.push. Aage ki har fetch header: Authorization: Bearer <token>. @jwt_required identity check (authentication). @roles_required('admin') permission check (authorization) — logged in ho, lekin allowed nahi to 403.

    Validation alag cheez hai: empty email, password 8+ — form sahi bhara hai ya nahi. Woh identity prove nahi karta.

    Logout = client token delete + login page. Server blacklist optional. Password response JSON mein kabhi mat bhejo.

    Example

    # Authentication
    @app.route('/api/login', methods=['POST'])
    def login():
        u = User.query.filter_by(email=data['email']).first()
        if not u or not check_password_hash(u.password, data['password']):
            return jsonify(msg='bad'), 401
        return jsonify(token=create_access_token(u.id), role=u.role)
    
    # baad ki APIs
    # Authorization: Bearer <token>
    if current_user.role != 'admin':
        abort(403)

    Project example: Login.vue POST /api/login → token LS → interceptor. Student token se admin route = 403. Empty form = validation, galat password = 401.

    Viva tipNetwork tab mein password body dikhega localhost pe — prod HTTPS. Response mein hash/password echo mat karo.

  3. 3
    - Modify login code to print email when you click on the login button.
    Times asked 2
    Official solution

    SimpleSMTP = Simple Mail Transfer Protocol — email bhejne ka standard. Flask-Mail / smtplib se reminders/reports.

    Example

    from flask_mail import Message
    msg = Message('Subject', recipients=[user.email])
    msg.body = 'Hello'
    mail.send(msg)

    Viva tipViva mein MailHog/inbox dikhao. Port 587 TLS common; local pe MailHog 1025.

  4. 4
    - Is caching done? What all data is cached? Why so? Is there any timeout set? When or how does this update?
    Times asked 2
    Official solution

    SimpleCache = pehli baar hisaab karke copy rakh lo, doosri baar copy dikha do.

    Baar-baar same expensive kaam (DB query, counting bookings) mat karo. Result Redis jaise store mein timeout ke saath rakh do.

    Cache hit: key mil gayi, DB skip. Cache miss: DB se lao, SET karo, return karo.

    Tradeoff: speed vs stale data. Admin naya venue add kare aur cache 50s ka ho to user purani list dekh sakta hai — isliye write pe invalidation zaroori hai.

    Browser cache, Flask-Caching, Redis alag layers hain. MAD2 examiner Redis + @cache.cached code dekhta hai.

    Example

    @cache.cached(timeout=50, query_string=True)
    @app.route('/api/shows')
    def shows():
        return jsonify([s.serialize() for s in Show.query.all()])

    Project example: Admin dashboard counts / venues list cache. Create/update/delete ke baad cache.delete('venues').

    Viva tipprint('DB queried') function ke andar laga ke miss/hit demo karo — hit pe print nahi chalega.

  5. 5
    - Have you done any CSV exports? Show the same. (Explained how I had done and fallback as well)
    Times asked 2
    Official solution

    SimpleClick → Celery → worker CSV → email/download. Columns verify.

    csv module. Auth required. Don't freeze UI — 202 + poll.

    Examiner 2 cheezein: simple desi line + tumhare project ki exact file.

    Pehle ID, GitHub, portal ZIP. Phir run: Redis + Flask + worker + beat + Vue. Feature demo: login, RBAC, cache hit/miss, Celery mail, search.

    Line pe ungli: input kahan, kaunsa check, query/cache/task, JSON/UI. Copilot band. Jo nahi kiya honestly bolo + kaise add karte.

    Example

    @celery.task
    def export_venues_csv(user_id):
        rows = Venue.query.all()
        # csv.writer, mail.send
        return 'ok'

    Project example: Admin export venues. MailHog attach ya file open.

    Viva tipNetwork tab mein job trigger API dikhao, phir MailHog/file open karke columns verify karo.

  6. 6
    - Wished all the very best for Level 2.
    Times asked 2
    Official solution

    SimpleLevel = viva difficulty band. Level 1 usually demo + basics; higher pe live coding + deeper theory.

    Viva tipJo level assign hai uske hisaab se demo + theory ready rakho.

Advice: - Be respectful and polite. Proctor is very respectful and accommodating. Do not stress, proctor is very calm. Proctor will give pointers or hints if things get stuck. - If you can't find the code, explain everything related to what code is asked and how you implemented and why such scenarios happen. - When coding, try to explain what you are doing and how exactly you have done it and why rather than coding in silence. - Might sometimes indirectly check all requirements through specific questions or asking for particular implementations or functionality demo. (Session-based logins, Celery Tasks, MailHog, Caching, Vue Routing, etc.). - Try to explain theory and other choices made when showing the code or showing the working of that feature. Try to tie theory concepts and implementation choices directly when showing so less chance of more questions asked. - Proctor may join early so make sure to join at least 10-15 earlier. It will be advantageous especially since most people might have issues with running the code; you can use that extra time to setup everything accordingly to make sure your code runs with no issues.
  1. 1
    Everything which is mentioned earlier in the sheet.
    Times asked 2
    Official solution

    SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest hai.

  2. 2
    Just follow the sheet he will ask exactly the same questions.
    Times asked 2
    Official solution

    SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest hai.

Advice: Take a chill pill he is very chill proctor. My app got crashed db was not sending data … celery beat and worker stopped working still he said take time its server and network issues, so no problem. Then it started working and done. Very good proctor. My L2 was easier than L1 tbh.
  1. 1
    Explain code and project everything he don't ask anything in between be ready to keep explaining for 40 45 mins
    Times asked 2
    Official solution

    SimpleCode explain formula: input kya aaya → auth/validation → DB change → response/UI.

    Viva tipFunction signature + 3-4 important lines + edge case.

  2. 2
    code 300,401,500
    Times asked 2
    Official solution

    SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest hai.

  3. 3
    other name for vcs
    Times asked 2
    Official solution

    SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest hai.

Advice: he won't question in between so just know your code enough that you talk about it for 1 hr if need Very lucky if you got him
  1. 1
    Give a demo. No panicking (my mic wasn't turning on, so turn on the mic of the second device to give the demo and provide all the backend explanations). ID setup:
    Times asked 1
    Official 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) Logout

    Viva tipBolte-bolte dikhao. Code tab kholna jab poochhein.

  2. 2
    He gave you all the time to explain.
    Times asked 2
    Official solution

    SimpleCode explain formula: input kya aaya → auth/validation → DB change → response/UI.

    Viva tipFunction signature + 3-4 important lines + edge case.

  3. 3
    Demonstrate everything you have (almost every file).
    Times asked 2
    Official 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) Logout

    Viva tipBolte-bolte dikhao. Code tab kholna jab poochhein.

  4. 4
    He asked about how you will scale your app.
    Times asked 2
    Official solution

    SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest hai.

  5. 5
    How did you test your backend and frontend?
    Times asked 2
    Official solution

    SimpleCode explain formula: input kya aaya → auth/validation → DB change → response/UI.

    Viva tipFunction signature + 3-4 important lines + edge case.

Advice: He maintains a calm demeanor, provides ample time, and offers constructive feedback. (The best proctor)
  1. 1
    how and where you are implementing caching
    Times asked 2
    Official solution

    SimpleCode explain formula: input kya aaya → auth/validation → DB change → response/UI.

    Viva tipFunction signature + 3-4 important lines + edge case.

  2. 2
    what is @jwt_required doing
    Times asked 2
    Official solution

    SimpleJWT teen tukde ki signed chitthi: header.payload.signature. Padhi ja sakti hai, badli nahi ja sakti.

    Encoded (Base64) + signed, encrypted nahi (JWE alag). Payload mein password mat daalo — koi jwt.io pe dekh lega.

    Login pe server secret se HMAC (HS256). Har API Authorization: Bearer <token>.
    Expiry exp. Change payload → signature fail → 401.

    Session MAD1 server yaad rakhta. JWT MAD2 client rakhta, server stateless-ish.

    Example

    eyJhbGciOiJIUzI1NiJ9.{"sub":1,"role":"admin"}.signature
    # Authorization: Bearer <token>

    Project example: POST /login → token LS. fetch interceptor header. @jwt_required APIs.

    Viva tipAlgo HS256. Secret env var. jwt.io pe payload dikhao, secret public site pe mat paste.

  3. 3
    why we are using const response, not var and let
    Times asked 2
    Official 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.

  4. 4
    few other questions cant remember
    Times asked 2
    Official solution

    SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest hai.

  1. 1
    Theory ques-
    Times asked 2
    Official solution

    SimpleTheory = concepts: ORM, MVC, auth vs authz, Jinja inheritance, sessions. 1-line def + project example.

  2. 2
    How is Vue.js different from Angular and React
    Times asked 2
    Official solution

    SimpleCode explain formula: input kya aaya → auth/validation → DB change → response/UI.

    Viva tipFunction signature + 3-4 important lines + edge case.

  3. 3
    Few other questions i don't remember
    Times asked 2
    Official solution

    SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest hai.

  1. 1
    Based on the video of the viva, here are the technical and conceptual questions asked by the proctor to the student:
    Times asked 2
    Official solution

    SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest hai.

  2. 2
    * **Celery Delay Method**: What is the functionality of the `.delay()` method when using Celery for background tasks in Python?
    Times asked 2
    Official 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.

  3. 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 2
    Official 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.

  4. 4
    * **Authentication**: How are you authenticating users (e.g., using JSON Web Tokens / JWT)?
    Times asked 2
    Official 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)
  5. 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 2
    Official 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().

  6. 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 2
    Official 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 run
  7. 7
    * **Storage Comparison**: How does local storage differ from session storage and cookies?
    Times asked 2
    Official 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().

  8. 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 2
    Official solution

    SimpleSQLite file-based DB — setup easy, MAD1 ke liye perfect. Production heavy traffic pe Postgres better.

    Example

    SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
  9. 9
    * **CORS**: Are you using cross-origin resource sharing (CORS) in your application, and how is it configured?
    Times asked 2
    Official 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.

  10. 10
    * **JavaScript Variable Declarations**: Why did you choose `const` instead of `let` or `var` for variable declarations in JavaScript?
    Times asked 2
    Official 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.

  11. 11
    * **JavaScript Typing**: Is JavaScript a statically typed language or a dynamically typed language?
    Times asked 2
    Official solution

    SimpleJavaScript browser/Node pe chalta hai — DOM, events, fetch/axios. MAD1 mein thoda JS; MAD2 mein Vue JS pe.

Maintaine By Lazy IITians Team + IITM BS students Regualr for More data you have