Viva prep · Real questions · Student experiences Enroll in Bootcamp

Study workspace

Viva Prep

Prepare in structure for the Project Mentorship.

5926 Questions
161 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
    2.Explain the folder structure
    Times asked 1
    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
    3.Demonstrate the entire app (I explained it for 20 min )
    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.

  3. 3
    6.Add a new attribute called EMERGENCY CONTACT to the entire system and show it on the forntend (added a new attribute in models.py then added the changes in registration to accept the value and displayed in admin manage users page as new column of emergency contact)(he asks this same question so practice it )
    Times asked 1
    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)
  4. 4
    7.Change the color of the registration button/login button
    Times asked 1
    Official 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.

  5. 5
    10. what is template inheritance
    Times asked 1
    Official solution

    SimpleBase template pe navbar/footer, child pages {% extends %} + {% block %} se content bharte hain. DRY.

    Example

    {# base.html #}
    {% block content %}{% endblock %}
    
    {# home.html #}
    {% extends 'base.html' %}
    {% block content %}
      <h1>Home</h1>
    {% endblock %}
  6. 6
    11.Explain {{ }}and {% %}
    Times asked 1
    Official solution

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

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

Advice: Very Nice and chill proctor did not interrupted ,gave time to solve the coding question . he asks the same questions from the sheets ,so if you have the same proctor just practice the sheet questions you will easily clear it . very nice overall also suggested me to improve my communication skills ,i was stopping in between that's why maybe.
  1. 1
    Level3_45 :
    Times asked 1
    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.

  2. 2
    Explain the folder structure in detail and describe how MVC is followed
    Times asked 1
    Official 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.

  3. 3
    Explain models.py in detail
    Times asked 1
    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)
  4. 4
    Run the application, what is the use of venv
    Times asked 1
    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
  5. 5
    Open Admin dashboard, create a new trek
    Times asked 1
    Official solution

    SimpleProject overview: problem → roles → main entities → key flows (register, book, admin approve).

    Viva tip1 minute elevator pitch ready rakho, phir demo.

  6. 6
    Add a new parameter named description in the create form, and set the limit to atleast 20 words.
    Times asked 1
    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
    How would you align a card exactly in the middle of the webpage.
    Times asked 1
    Official 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.

  8. 8
    Go to user interface, in the available treks make the trek name clickable but it should not redirect to any other page
    Times asked 1
    Official 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'))
  9. 9
    What are sessions and cookies
    Times asked 1
    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().

  10. 10
    Create an empty list and add 2 locations in it
    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.

  11. 11
    Create a new route in admin named /square where you take integer input and return its square.
    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.

Advice: Review : Overall a very calm and understanding proctor, but she checks ur basic theory till the very depth be sure u are prepared with the project's deeper understanding.
  1. 1
    Level 2 (LEVEL3_47)
    Times asked 1
    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.

  2. 2
    Explain all models in models.py.
    Times asked 1
    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
    Explain all database constraints.
    Times asked 1
    Official solution

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

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

  4. 4
    Add a new attribute (e.g., emergency phone) to the entire system.(I explained that my current project doesn't use Flask-Migrate, so I would recreate the SQLite database after updating the model. The examiner accepted this approach.)
    Times asked 1
    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'
  5. 5
    Difference between Cell Padding and Cell Spacing.
    Times asked 3
    Official 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.

  6. 6
    Explain CSRF with a real-life example.
    Times asked 1
    Official solution

    SimpleCSRF: attacker tumhari logged-in browser se unwanted POST. CSRF token form mein proof hai request genuine hai.

    Viva tipFlask-WTF CSRF protect karta hai. Token bina POST reject.

  7. 7
    What is Secret Key?
    Times asked 1
    Official solution

    SimpleSECRET_KEY Flask ka secret jisse session cookies sign/encrypt hoti hain.

    app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'dev-key')

    Iske bina session/flash unreliable ya insecure. Key leak = attacker session forge kar sakta hai.
    Hardcode mat karo production mein — .env / environment variable. Flash messages bhi session use karti hain, isliye SECRET_KEY se related hain.
    Hataane pe session kaam nahi / warning. Change karne pe purane sessions invalid.

  8. 8
    Explain how the Jinja template engine works.
    Times asked 1
    Official 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 %}
  9. 9
    Explain {{ }} ( Expression Delimiters ) and {% %} ( Statement Delimiters).
    Times asked 1
    Official solution

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

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

  10. 10
    Explain Template Inheritance.
    Times asked 1
    Official solution

    SimpleBase template pe navbar/footer, child pages {% extends %} + {% block %} se content bharte hain. DRY.

    Example

    {# base.html #}
    {% block content %}{% endblock %}
    
    {# home.html #}
    {% extends 'base.html' %}
    {% block content %}
      <h1>Home</h1>
    {% endblock %}
Advice: Friendly examiner. Be ready to explain your project and make small code changes on the spot (e.g., adding a field or changing Bootstrap styles). Understanding your code is more important than memorizing definitions. And duration: ~30-35 minutes.
  1. 1
    Viva ends in 28 min
    Times asked 1
    Official solution

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

  2. 2
    First show me the db diagram and tell me about the models.py in your app and all constraints
    Times asked 1
    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
    Explain the entire controller how it works from one to different routes
    Times asked 1
    Official solution

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

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

  4. 4
    In user registration page add an extra attribute "phone" to the entire frontend and backend system. (Without deleting existing data and all the existing row contains Null values is phone attributes)
    Times asked 1
    Official solution

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

Advice: Viva ends in 28 min The proctor was very nice. My experience was: "You have to prepare for explaining every line of your code."
  1. 1
    5 Ask to do changes in the user dashboard in the username she asked me to do username as a clickable link
    Times asked 1
    Official solution

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

  2. 2
    7 What is overflow in the css
    Times asked 1
    Official solution

    SimplePehle 1-line definition, phir apne MAD1 project mein file dikhao, phir chhota example.

    Suggested flow1) Concept kya hai?
    2) Mere code mein kahan?
    3) Example / demo
    4) Edge case

    Example

    # related file: models.py / routes / template
    # formula: request → check/auth → DB → render/redirect

    Viva tipExact line yaad nahi to honestly related part dikhao. Bluff mat karo.

  3. 3
    8 Write a piece of code using jinja2 and show the list= ["a", "b", "c"] which shows the output 1a, 2b, 3c
    Times asked 1
    Official 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 %}
  4. 4
    9 Create a route which takes number from the url as an input and returns square of that number
    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.

  5. 5
    10 Write a python sql query where you show all the bookings for the logged in user
    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.

  6. 6
    12 What is render template
    Times asked 1
    Official solution

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

  7. 7
    14 Explain the login and logout route
    Times asked 1
    Official solution

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

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

  8. 8
    15 Explain book trek route
    Times asked 1
    Official solution

    SimpleProject overview: problem → roles → main entities → key flows (register, book, admin approve).

    Viva tip1 minute elevator pitch ready rakho, phir demo.

  9. 9
    16 What is the use of url_for()
    Times asked 1
    Official solution

    Simpleurl_for endpoint name se URL banata hai — hardcode path mat likho.

    Example

    url_for('auth.login')
    url_for('static', filename='css/style.css')
  10. 10
    18 Difference between backref and back-populates
    Times asked 1
    Official solution

    Simplebackref reverse attribute auto banata hai. back_populates dono sides explicitly naam dete ho — clearer.

    Example

    # backref
    spots = db.relationship('Spot', backref='lot')
    # spot.lot available
    
    # back_populates
    spots = db.relationship('Spot', back_populates='lot')
    # Spot.lot = db.relationship('Lot', back_populates='spots')
Advice: She is very calm and helping proctor she gave the time to think and to write the code mostly she asked the questions which is present in the sheet. Stay calm and confident and know the every line of your code.
  1. 1
    My Level 1 Viva was on 24th July.🫠 (Too late to post I know, I was too packed up in my schedule lol,just got free so thought to share atleast ) Proctor ID : level1_2 Slot: 9:30 to 10 PM Look the proctor was very chill, no need to get nervous at all. He is very calm and asks easy and basic questions, know your project well both the code and the front end part(especially) he asks mainly from here only what feature you have implemented and how is it working, what is your logic in this project, just tell yours what you have implemented in your project. Here are some questions which I remember :
    Times asked 1
    Official solution

    SimpleGET data read/show karta hai (idempotent). POST create/submit karta hai (form).

    Example

    @app.route('/login', methods=['GET', 'POST'])
    def login():
        if request.method == 'POST':
            # validate + session
            ...
        return render_template('login.html')
  2. 2
    Show your Github repo and collaborators
    Times asked 1
    Official solution

    SimpleGitHub repo open karo: commits, collaborators, README. Examiner check karta hai tumne khud kaam kiya.

    Example

    Settings → Collaborators
    Commits: regular messages, last-day dump nahi.

    Viva tipPrivate repo access pehle de do. Main branch submitted ZIP se match honi chahiye.

  3. 3
    Screenshare and asked to run my project
    Times asked 1
    Official solution

    SimpleProject overview: problem → roles → main entities → key flows (register, book, admin approve).

    Viva tip1 minute elevator pitch ready rakho, phir demo.

  4. 4
    Asked some tasks to do like register as new trekker , login and show the trekkers dashboard, book treks, cancel booking, show trekking history
    Times asked 1
    Official solution

    SimpleProject overview: problem → roles → main entities → key flows (register, book, admin approve).

    Viva tip1 minute elevator pitch ready rakho, phir demo.

  5. 5
    Then he said to login as admin and show me admin dashboard, the tables there , do you have implemented search filter there can admin search for staff, trekker by using the id or their registered name on the website. I showed him that admin even have filter to show only staff lists or trekkers lists, he can also see all the bookings made by trekkers and if they cancel it , then it is not shown in admin dashboard, it will remove immediately from there
    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.

  6. 6
    Then in admin dashboard only he told me to create new treks, edit treks, edit the date, he asked me one imp thing if the date is passed then will admin be able to create trek on past date? I told him "yes" and then one logic will work there, cur date will be checked in the backend and if the date is already passed then the status in the database and the admin dashboard table will change to "completed " and if it is completed then it won't show in available treks to book option for trekkers.
    Times asked 1
    Official solution

    SimpleProject overview: problem → roles → main entities → key flows (register, book, admin approve).

    Viva tip1 minute elevator pitch ready rakho, phir demo.

  7. 7
    He asked me one more imp thing that if there are 1000 treks lets say then do you have some thing kind of populates pages i dont remember the term exactly but he meants that if the list is big then will it shift to another page itself or it will be shown in same page only it wil get lined up below..i said yes sir, that is what will happen, it will just get added one below after below in single page only, admin need to scroll below to see al those 1000 treks, he will found. Then he said okay, perfect
    Times asked 1
    Official solution

    SimpleMAD1 typical: Browser → Flask routes → validate/auth → SQLAlchemy → SQLite → Jinja response.

    Suggested flowRequest → Route → Auth check → DB → render_template / redirect

  8. 8
    Then in the start of admin dashboard I had a section of staff approval, he told me to register as staff and login
    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.

  9. 9
    I showed him that staff to have option to self register but they can't login to staff dashboards until and unless admin verifies and approved their data
    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.

  10. 10
    He told me to show , I showed the red flash was coming "Admin approval pending"
    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.

  11. 11
    Then he told me to approve staff if and then login and show me the staff dashboard
    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.

  12. 12
    Then he again told me to move on to admin dashboard and assign one trek to this newly created staff
    Times asked 1
    Official solution

    SimpleProject overview: problem → roles → main entities → key flows (register, book, admin approve).

    Viva tip1 minute elevator pitch ready rakho, phir demo.

  13. 13
    Show in the staff dashboard how is it showing there
    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.

  14. 14
    Then told me to show what staff can do he can edit trek status and change the slots he asked me what happens when slots become 0 I said , then the status will automatically change to "closed or completed " and it wont show in available treks to book section in trekkers dashboard
    Times asked 1
    Official solution

    SimpleCamera pe clearly college/IITM ID dikhao — naam aur photo match hone chahiye.

    Viva tipPehle se ID haath mein rakho, glare mat aane do. Iske baad GitHub + project run.

  15. 15
    He told me to go in Edit Profile section and change the name , keep the password same, and try login
    Times asked 1
    Official 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.

  16. 16
    Then he asked is that name showing above in navbar in user dashboard is it clickable? I said no
    Times asked 1
    Official 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.

  17. 17
    He said to make the text clickable and on clicking it the edit profile page gets opened
    Times asked 1
    Official 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.

  18. 18
    I did it,altho i was unsure if I will be able to do ,I said I will try sir he said ok do it, then i did
    Times asked 1
    Official solution

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

  19. 19
    Then he said blacklist some user or staff and try login I said he wont be able to the red flash will come then he said what will happen then, i said his id will be removed from the database and he again have to create id and relogin after admin approval (in case of staff)
    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.

  20. 20
    Then he said can it be undone i said yes i had a restore button just beside blacklist button
    Times asked 1
    Official solution

    SimpleBlacklist/block: user.status='blocked' check login/booking pe. Temporary flag vs hard delete permanent.

  21. 21
    Finally he moved to theory questions
    Times asked 1
    Official solution

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

  22. 22
    He asked me what is ORM and what are its adv I explained ORM and told some adv blindly which I mugged up but i understood one adv deeply and how it works behind I told him that I can recall one adv nicely rn he told me to explain it with an example, i explained , he listened paitently, i explained using my models.py file, i showed him in code how it will work if it was RAW SQL( it was the sql injection part, which hacker can try, if we won't have used ORM)
    Times asked 1
    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
  23. 23
    He asked me have u used any ORM here , i said yes its flask sqlalchemy he told me to explain it
    Times asked 1
    Official 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()
  24. 24
    Next, he said open models.py file and explain the whole thing. I did
    Times asked 1
    Official solution

    SimpleProject overview: problem → roles → main entities → key flows (register, book, admin approve).

    Viva tip1 minute elevator pitch ready rakho, phir demo.

  25. 25
    Then at the end , he asked one very easy qn to change the port no. To 5413 and show the project in diff port how will u do it, i said umm umm..may be in terminal sir🥹 he laughed ok can u open app.py file and check last line there in app.run you can add one parameter then i recalled o yes sir i recall then I did it, this was the only qn where I got stuck and may be couldnt ans 100%
    Times asked 1
    Official 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.

  26. 26
    I did , and he said, okay that is all from my side
    Times asked 1
    Official solution

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

  27. 27
    All the best for your level 2 viva, he told me what qns to prepare what will be asked, MVC, auth vs authorizn, jinja loop, note pad thing, temple inheritance, show MVC in code , some basic coding qn, change color of button add button i was like sir this I thought u will ask me I prepared this for level 1😅 i said okay sir thank you
    Times asked 1
    Official solution

    SimpleJinja for loop list render karta hai. loop.index, else branch empty list pe.

    Example

    {% for u in users %}
      <tr><td>{{ loop.index }}</td><td>{{ u.email }}</td></tr>
    {% endfor %}
  28. 28
    He said okay all the best Bye Also in the sheet, u won't find this id properly in one response it was mam, it is a sir actually so I am pasting the response too from where I prepared one of the stu shared me who had same proctor on same day just diff slot *_PREVIOUS RESPONSES_* "1. Give a brief demonstration of your project
    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.

  29. 29
    After I explained he asked to go back again to student_dashboard and asked to align the flash message to center as it was on the top-left so I did that.
    Times asked 1
    Official 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'))
  30. 30
    After this in navbar I used the links and Pipe symbol instead of buttons for [Profile | Edit Profile | Logout] so he asked to change these links into a buttons so I did that.
    Times asked 1
    Official 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.

  31. 31
    Then he asked me to go on database file, I thought he is asking for database.py (but it was models.py ) so he asked me from database.py only that what is the use of this file, why I used ORM ?
    Times asked 1
    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
  32. 32
    Then he asked http methods for CRUD operations but I thought he is asking me to explain what are CRUD operations so I started but then he said methods so I explained the GET, POST, PUT, DELETE then he asked have you heard of PATCH then I explained it then he said ok, Thank you, That's all from my side" "Asked me to download the project from the portal. Asked why I was using a virtual environment (venv). Asked me to give a demo of the project. Asked what cascade=""all, delete-orphan"" means in models.py. Asked me to change the position of the Edit Profile button. Asked me to replace Edit Profile text on the button with the name of the currently logged-in student. Asked what if __name__ == ""__main__"": means in app.py."
    Times asked 1
    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

Advice: Overall very chill, sweet, responsive proctor, he doesn't ask any tough qns ,just the basic coding and theory only he asks only from your project , nothing from outside prepare from sheet everything was from there only he repeats most of the qns.
  1. 1
    Show in route where u have implemented trek crud operations
    Times asked 1
    Official solution

    SimpleCRUD = Create Read Update Delete. Admin pe ek resource ke 4 ops dikhao.

  2. 2
    How have you prevented duplicate email creation
    Times asked 1
    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
    Explain all the classes u have created and their relationships
    Times asked 1
    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
    She was asking to explain particular lines of code in the project
    Times asked 1
    Official solution

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

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

  5. 5
    What is z-index
    Times asked 1
    Official solution

    SimplePehle 1-line definition, phir apne MAD1 project mein file dikhao, phir chhota example.

    Suggested flow1) Concept kya hai?
    2) Mere code mein kahan?
    3) Example / demo
    4) Edge case

    Example

    # related file: models.py / routes / template
    # formula: request → check/auth → DB → render/redirect

    Viva tipExact line yaad nahi to honestly related part dikhao. Bluff mat karo.

  6. 6
    How to center a div using css
    Times asked 1
    Official solution

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

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

  7. 7
    What is the difference between div and span tag
    Times asked 1
    Official solution

    SimpleMAD1 typical: Browser → Flask routes → validate/auth → SQLAlchemy → SQLite → Jinja response.

    Suggested flowRequest → Route → Auth check → DB → render_template / redirect

  8. 8
    Asked to write a route to create a new trek
    Times asked 1
    Official 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'
  9. 9
    Jinja code to display all the treks whose trek status is open
    Times asked 1
    Official 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 %}
  10. 10
    A single line of jinja code to display count of no of treks present
    Times asked 1
    Official 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 %}
  11. 11
    Explain difference between commit and rollback
    Times asked 1
    Official solution

    Simplecommit changes save. rollback fail pe undo. Transaction consistency ke liye.

    Example

    try:
        db.session.add(obj)
        db.session.commit()
    except Exception:
        db.session.rollback()
        raise
  12. 12
    Asked demo of the project
    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.

  13. 13
    Make changes in your code so that username should became a link but it should not redirect anywhere
    Times asked 1
    Official 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'))
  14. 14
    I might have forgot some qs but mostly she is asking the same quesstions from sheet
    Times asked 1
    Official solution

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

Advice: Keep ur theory strong she will ask a lot of theory questions and know your code well
  1. 1
    Show id. Checksum or Download. I chose downloading from the portal.
    Times asked 1
    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
    Questions asked were mostly theoretical.
    Times asked 1
    Official solution

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

  3. 3
    Explain MVC. How is it implemented in your app?
    Times asked 1
    Official 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.

  4. 4
    Explain the models in your code. Explain the relationships. (Backref and Back_populates).
    Times asked 1
    Official solution

    Simplebackref reverse attribute auto banata hai. back_populates dono sides explicitly naam dete ho — clearer.

    Example

    # backref
    spots = db.relationship('Spot', backref='lot')
    # spot.lot available
    
    # back_populates
    spots = db.relationship('Spot', back_populates='lot')
    # Spot.lot = db.relationship('Lot', back_populates='spots')
  5. 5
    Explain jinja. Write a code in jinja to show treks which have prices < 3000.
    Times asked 1
    Official 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 %}
  6. 6
    Difference between div and span tags in html.
    Times asked 1
    Official solution

    SimpleMAD1 typical: Browser → Flask routes → validate/auth → SQLAlchemy → SQLite → Jinja response.

    Suggested flowRequest → Route → Auth check → DB → render_template / redirect

  7. 7
    How are u tracking errors in the app? (debug = True). Why have u set debug=True?
    Times asked 1
    Official solution

    SimpleDebug: terminal traceback padho, print/logging, Flask debug, browser Network/Console, reproduce minimum steps.

  8. 8
    I had radio buttons for roles . Asked to make similar buttons for gender.
    Times asked 1
    Official 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.

  9. 9
    How have u prevented booking for already booked treks.
    Times asked 1
    Official solution

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

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

  10. 10
    If end_date before start_date causes an error in your application.
    Times asked 1
    Official solution

    SimplePehle 1-line definition, phir apne MAD1 project mein file dikhao, phir chhota example.

    Suggested flow1) Concept kya hai?
    2) Mere code mein kahan?
    3) Example / demo
    4) Edge case

    Example

    # related file: models.py / routes / template
    # formula: request → check/auth → DB → render/redirect

    Viva tipExact line yaad nahi to honestly related part dikhao. Bluff mat karo.

  11. 11
    Write the python program to fetch all the bookings for the logged in user.
    Times asked 1
    Official solution

    SimpleNaya Flask route: URL, method, auth if needed, query, jsonify. Postman pehle.

    Examiner number/filter change easy rakhna. CORS. Frontend tabhi jab bole.

    Status codes sahi. Password JSON mein nahi.

    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

    @app.route('/api/sum', methods=['POST'])
    def sum_num():
        d = request.get_json()
        return jsonify(result=d['a'] + d['b'])

    Project example: resources.py new Resource. Test Thunder. Optional Vue fetch.

  12. 12
    Can flask return a boolean value?
    Times asked 1
    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.

  13. 13
    Can flask handle multiple users?
    Times asked 1
    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.

  14. 14
    Something about Responsive Layouts.
    Times asked 1
    Official solution

    SimpleResponsive = alag screen pe layout adjust. Bootstrap grid / media queries / flex.

    Example

    @media (max-width: 768px) {
      .sidebar { display: none; }
    }
  15. 15
    Make the booking name in your html page a hyperlink but it doesnt redirect to anything.
    Times asked 1
    Official 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'))
  16. 16
    What if no url_for is passed to redirect?
    Times asked 1
    Official 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'))
  17. 17
    Demo. Asked to create a trek.
    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.

Advice: Prepare from the sheet questions. Make sure to know atleast something about all that is in your code. Viva was over in like 40 mins. Stay calm , most of the questions will be from the sheet and even the coding questions wont be too hard.(I was able to do the coding without her help)
Created for educational purposes only. Questions are based on students' personal experiences and may not reflect actual exam content.