Viva prep · Real questions · Student experiences Enroll in Bootcamp

Proctor workspace

Proctor Level1_128

Share your experience Add your viva experience here
281 Questions
37 Sets
0 Topics
16 Reviews
Tips for this examiner: He is unpredictable , can ask anything, be thorough with your code . Just make sure you know what you are doing and he does give 2nd chance , if you ask ( basically burry you) , be prepare to write code on notebook

Student reviews

Sheet response MAD1

My viva was the last slot, he was quite bored and uninterested in giving instructions. It took 20 minutes. He is asking basic questions in code, and to write basic syntax of html and jinja. Be prepared with simple and to the point answers. The proctor is chill and gives you time to think about your answer. If you do not know - say so he will clarify or ask another question. All the best!

Questions remembered
  1. MAD 1 Level 1 Viva:
  2. - Show student ID
  3. - Show Github collaborators
  4. - Run the app
  5. - Asked to login as admin, staff and user to check bookings
  6. - Write for loop in Jinja
  7. - Write flask route for names starting with letter "a"
  8. - Write html for taking email and password as input
  9. - CSS vs Bootstrap difference and definition
  10. - What are Git Versions
  11. - Asked to show model.py and explain what is db.model
Dheeraj MAD1

The viva instructors is kind and give us time to explain and too good dev manush 🤘🏻

Questions remembered
  1. Download project from the portal
  2. check if card
  3. checked GitHub collaborator
  4. ask me to write for loop in jinja 2
  5. write a search route
  6. asked me to login as admin
  7. add a trek assign it to staff
  8. create 2 staff(approval in admin)and 2 users
  9. assign both staff to different treks
  10. login as staff
  11. update the trek status to open and decrease no. Of slots to 1 user to book a slot which is open by staff
  12. the slots decrease by 1 then they asked me to again book for the same slot and then asked show me multiple booking prevention in the code then put vs post? Then what is virtual environments? That's it
Harshaa MAD1

Shared viva questions from response sheet: Write code using jinja which uses for loop then a flask statement for printing the input number is even or odd; Said to create staf and used and so on to perform certain actions; Uses of PUT and POST

Questions remembered
  1. Write code using jinja which uses for loop then a flask statement for printing the input number is even or odd
  2. Said to create staf and used and so on to perform certain actions
  3. Uses of PUT and POST
  4. Why we use Github
  5. Asked to show which part of the code is used to display the treks in user dashboard
  6. Then he just said thank you for coming to level 1 viva
Sheet response MAD1

Very polite and chill guy

Questions remembered
  1. asked to show id
  2. Download project from portal
  3. Asked for GitHub repository
  4. Asked me to open notepad and write the html code for a table
  5. Write a route for login page
  6. Asked me to demonstrate by registering two staff ,then two users
  7. Asked for edit profile for users and search functionality
  8. Asked me to show my models
  9. Asked me to write some basic flask codes
  10. Asked PUT and POST
  11. What is GIT
Khushi MAD1

Had a really nice attitude
I didn't have to say anything
He guided me throughout

Questions remembered
  1. 1.asked to show id
  2. Download project from portal
  3. Asked for GitHub repository
  4. Asked me to open notepad and write the html code for a table
  5. Write a route for login page
  6. Asked me to demonstrate by registering two staff ,then two users
  7. Asked for edit profile for users and search functionality
  8. Asked me to show my models
  9. Asked me show the code part where I have prevented booking if the slots are over
  10. Asked PUT and POST
  11. What is the purpose of GIT ....when I told the definition asked what is version control? Explain
  12. Asked definition of decorator
Sheet response MAD1

Prepare this sheet well and don't panic during viva

Questions remembered
  1. Level1_128: *Coding*
  2. Flask route to print even or odd number
  3. Any html code *Demonstration* Add 2 staff Add 2 trek Assign staffs to trek Try to book a trek with 0 slots Deactivate user *Theory questions*
  4. Difference between PUT AND POST
  5. Difference between Css and bootstrap
  6. Git vs GitHub
  7. Show which code creates the database
Sheet response MAD1

Shared viva questions from response sheet: also y we are using venv

Questions remembered
  1. also y we are using venv
Sheet response MAD1

Just be confident , even if u make some mistake while writing the code at the end he guides

Questions remembered
  1. -asked me id card, show collab,download project from viva portal
  2. -asked me to write the flask code for login
  3. -then asked me to write route to print whether the number is even or odd
  4. -what is api
  5. -filter vs filter_by
  6. -asked me to create data, then asked me to create new trek staff, trekker
  7. -show admin approving trekkstaff account,then assigning a trek to that staff with only one slot
  8. -then create 2 users and show how second user cant book the trek because slots are over
  9. -show this functionality in the code
  10. -and asked to show models.py
Kritagya Madaan MAD1

Proctor was very calm and chill

Questions remembered
  1. Modify colour of login button
  2. Write flask code to check number even or odd
  3. Add 2 staff and approve
  4. Add 2 trek assign 1 to each staff
  5. Create trek with one slot and book it
  6. Blacklist a staff and login that staff
  7. Asked about difference between post and put
  8. Relationship between css and bootstrap
  9. What is git
Khushi MAD1

Had a really nice attitude
I didn't have to say anything
He guided me throughout
Overall he was nice even though I didn't had a functionality in my project

Questions remembered
  1. Same proctor Level1_128 1.asked to show id
  2. Download project from portal
  3. Asked for GitHub repository
  4. Asked me to open notepad and write the html code for a table
  5. Write a route for login page
  6. Asked me to demonstrate by registering two staff ,then two users
  7. Asked for edit profile for users and search functionality
  8. Asked me to show my models
  9. Asked me show the code part where I have prevented booking if the slots are over
  10. Asked PUT and POST
  11. What is the purpose of GIT ....when I told the definition asked what is version control? Explain
  12. Asked definition of decorator
Sheet response MAD1

Got the last slot for the day at 10pm and despite that the examiner took a positive approach from the start. He was very patient and helpful where possible. He is sharp towards noticing details like filename accuracy and circular logic or avoidance of answers via fluff content. Be confident and clear in what you say, speak in a flow/rhythm if you don't know, say it; if you know and need a moment, also say it - he gives time to think, this is not a rapid fire contest. Good luck

Questions remembered
  1. Mad1 viva1
  2. Level1_128
  3. Show ID
  4. Show GitHub collaborator
  5. Download project from viva portal
  6. Run project
  7. Login as admin
  8. Write code to recreate core functionality of login page
  9. Write code to show list of all users whose name starts with "a"
  10. Show working of app
  11. Login as admin
  12. Show dashboard - manage treks, users, staff
  13. Register as staff1, staff2
  14. Approve staff as admin
  15. Add trek1, trek2 as admin with only 1 slot in each
  16. Assign staff1, staff2 to treks
  17. Login as staff and show treks assigned
  18. Blacklist staff1 and show blacklisting response as admin and staff
  19. Register as user1, user2
  20. Book trek1 as user1
  21. Try to book trek1 as user2 and show overbooking protection
  22. Show code segment where overbooking prevention is implemented
  23. Show code segment where database is made
  24. Git vs GitHub
  25. What is decorator
Sheet response MAD1

Got last slot for the day, and examiner was a little tired and despite that he was positive in his approach, very patient, and and helpful where possible. He's sharp as far as noticing details like filenames but generally forthcoming. Be confident in what you say, talk in a flow/rhythm instead of mumbling. If you need a moment, ask for it - examiner will give you time to think, it's not a rapid fire examination.

Questions remembered
  1. Show ID
  2. Show collaborator on GitHub
  3. Download project from viva page
  4. Run project
  5. Write html for login/registration page
  6. Write code to show users whose name starts with "a"
  7. Show working of app
  8. Login as admin
  9. Add treks
  10. Register as staff
  11. Approve staff as admin
  12. Show staff blacklisting capability - show blacklisting from admin and staff pages
  13. Assign treks to staff as admin
  14. Register as user
  15. Book open trek
  16. Show overbooking prevention trying to book trek with zero slots available
  17. Show code where overbooking prevention is implemented
  18. Git vs GitHub
  19. What is decorator
K MAD1

He seemed very calm and asked questions based on your answers as follow ups

Questions remembered
  1. Level 1 _ 128
  2. -asked me id card, show collab,download project from github
  3. -asked me to write the html code for the login form
  4. -then asked me to write route to print my name
  5. -asked me definition of PUT and POST
  6. -asked me definition of decorator and to show decorator in my application
  7. -asked me to create data, then asked me to create new trek staff, trekker
  8. -show admin approving trekkstaff account,then assigning a trek to that staff with only one slot
  9. -then create 2 users and show how second user cant book the trek because slots are over
  10. -show this functionality in the code
  11. -show search functionality in admin page
  12. then he said thank you for coming to viva
Panther MAD1

He was friendly

Questions remembered
  1. ID card and Repo collaboratos
  2. Asked to show demo of project by performing some actions like registering company, registering student, creating drive and applying to that drive as a student
  3. Authentication vs Authorization
  4. what is Sql alchemy
  5. what is Jinja template
  6. write a for loop using Jinja template in notepad
xyz MAD1

Shared viva questions from response sheet: Didn't showed the full project or demonstration; asked to change code both frontend and backend; jinja, flask, db, asked everything

Questions remembered
  1. Didn't showed the full project or demonstration
  2. asked to change code both frontend and backend
  3. jinja, flask, db, asked everything
Amandeep Singh MAD1

He is very helpful, i am bad at English communication, he gave option to talk in Hindi, also one thing doesn't work in front of him, he said no problem it's ok then countiue to ask diffrent question

Questions remembered
  1. I. First asked me to show id, then github to check collaborator and tell me to download and setup my project using venv asked what venv is? II. Then told me to show some Core functionality and ask to explain how it is working in code, he asked to show almost every functionality. III. Ask me to change code in search query so that if I write some department name , doctor of those department shows up. IV. Asked theory question
  2. Difference between authentication and authorization
  3. What is ORM And some common theory question like MVP and other. He Ask only 4, 5 common theory question.

Approved viva sets

  1. 1
    Change the colour of the form body
    Times asked 2
  2. 2
    Write route which takes a username and prints its role.
    Times asked 2
  3. 3
    Create 2 staffs and approve them .
    Times asked 2
  4. 4
    Blacklist one of the staffs and try to login
    Times asked 2
Advice: He is a helpful proctor and he will ask follow up questions on the basis of what you are saying.
  1. 1
    Login as Admin & add doctor, edit doctor
    Times asked 2
  2. 2
    Register as Patient & Login, Book slot
    Times asked 2
  3. 3
    Blacklist the doctor from the admin panel & try to login as same doctor
    Times asked 1
  4. 4
    My function was of deleting the doctor, but i named that as 'Blacklist'(in ui). Said Change the name from 'Blacklist' to 'Delete'. I searched & updated.
    Times asked 2
  5. 5
    Where you have used cache? Told me add a print statement in the route & asked how much will it be printed in that particular timeout time duration?
    Times asked 2
  6. 6
    What are lifecycle hooks? Where you have used & why?
    Times asked 2
  7. 7
    Told me to write a js function that can print your name.
    Times asked 2
  8. 8
    Good luck for your level 2 viva, focus on definitions.
    Times asked 1
Advice: Being Clear & confident. Gives time if you are not able to recall. Very very nice proctor. Most important Be humble & talk in respectfull tone.
  1. 1
    Asked to demonstrate celery tasks.
    Times asked 1
  2. 2
    Came a bit late so didnt asked any code changes.
    Times asked 2
  3. 3
    All the best
    Times asked 2
Advice: Chill guy, be confident and make sure that everything is working beforehand.
  1. 1
    Time slot: 14:30-15:00
    Times asked 2
  2. 2
    - Checked Git repo if collaborators are added
    Times asked 1
  3. 3
    - Download the project and start running, (proctor will ask to create doctor, then assign availablity, then book appointment for the same availability slot for a patient, etc)
    Times asked 1
  4. 4
    - Celery tasks demo
    Times asked 2
  5. 5
    -- Theory Questions:
    Times asked 2
  6. 6
    - vue life-cycle hooks
    Times asked 2
  7. 7
    - write a flask route: return name of the user from usertable, given role=admin.
    Times asked 2
Advice: Stay confident, very decent proctor
  1. 1
    download file and run
    Times asked 1
  2. 2
    what is lifecycle in vue?
    Times asked 1
  3. 3
    what is cache ?
    Times asked 1
  4. 4
    what is tokenbase authentication ?
    Times asked 1
  5. 5
    write a simple route to fetch approve application ( application(table), status(column) (approved, pending)?
    Times asked 1
  6. 6
    write javascripts function
    Times asked 2
Advice: he is good guy ( mahamanus, mahapurush ) is proctor ne meri bahut help he explain karne me ( he say if you are not comfortable you can explain and answer in hindi )
  1. 1
    - download the code and run it, how are you running it, why so many command prompts?
    Times asked 1
  2. 2
    - register a company and show on admin page if its getting approval request or not
    Times asked 2
  3. 3
    - the total number of companies contain the ones without approval or not, change it to vice versa
    Times asked 2
  4. 4
    - show sending mail rightnow by modifying date an time
    Times asked 2
  5. 5
    - code a simple route
    Times asked 2
  6. 6
    - code a js function in notepad
    Times asked 2
  7. 7
    - show me csv feature of admin
    Times asked 2
Advice: My experience was him was kind of decent was very patient and understanding, my laptop was lagging idk why but he still gave me time to relax and not be nervous so understand the celery part and admin part well and it should go well.
  1. 1
    Phir kuch error aa rha tha usme kha error dhund ke correct kro maiine kiya
    Times asked 2
  2. 2
    Fir caching aur kha implement kiya
    Times asked 2
  3. 3
    Phir model.py ki random line ko explain kro
    Times asked 2
  4. 4
    Single page app
    Times asked 2
  5. 5
    Phir last me 5 min hai edge cases dhundo aur correct kro
    Times asked 2
  6. 6
    Phir sidebar ka color change then last me khta
    Times asked 2
  7. 7
    Feedback bola toh khta u have explained enough good
    Times asked 2
Advice: Shi bnda h
  1. 1
    LEVEL 1
    Times asked 6
  2. 2
    - show id card
    Times asked 2
  3. 3
    - show collaborators
    Times asked 2
  4. 4
    - download from portal and run
    Times asked 1
  5. 5
    - token or session management
    Times asked 2
  6. 6
    - show where tokens are being sent in frontend
    Times asked 1
  7. 7
    - asked to print("cached") and show it in the terminal and where it is being updated
    Times asked 2
Advice: be thorough with the basic functionality implementation and do not let him smell fear
  1. 1
    Level1, slot:- 3.00-3.30 pm
    Times asked 2
  2. 2
    id check, download from portal
    Times asked 2
  3. 3
    no demonsation,
    Times asked 2
  4. 4
    then demo of celery export
    Times asked 2
  5. 5
    then ask me to show cache in code
    Times asked 1
  6. 6
    then ask me a logic question that write a print statement below cache.set and then he ask if we run this api in frontend then first time print statement run on terminal but what happens in second time? does it print second time also and if not yhen why?
    Times asked 2
  7. 7
    then Set celery monthly task from 1st of month to present time
    Times asked 2
  8. 8
    then ask about lifecycle hooks
    Times asked 2
  9. 9
    last Write route to fetch all spot that are occupied and all user in notepad
    Times asked 2
Advice: confidently tell your code and If you not confident in some section of your code and not able to explain or any other thing than just say that i am sorry sir, i learn this on bootcamp and TA live session on YouTube and implement it, and now i am not able to recall exact detail.this statement prevents proctor to think that you use llm
  1. 1
    Don't remember excatly- mostly one frontend , backend , routes by just seeing db , add frontend code.
    Times asked 2
Advice: He is unpredictable , can ask anything, be thorough with your code . Just make sure you know what you are doing and he does give 2nd chance , if you ask ( basically burry you) , be prepare to write code on notebook
  1. 1
    - Run the app
    Times asked 3
    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
  2. 2
    - Write flask route for names starting with letter "a"
    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'
  3. 3
    - Write html for taking email and password as input
    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.

  4. 4
    - CSS vs Bootstrap difference and definition
    Times asked 1
    Official solution

    SimpleBootstrap CSS framework — grid, navbar, buttons jaldi. CDN ya downloaded files.

  5. 5
    - What are Git Versions
    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
    - Asked to show model.py and explain what is db.model
    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)
Advice: My viva was the last slot, he was quite bored and uninterested in giving instructions. It took 20 minutes. He is asking basic questions in code, and to write basic syntax of html and jinja. Be prepared with simple and to the point answers. The proctor is chill and gives you time to think about your answer. If you do not know - say so he will clarify or ask another question. All the best!
  1. 1
    check if card
    Times asked 1
    Official solution

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

  2. 2
    checked GitHub collaborator
    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
    write a search route
    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'
  4. 4
    asked me to login as admin
    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
    create 2 staff(approval in admin)and 2 users
    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
    assign both staff to different treks
    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.

Advice: The viva instructors is kind and give us time to explain and too good dev manush 🤘🏻
  1. 1
    Said to create staf and used and so on to perform certain actions
    Times asked 1
    Official solution

    SimpleState management (Vuex/Pinia): shared app state. Advantage: props drilling kam, auth/cart central.

  2. 2
    Uses of PUT and POST
    Times asked 1
    Official solution

    SimplePOST naya janam (har baar naya id). PUT poori photo replace. PATCH sticker chipkao.

    POST create, not idempotent. PUT full update, idempotent. PATCH partial.

    POST ki jagah PUT se REST semantics toot. GET typically no body.

    CRUD map: POST create, GET read, PUT/PATCH update, DELETE delete.

    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.

    Example

    POST /api/venues
    PUT  /api/venues/1   {all fields}
    PATCH /api/venues/1 {only name}

    Project example: POST /api/venues create. PUT /venues/1 saari fields. PATCH sirf name.

  3. 3
    Why we use Github
    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.

  4. 4
    Asked to show which part of the code is used to display the treks in user dashboard
    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.

  1. 1
    Asked me to write some basic flask codes
    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'
Advice: Very polite and chill guy
  1. 1
    1.asked to show id
    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.

Advice: Had a really nice attitude I didn't have to say anything He guided me throughout
  1. 1
    Difference between Css and bootstrap
    Times asked 1
    Official solution

    SimpleBootstrap CSS framework — grid, navbar, buttons jaldi. CDN ya downloaded files.

  2. 2
    Show which code creates the database
    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 this sheet well and don't panic during viva
  1. 1
    also y we are using venv
    Times asked 1
    Official solution

    SimpleVirtualenv isolated Python env — project deps system Python ko nahi bigaadte.

    Example

    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
  1. 1
    -then asked me to write route to print whether the number is even or odd
    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'
  2. 2
    -filter vs filter_by
    Times asked 1
    Official solution

    Simplefilter_by kwargs equality. filter expressions >, ilike, joins.

    Difference filter and filter_by.

    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.

    Example

    User.query.filter_by(email='a@b.com').first()
    User.query.filter(User.age > 30, User.name.ilike('%ram%')).all()

    Project example: email filter_by. age>30 filter.

  3. 3
    -and asked to show 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)
Advice: Just be confident , even if u make some mistake while writing the code at the end he guides
  1. 1
    Modify colour of 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.

  2. 2
    Add 2 staff and approve
    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
    Add 2 trek assign 1 to each 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.

  4. 4
    Create trek with one slot and book it
    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
    Relationship between css and bootstrap
    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')
Advice: Proctor was very calm and chill
  1. 1
    Asked for GitHub repository
    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.

  2. 2
    Asked me to demonstrate by registering two staff ,then two users
    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
    Asked for edit profile for users and search functionality
    Times asked 1
    Official 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()
  4. 4
    Asked me to show my models
    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)
  5. 5
    Asked me show the code part where I have prevented booking if the slots are over
    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: Had a really nice attitude I didn't have to say anything He guided me throughout Overall he was nice even though I didn't had a functionality in my project
  1. 1
    Mad1 viva1
    Times asked 1
    Official solution

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

  2. 2
    Level1_128
    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.

  3. 3
    Write code to recreate core functionality of login page
    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.

  4. 4
    Show dashboard - manage treks, users, 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.

  5. 5
    Register as staff1, staff2
    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
    Add trek1, trek2 as admin with only 1 slot in each
    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
    Assign staff1, staff2 to treks
    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.

  8. 8
    Login as staff and show treks assigned
    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
    Blacklist staff1 and show blacklisting response as admin and staff
    Times asked 1
    Official solution

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

  10. 10
    Register as user1, user2
    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
    Book trek1 as user1
    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.

  12. 12
    Try to book trek1 as user2 and show overbooking protection
    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 code segment where database is made
    Times asked 1
    Official solution

    SimpleCode dikhao to pehle related file: models → route → template. Flow explain karte hue lines padho.

Advice: Got the last slot for the day at 10pm and despite that the examiner took a positive approach from the start. He was very patient and helpful where possible. He is sharp towards noticing details like filename accuracy and circular logic or avoidance of answers via fluff content. Be confident and clear in what you say, speak in a flow/rhythm if you don't know, say it; if you know and need a moment, also say it - he gives time to think, this is not a rapid fire contest. Good luck
  1. 1
    Run project
    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
  2. 2
    Write html for login/registration page
    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
    Write code to show users whose name starts with "a"
    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.

  4. 4
    Show working of app
    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
    Add treks
    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
    Register as 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.

  7. 7
    Approve staff as admin
    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.

  8. 8
    Show staff blacklisting capability - show blacklisting from admin and staff pages
    Times asked 1
    Official solution

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

  9. 9
    Assign treks to staff as admin
    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.

  10. 10
    Register as 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.

  11. 11
    Book open 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.

  12. 12
    Show overbooking prevention trying to book trek with zero slots available
    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 code where overbooking prevention is implemented
    Times asked 1
    Official solution

    SimpleCode dikhao to pehle related file: models → route → template. Flow explain karte hue lines padho.

  14. 14
    Git vs GitHub
    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.

  15. 15
    What is decorator
    Times asked 1
    Official solution

    Simplelogin_required jaisa decorator protected routes pe: session nahi to login redirect.

    Example

    def login_required(fn):
        @wraps(fn)
        def wrapper(*a, **k):
            if 'user_id' not in session:
                return redirect(url_for('auth.login'))
            return fn(*a, **k)
        return wrapper
Advice: Got last slot for the day, and examiner was a little tired and despite that he was positive in his approach, very patient, and and helpful where possible. He's sharp as far as noticing details like filenames but generally forthcoming. Be confident in what you say, talk in a flow/rhythm instead of mumbling. If you need a moment, ask for it - examiner will give you time to think, it's not a rapid fire examination.
  1. 1
    -asked me to write the html code for the login form
    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
  2. 2
    -then asked me to write route to print my name
    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'
  3. 3
    -asked me definition of PUT and POST
    Times asked 1
    Official solution

    SimplePOST naya janam (har baar naya id). PUT poori photo replace. PATCH sticker chipkao.

    POST create, not idempotent. PUT full update, idempotent. PATCH partial.

    POST ki jagah PUT se REST semantics toot. GET typically no body.

    CRUD map: POST create, GET read, PUT/PATCH update, DELETE delete.

    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.

    Example

    POST /api/venues
    PUT  /api/venues/1   {all fields}
    PATCH /api/venues/1 {only name}

    Project example: POST /api/venues create. PUT /venues/1 saari fields. PATCH sirf name.

  4. 4
    -asked me definition of decorator and to show decorator in my application
    Times asked 1
    Official solution

    Simplelogin_required jaisa decorator protected routes pe: session nahi to login redirect.

    Example

    def login_required(fn):
        @wraps(fn)
        def wrapper(*a, **k):
            if 'user_id' not in session:
                return redirect(url_for('auth.login'))
            return fn(*a, **k)
        return wrapper
  5. 5
    -asked me to create data, then asked me to create new trek staff, trekker
    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
    -show admin approving trekkstaff account,then assigning a trek to that staff with only one slot
    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
    -then create 2 users and show how second user cant book the trek because slots are over
    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.

  8. 8
    -show this functionality in the code
    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
    -show search functionality in admin page
    Times asked 1
    Official 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()
  10. 10
    then he said thank you for coming to viva
    Times asked 1
    Official solution

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

Advice: He seemed very calm and asked questions based on your answers as follow ups
  1. 1
    ID card and Repo collaboratos
    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.

  2. 2
    Asked to show demo of project by performing some actions like registering company, registering student, creating drive and applying to that drive as a student
    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
    what is Sql alchemy
    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()
  4. 4
    what is Jinja template
    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 %}
Advice: He was friendly
  1. 1
    Didn't showed the full project or demonstration
    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
    asked to change code both frontend and backend
    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.

  3. 3
    jinja, flask, db, asked everything
    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 %}
Advice: nope
  1. 1
    Change the colour of the form body
    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
  2. 2
    Write route which takes a username and prints its role.
    Times asked 2
    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'
  3. 3
    Difference between filter and filter_by
    Times asked 1
    Official solution

    Simplefilter_by simple keyword arguments, filter full SQL-style conditions.

    User.query.filter_by(email='a@x.com').first()  # column=value, easy
    User.query.filter(User.age > 18, User.city == 'Delhi').all()  # comparisons, OR, LIKE

    filter_by sirf equals ke liye. Greater-than, LIKE, joins ke liye filter() use karo.

    Example search

    Trek.query.filter(Trek.name.ilike(f'%{q}%')).all()

    Yeh filter_by se nahi hoga.

  4. 4
    Create 2 staffs and approve them .
    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.

  5. 5
    Blacklist one of the staffs and try to login
    Times asked 2
    Official solution

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

  6. 6
    Show where this logic is implemented
    Times asked 1
    Official solution

    SimpleDemo 5–7 min ki kahani: saari roles, koi milestone skip nahi, bolte-bolte dikhao.

    Examiner list tick karta hai. Crash ho to panic nahi — terminal error padho.

    Code tab kholna jab poochhein. Extra uncommitted features mat dikhana agar portal ZIP mein nahi.

    Suggested flow1) Register/login user
    2) Admin login — CRUD
    3) Approval/blacklist
    4) Booking/apply + edge case
    5) Search + charts
    6) CSV export / email job
    7) Logout

    Project example: Jo statement/parking/jobs/tickets hai uske user+admin journeys.

    Viva tipBol: 'Yahan overbooking rokta hoon'. Mandatory features pehle, polish baad.

  7. 7
    What is server
    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

Advice: He is a helpful proctor and he will ask follow up questions on the basis of what you are saying.
  1. 1
    Login as Admin & add doctor, edit doctor
    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
    Register as Patient & Login, Book slot
    Times asked 2
    Official solution

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

  3. 3
    My function was of deleting the doctor, but i named that as 'Blacklist'(in ui). Said Change the name from 'Blacklist' to 'Delete'. I searched & updated.
    Times asked 2
    Official 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()
  4. 4
    Where you have used cache? Told me add a print statement in the route & asked how much will it be printed in that particular timeout time duration?
    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
    What are lifecycle hooks? Where you have used & why?
    Times asked 2
    Official solution

    SimpleLifecycle = component ki zindagi ke stages. API call tab jab DOM ready ho — mounted.

    created: instance bani, this data, DOM nahi. mounted/onMounted: page pe aa gaya — fetch, Chart.js, setInterval.
    updated: data change ke baad. unmounted: cleanup (clearInterval) warna memory leak.

    Dashboards onMounted isliye: canvas/API tab valid. created mein $el nahi.

    Composition: onMounted(() => {}) setup ke andar.

    Example

    export default {
      async mounted() {
        const r = await fetch('/api/venues')
        this.venues = await r.json()
      }
    }

    Project example: Venues.vue mounted fetch list. Clock component unmounted pe interval clear.

    Viva tipcreated: data setup, DOM nahi. mounted/onMounted: $el mil gaya — fetch yahi. Dashboards isliye onMounted use karti hain.

  6. 6
    Told me to write a js function that can print your name.
    Times asked 2
    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.

Advice: Being Clear & confident. Gives time if you are not able to recall. Very very nice proctor. Most important Be humble & talk in respectfull tone.
  1. 1
    Came a bit late so didnt asked any code changes.
    Times asked 2
    Official solution

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

  2. 2
    All the best
    Times asked 2
    Official solution

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

Advice: Chill guy, be confident and make sure that everything is working beforehand.
  1. 1
    Time slot: 14:30-15:00
    Times asked 2
    Official solution

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

  2. 2
    - Celery tasks demo
    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.

  3. 3
    -- Theory Questions:
    Times asked 2
    Official solution

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

  4. 4
    - vue life-cycle hooks
    Times asked 2
    Official solution

    SimpleVue = UI ka smart assistant. Data badlo, screen khud update. MAD1 Jinja har click pe naya HTML.

    Progressive frontend framework. Components, reactivity, directives.

    MAD2 SPA: ek index.html, Vue Router pages, Flask sirf JSON.

    Fayde: easy, SFC, docs. Vs React: templates HTML-like, course sikhata hai. Vs plain JS: baar-baar DOM mat chhedo.

    Example

    <!-- HelloWorld.vue -->
    <template>
      <h1>{{ msg }}</h1>
    </template>
    <script>
    export default { data() { return { msg: 'Hello' } } }
    </script>

    Project example: Navbar.vue + views (Login, Dashboard). data() / setup() reactive. fetch APIs.

    Viva tipFayde: easy, SFC, reactivity. Vs React: chhota learning curve. Vs plain JS: UI state auto-update.

  5. 5
    - what is promise
    Times asked 1
    Official solution

    Simpleasync function promise return karti hai. await us promise ka result wait karta hai — callback hell kam.

    Example

    async function loadLots() {
      const res = await fetch('/api/lots');
      const data = await res.json();
      return data;
    }
  6. 6
    - what is async function
    Times asked 1
    Official solution

    Simpleasync function promise return karti hai. await us promise ka result wait karta hai — callback hell kam.

    Example

    async function loadLots() {
      const res = await fetch('/api/lots');
      const data = await res.json();
      return data;
    }
  7. 7
    - write a flask route: return name of the user from usertable, given role=admin.
    Times asked 2
    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'
Advice: Stay confident, very decent proctor
  1. 1
    write javascripts function
    Times asked 2
    Official solution

    SimpleChhota JS function likho — validate form, toggle class, fetch call.

    Example

    function validateEmail(e) {
      return e.includes('@') && e.includes('.');
    }
Advice: he is good guy ( mahamanus, mahapurush ) is proctor ne meri bahut help he explain karne me ( he say if you are not comfortable you can explain and answer in hindi )
  1. 1
    - show the github collaborator
    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.

  2. 2
    - register a company and show on admin page if its getting approval request or not
    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.

  3. 3
    - the total number of companies contain the ones without approval or not, change it to vice versa
    Times asked 2
    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.

  4. 4
    - celery and how have you implemented them
    Times asked 1
    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.

  5. 5
    - show sending mail rightnow by modifying date an time
    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.

  6. 6
    - authorization and authentication
    Times asked 1
    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)
  7. 7
    - redis
    Times asked 1
    Official solution

    SimpleRedis fridge pe sticky note hai — poori kitchen (database) kholne ki zarurat nahi.

    Redis in-memory key-value store hai. Data RAM mein rehta hai, isliye disk wale SQLite/Postgres se kai guna tez.

    MAD2 mein Redis do kaam karta hai:
    1) Cache — same venue/show/dashboard JSON baar-baar DB se mat nikaalo.
    2) Celery message broker — Flask task queue mein daalta hai, worker uthata hai.

    Source of truth database hi hai. Redis band ho to cache miss ho jaata hai aur Celery queue ruk sakti hai. Crash pe cache gayab ho sakta hai — isliye important data sirf Redis mein mat rakho.

    Example

    import redis
    r = redis.Redis(host='localhost', port=6379, db=0)
    r.set('venues', json.dumps(data), ex=30)
    print(r.get('venues'))

    Project example: GET /api/venues pehle Redis dekho. Miss pe SQLAlchemy query, phir SET with timeout. Celery worker Redis list se daily reminder uthata hai.

    Viva tipCache ke liye db=1, broker ke liye db=0 rakhna smart hai taaki keys mix na hon. Viva mein redis-cli ping → PONG dikhana strong hai.

  8. 8
    - code a simple route
    Times asked 2
    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
    - code a js function in notepad
    Times asked 2
    Official solution

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

  10. 10
    - show me csv feature of admin
    Times asked 2
    Official solution

    SimpleExported CSV download folder/MailHog se open — columns verify. Celery job ke baad file path dikhao.

Advice: My experience was him was kind of decent was very patient and understanding, my laptop was lagging idk why but he still gave me time to relax and not be nervous so understand the celery part and admin part well and it should go well.
  1. 1
    Download and run
    Times asked 1
    Official solution

    SimpleExaminer submitted ZIP chahta hai, local extra changes nahi.

    Portal se ZIP download → extract → venv → pip install -r requirements.txt → flask run / python app.py.
    Checksum maange to hash match karke dikhao. Camera/OPPE setup unke instructions.
    Linux/Mac: paths, gunicorn; Windows paths alag ho to relative paths use karo.
    Do browsers: admin + user parallel demo impressive lagta hai.

  2. 2
    Cdn vs cli
    Times asked 3
    Official solution

    SimpleCDN = Vue script tag se, jaise pen drive. CLI/Vite = poori factory (SFC, npm, bundle).

    CDN: no build, chhote apps, exam PC pe Node nahi to bhi chal. Weak: no .vue compile, 3rd-party cache, scale/team.

    CLI/Vite: Single File Components, env, code-split, production dist/. Scalable.

    Examiner 'which + why' — jo use kiya wahi justify, doosra naam rato mat.

    Example

    <!-- CDN -->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    
    # Vite
    npm run dev
    npm run build

    Project example: CDN: index.html unpkg vue. CLI: package.json, npm run serve / vite.

    Viva tipCDN scalable large teams ke liye weak (no SFC compile, caching 3rd party). Examiner 'which + why' poochta hai — jo use kiya wahi justify karo.

  3. 3
    Jwt
    Times asked 1
    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.

  4. 4
    Phir kuch error aa rha tha usme kha error dhund ke correct kro maiine kiya
    Times asked 2
    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.

  5. 5
    Fir caching aur kha implement kiya
    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.

  6. 6
    Phir model.py ki random line ko explain kro
    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)
  7. 7
    Lazy loading
    Times asked 2
    Official solution

    Simplelazy loading: related objects kab load hon. lazy=True default (access pe query). joined/eager pehle se join.

  8. 8
    Single page app
    Times asked 2
    Official solution

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

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

  9. 9
    Phir last me 5 min hai edge cases dhundo aur correct kro
    Times asked 2
    Official solution

    SimpleEdge cases: duplicate booking, full capacity, wrong role URL, empty search, invalid id.

    Example

    if Spot.query.get_or_404(spot_id).status != 'available':
        flash('Already taken')
        return redirect(...)
  10. 10
    Phir sidebar ka color change then last me khta
    Times asked 2
    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.

  11. 11
    Feedback bola toh khta u have explained enough good
    Times asked 2
    Official solution

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

Advice: Shi bnda h
  1. 1
    LEVEL 1
    Times asked 6
    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
    - show id card
    Times asked 2
    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.

  3. 3
    - show collaborators
    Times asked 2
    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.

  4. 4
    - token or session management
    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().

  5. 5
    - show where tokens are being generated in backend
    Times asked 1
    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.

  6. 6
    - lifecycle hooks in Vue with examples
    Times asked 1
    Official solution

    SimpleLifecycle = component ki zindagi ke stages. API call tab jab DOM ready ho — mounted.

    created: instance bani, this data, DOM nahi. mounted/onMounted: page pe aa gaya — fetch, Chart.js, setInterval.
    updated: data change ke baad. unmounted: cleanup (clearInterval) warna memory leak.

    Dashboards onMounted isliye: canvas/API tab valid. created mein $el nahi.

    Composition: onMounted(() => {}) setup ke andar.

    Example

    export default {
      async mounted() {
        const r = await fetch('/api/venues')
        this.venues = await r.json()
      }
    }

    Project example: Venues.vue mounted fetch list. Clock component unmounted pe interval clear.

    Viva tipcreated: data setup, DOM nahi. mounted/onMounted: $el mil gaya — fetch yahi. Dashboards isliye onMounted use karti hain.

  7. 7
    - what is caching
    Times asked 1
    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.

  8. 8
    - when cache is hit, will the code run and hit the database? how does it work
    Times asked 1
    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.

  9. 9
    - asked to print("cached") and show it in the terminal and where it is being updated
    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.

Advice: be thorough with the basic functionality implementation and do not let him smell fear
  1. 1
    Level1, slot:- 3.00-3.30 pm
    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.

  2. 2
    id check, download from portal
    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

  3. 3
    no demonsation,
    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
    first he ask what i use session based authentication or token based, then demo of authentication and ask me to show and explain where is this authentication happing in code.
    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().

  5. 5
    then demo of celery export
    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.

  6. 6
    then ask me a logic question that write a print statement below cache.set and then he ask if we run this api in frontend then first time print statement run on terminal but what happens in second time? does it print second time also and if not yhen why?
    Times asked 2
    Official solution

    Simpleprint after set miss pe hi: hit pe function body skip. Yahi demo examiner chahta hai.

    Redis in-memory key-value store hai — fridge pe sticky note, poori kitchen (SQL database) har baar mat kholo.

    MAD2 mein Redis do kaam: (1) cache — same venues/shows/dashboard JSON baar-baar DB se nahi (2) Celery broker — Flask task queue mein daalta hai, worker uthata hai.

    Flow: cache.get(key) → hit pe return, miss pe SQLAlchemy + SET with timeout. Admin write ke baad cache.delete, warna stale list.

    Source of truth database hi hai. Redis crash/band = cache miss (app chalni chahiye) + queue ruk sakti hai. Important bookings sirf Redis mein mat rakho.

    Alag: Redis ≠ Memcached (Celery broker nahi). Redis ≠ localStorage (woh browser). redis-cli ping → PONG viva proof.

    Project example: GET /api/venues pehli baar DB log, doosri Redis. Write pe cache.delete. redis-cli ping.

  7. 7
    then Set celery monthly task from 1st of month to present time
    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.

  8. 8
    then ask about lifecycle hooks
    Times asked 2
    Official solution

    SimpleLifecycle = component ki zindagi ke stages. API call tab jab DOM ready ho — mounted.

    created: instance bani, this data, DOM nahi. mounted/onMounted: page pe aa gaya — fetch, Chart.js, setInterval.
    updated: data change ke baad. unmounted: cleanup (clearInterval) warna memory leak.

    Dashboards onMounted isliye: canvas/API tab valid. created mein $el nahi.

    Composition: onMounted(() => {}) setup ke andar.

    Example

    export default {
      async mounted() {
        const r = await fetch('/api/venues')
        this.venues = await r.json()
      }
    }

    Project example: Venues.vue mounted fetch list. Clock component unmounted pe interval clear.

    Viva tipcreated: data setup, DOM nahi. mounted/onMounted: $el mil gaya — fetch yahi. Dashboards isliye onMounted use karti hain.

  9. 9
    last Write route to fetch all spot that are occupied and all user in notepad
    Times asked 2
    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'
Advice: confidently tell your code and If you not confident in some section of your code and not able to explain or any other thing than just say that i am sorry sir, i learn this on bootcamp and TA live session on YouTube and implement it, and now i am not able to recall exact detail.this statement prevents proctor to think that you use llm
  1. 1
    Don't remember excatly- mostly one frontend , backend , routes by just seeing db , add frontend code.
    Times asked 2
    Official solution

    SimpleMAD1 frontend usually Jinja templates + HTML/CSS/Bootstrap (+ thoda JS). MAD2 pe Vue ho to clearly bolo.

Advice: He is unpredictable , can ask anything, be thorough with your code . Just make sure you know what you are doing and he does give 2nd chance , if you ask ( basically burry you) , be prepare to write code on notebook
  1. 1
    Show Student ID.
    Times asked 3
    Official solution

    SimpleCamera pe college ID — naam photo match. Identity viva ki pehli gate.

    Pehle se haath mein, glare nahi. Examiner screenshot. Phir GitHub + portal ZIP run.

    Name GitHub/portal se mismatch red flag.

    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.

    Project example: ID dikhao, bolo roll/name, phir screen share repo.

    Viva tipPehle se ID haath mein rakho, glare mat aane do. Examiner screenshot/verify karta hai. Iske baad GitHub + project run.

  2. 2
    Show GitHub collaborator.
    Times asked 2
    Official solution

    SimpleRepo = evidence tumne kaam kiya: commits, collaborators, README.

    Regular messages, last-day dump nahi. Private access pehle de do. Main branch submitted ZIP se match.

    Collaborator settings. Commit dates.

    Example

    Settings → Collaborators: apna + teammate (agar allowed).
    Commits: regular messages, last-day dump nahi.

    Project example: Settings → Collaborators. git log --oneline. README run steps.

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

  3. 3
    Download the project from the portal.
    Times asked 4
    Official solution

    SimpleExaminer wohi ZIP chahta hai jo tumne submit kiya, local extra magic nahi.

    Portal download → extract → redis, venv, pip, npm, flask, worker, beat.

    Checksum maange to hash. Uncommitted files mat dikhana.

    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.

    Suggested flow1) ZIP
    2) Extract
    3) Redis + venv + pip
    4) npm/vite
    5) flask + celery worker + beat

    Project example: Submitted zip run. README commands copy.

    Viva tipChecksum maange to hash match karke dikhao. Extra uncommitted files mat dikhana.

  4. 4
    Run the application and explain the setup (multiple terminals/command prompts).
    Times asked 1
    Official solution

    SimpleMAD2 orchestra: Redis, Flask, Vue, worker, beat — 5 terminals.

    Ports: Flask 5000, Vite 8080/5173, Redis 6379. CORS isliye.

    Order: Redis first. Worker bina Redis fail. Beat bina worker queue bharti.

    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.

    Example

    redis-server
    flask run --port 5000
    npm run serve
    celery -A app.celery worker -l info
    celery -A app.celery beat -l info

    Project example: README local_run. Dikhao 5 processes + browser two roles.

    Viva tipPorts batao: Flask 5000, Vite 8080/5173, Redis 6379. CORS isi liye chahiye.

  5. 5
    Demonstrate authentication flow.
    Times asked 1
    Official solution

    SimpleLogin JWT LS header. Teen fails: wrong pass 401, no token 401, user→admin URL 403.

    Register, login both roles, logout clears token.

    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

    fetch('/api/venues', {
      headers: { Authorization: 'Bearer ' + localStorage.getItem('token') }
    })

    Project example: Two browsers student+admin.

    Viva tipWrong password 401, bina token 401, user URL admin pe 403 — teen cases dikhana strong hai.

  6. 6
    Create and approve a company/staff.
    Times asked 1
    Official solution

    SimpleDemo 5–7 min ki kahani: saari roles, koi milestone skip nahi, bolte-bolte dikhao.

    Examiner list tick karta hai. Crash ho to panic nahi — terminal error padho.

    Code tab kholna jab poochhein. Extra uncommitted features mat dikhana agar portal ZIP mein nahi.

    Suggested flow1) Register/login user
    2) Admin login — CRUD
    3) Approval/blacklist
    4) Booking/apply + edge case
    5) Search + charts
    6) CSV export / email job
    7) Logout

    Project example: Jo statement/parking/jobs/tickets hai uske user+admin journeys.

    Viva tipBol: 'Yahan overbooking rokta hoon'. Mandatory features pehle, polish baad.

  7. 7
    Create two staff members and approve them.
    Times asked 1
    Official solution

    SimpleDemo 5–7 min ki kahani: saari roles, koi milestone skip nahi, bolte-bolte dikhao.

    Examiner list tick karta hai. Crash ho to panic nahi — terminal error padho.

    Code tab kholna jab poochhein. Extra uncommitted features mat dikhana agar portal ZIP mein nahi.

    Suggested flow1) Register/login user
    2) Admin login — CRUD
    3) Approval/blacklist
    4) Booking/apply + edge case
    5) Search + charts
    6) CSV export / email job
    7) Logout

    Project example: Jo statement/parking/jobs/tickets hai uske user+admin journeys.

    Viva tipBol: 'Yahan overbooking rokta hoon'. Mandatory features pehle, polish baad.

  8. 8
    Blacklist one staff member and verify that login is blocked.
    Times asked 1
    Official solution

    Simpleactive=False, login attempt fail demo.

    Blacklist one staff verify blocked.

    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: Admin UI + login.

    Project example: Admin UI + login.

  9. 9
    Show where the blacklist logic is implemented.
    Times asked 1
    Official solution

    SimpleFlag + login reject. Where implemented approval/blacklist.

    Demo blacklist staff login fail.

    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.

    Project example: User.active.

  10. 10
    Show the admin CSV export feature.
    Times asked 1
    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.

  11. 11
    Demonstrate Celery export functionality.
    Times asked 1
    Official solution

    Simplecsv celery trigger. Explain export theatres CSV which library. Show CSV export open file.

    csv module standard.

    Celery Python ka distributed task queue — HTTP request ko 10s email/CSV ke liye mat rokna.

    Flow: Flask .delay() → Redis broker → Worker execute. Beat alag process hai (clock): crontab padhke due time pe queue mein daalta hai. Beat khud mail nahi bhejta; Worker haath hai.

    MAD2 typical: daily reminder (Beat), monthly report (Beat), user Export CSV (button, Beat nahi). JS async/await browser event loop hai, Celery server-side process — mix mat karo.

    Demo: tin terminals — redis-server, celery worker, celery beat — plus Flask. MailHog :8025 inbox. Result backend se task SUCCESS poll optional.

    Project example: export task + sample file.

  12. 12
    Demonstrate scheduled email functionality by changing the Celery schedule to the current time.
    Times asked 1
    Official solution

    SimpleSMTP + template + Celery. MailHog inbox dikhao, Gmail nahi chahiye.

    Dynamic HTML user name. Live: schedule now.

    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

    msg = Message(subject='Daily reminder', recipients=[user.email])
    msg.html = render_template('reminder.html', user=user)
    mail.send(msg)

    Project example: reminder.html Jinja. tasks send_mail.

    Viva tipLive demo ke liye Celery beat crontab current time pe set karo, worker + beat dono chalu rakho.

  13. 13
    Book an appointment/reservation and verify edge cases (same slot, approvals, etc.).
    Times asked 1
    Official solution

    SimpleSame slot twice 400. Two users race. Approval workflow. Book appointment verify edges.

    Demo fail then success.

    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: book route checks.

    Project example: book route checks.

  14. 14
    Check whether totals/counts include only approved records or all records, and modify the logic if required.
    Times asked 1
    Official solution

    Simplequery.filter_by(status='approved').count() pending exclude. Modify if required all records.

    Dashboard number change dikhao.

    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: admin summary API.

  15. 15
    Show where authentication is implemented in the backend.
    Times asked 1
    Official solution

    Simplelogin.vue + backend login + decorator + LS. Show login/authentication code.

    Show where authentication backend.

    Authentication poochta hai "tu kaun hai?", Authorization poochta hai "tujhe yeh kaam karne ki permission hai?"

    Authentication: login. Username + password hash check. Success pe JWT/session. Galat credentials = 401.
    Authorization: uske baad role. Admin hi venue/lot delete kare, student nahi = 403 (logged in ho, allowed nahi).

    MAD2: POST /api/login = authentication. @jwt_required identity. @roles_required('admin') ya Vue v-if="isAdmin" = authorization. Frontend hide sirf UX — asli deny backend pe.

    Validation alag: form sahi bhara (email format, age 18+). Woh identity prove nahi karta. Password store hash (Werkzeug), JWT payload padha ja sakta hai isliye secret mat daalo.

    Project example: 4 files.

  16. 16
    Show where tokens are generated.
    Times asked 1
    Official solution

    SimpleLogin/register success return create_access_token. Show generated token Network + LS.

    Where tokens generated.

    Authentication poochta hai "tu kaun hai?", Authorization poochta hai "tujhe yeh kaam karne ki permission hai?"

    Authentication: login. Username + password hash check. Success pe JWT/session. Galat credentials = 401.
    Authorization: uske baad role. Admin hi venue/lot delete kare, student nahi = 403 (logged in ho, allowed nahi).

    MAD2: POST /api/login = authentication. @jwt_required identity. @roles_required('admin') ya Vue v-if="isAdmin" = authorization. Frontend hide sirf UX — asli deny backend pe.

    Validation alag: form sahi bhara (email format, age 18+). Woh identity prove nahi karta. Password store hash (Werkzeug), JWT payload padha ja sakta hai isliye secret mat daalo.

    Project example: login response.

  17. 17
    Show where tokens are sent from the frontend.
    Times asked 1
    Official solution

    SimpleNetwork request Headers Authorization Bearer. Where sent from frontend.

    Show tokens sent.

    Authentication poochta hai "tu kaun hai?", Authorization poochta hai "tujhe yeh kaam karne ki permission hai?"

    Authentication: login. Username + password hash check. Success pe JWT/session. Galat credentials = 401.
    Authorization: uske baad role. Admin hi venue/lot delete kare, student nahi = 403 (logged in ho, allowed nahi).

    MAD2: POST /api/login = authentication. @jwt_required identity. @roles_required('admin') ya Vue v-if="isAdmin" = authorization. Frontend hide sirf UX — asli deny backend pe.

    Validation alag: form sahi bhara (email format, age 18+). Woh identity prove nahi karta. Password store hash (Werkzeug), JWT payload padha ja sakta hai isliye secret mat daalo.

    Project example: GET /api/venues headers.

  18. 18
    Show where caching is implemented.
    Times asked 6
    Official solution

    SimpleDecorator + Redis ping + invalidation line + miss/hit demo idea.

    Kaunsi routes, timeout, key_prefix, query_string. POST pe nahi.

    print after set sirf miss. Timeout chhota karke expiry.

    Redis in-memory key-value store hai — fridge pe sticky note, poori kitchen (SQL database) har baar mat kholo.

    MAD2 mein Redis do kaam: (1) cache — same venues/shows/dashboard JSON baar-baar DB se nahi (2) Celery broker — Flask task queue mein daalta hai, worker uthata hai.

    Flow: cache.get(key) → hit pe return, miss pe SQLAlchemy + SET with timeout. Admin write ke baad cache.delete, warna stale list.

    Source of truth database hi hai. Redis crash/band = cache miss (app chalni chahiye) + queue ruk sakti hai. Important bookings sirf Redis mein mat rakho.

    Alag: Redis ≠ Memcached (Celery broker nahi). Redis ≠ localStorage (woh browser). redis-cli ping → PONG viva proof.

    Project example: resources list GET cached. create_venue delete key.

  19. 19
    Add a print() statement after cache.set() and explain why it executes only on the first request (cache miss) and not on subsequent requests (cache hit).
    Times asked 1
    Official solution

    SimpleHit = Redis ke paas jawab already hai. Miss = pehle DB se lana padega.

    Hit pe database queried nahi hota — yahi examiner prove karwana chahta hai.

    Typical flow:
    1) cache.get(key)
    2) mila to return (hit)
    3) nahi mila to query + cache.set + return (miss)

    Timeout ke baad key expire = next request phir miss. cache.clear() sab hataata hai, cache.delete(key) sirf ek route.

    Example

    data = cache.get('venues')
    if data:
        return data          # hit
    data = Venue.query.all() # miss
    cache.set('venues', data, timeout=30)
    return data

    Project example: Pehli GET /api/venues — terminal mein SQL/print. Doosri GET turant — koi DB log nahi.

    Viva tipHit pe database queried nahi hota. print() after set sirf miss pe chalega.

  20. 20
    Explain a random line from models.py.
    Times asked 1
    Official solution

    SimpleRandom line: Column type nullable FK relationship. 1 sentence each keyword. Explain random line models.py.

    Stay calm.

    ORM objects ko tables se map karta hai — raw SQL kam. SQLAlchemy MAD2 default.

    class User(db.Model) + Column + relationship. query.filter_by / db.session.get. Fayda: portable SQLite→Postgres, injection se safer. Nuksaan: N+1, complex SQL.

    SQLite file, zero server — course friendly. Postgres scale. Relationships: FK, backref, lazy/joinedload, cascade on delete. Constraints unique/not null integrity.

    Bookings source of truth DB, Redis cache copy.

    Project example: Don't skip imports either — db.Model.

  21. 21
    Show where the blacklist/approval logic is implemented.
    Times asked 1
    Official solution

    SimpleFlag + login reject. Where implemented approval/blacklist.

    Demo blacklist staff login fail.

    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.

    Project example: User.active.

  22. 22
    Session-based vs Token-based authentication.
    Times asked 3
    Official solution

    SimpleSession school id card office mein rakha. Token photocopy jo tum har baar dikhate ho.

    Session: Set-Cookie, server store, MAD1 Flask-Login. CSRF risk cookies auto-send.

    Token/JWT: SPA + alag port Vue/Flask, scale easy, mobile. XSS if localStorage.

    MAD2 typically JWT/Flask-Security token. httpOnly cookie safer lekin CORS+CSRF extra.

    Example

    # session
    login_user(user)  # Set-Cookie
    # token
    return jsonify(token=create_access_token(identity=user.id))

    Project example: login jsonify token. Vue LS. MAD1 session cookie nahi dikhana unless used.

    Viva tipToken localStorage XSS risk; httpOnly cookie safer. Session CSRF risk. MAD2 APIs ke liye JWT/Flask-Security token common.

  23. 23
    JWT
    Times asked 1
    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.

  24. 24
    Flow of token-based authentication.
    Times asked 1
    Official solution

    SimpleHar request pe token dikhao. Server session yaad nahi rakhta (mostly).

    Login issue, store, send, verify, exp. Logout = client delete (+ server blacklist optional).

    Authentication poochta hai "tu kaun hai?", Authorization poochta hai "tujhe yeh kaam karne ki permission hai?"

    Authentication: login. Username + password hash check. Success pe JWT/session. Galat credentials = 401.
    Authorization: uske baad role. Admin hi venue/lot delete kare, student nahi = 403 (logged in ho, allowed nahi).

    MAD2: POST /api/login = authentication. @jwt_required identity. @roles_required('admin') ya Vue v-if="isAdmin" = authorization. Frontend hide sirf UX — asli deny backend pe.

    Validation alag: form sahi bhara (email format, age 18+). Woh identity prove nahi karta. Password store hash (Werkzeug), JWT payload padha ja sakta hai isliye secret mat daalo.

    Project example: Bearer header. 401 pe redirect login.

  25. 25
    Authentication vs Authorization.
    Times asked 10
    Official solution

    SimpleAuthentication poochta hai "tu kaun hai?", Authorization poochta hai "tujhe yeh kaam karne ki permission hai?"

    Authentication: login. Username + password check karke prove karte ho ki tum genuine user ho. Success pe session/token milta hai.
    Authorization: uske baad role check. Admin hi parking lot / venue / drive delete kar sakta hai, normal user nahi.

    MAD2 mein yeh alag layers hain: login API = authentication (JWT milta hai). @roles_required('admin') ya Vue v-if="isAdmin" = authorization.

    Validation alag cheez hai (form sahi bhara hai ya nahi, jaise age 18+). Authentication identity hai, authorization permission, validation input quality.

    Example

    # Authentication
    if user and check_password_hash(user.password, form_password):
        token = create_access_token(identity=user.id)
    
    # Authorization
    if current_user.role != 'admin':
        abort(403)  # logged in ho, lekin allowed nahi

    Project example: Student login = authentication. Student admin dashboard nahi khol sakta = authorization. Frontend button hide sirf UX hai — asli check backend pe hona chahiye.

    Viva tip401 = not logged in / bad token. 403 = logged in, role galat. Examiner yeh difference bahut poochta hai.

  26. 26
    What is caching?
    Times asked 23
    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.

  27. 27
    How does cache hit work?
    Times asked 2
    Official solution

    SimpleHit = Redis ke paas jawab already hai. Miss = pehle DB se lana padega.

    Hit pe database queried nahi hota — yahi examiner prove karwana chahta hai.

    Typical flow:
    1) cache.get(key)
    2) mila to return (hit)
    3) nahi mila to query + cache.set + return (miss)

    Timeout ke baad key expire = next request phir miss. cache.clear() sab hataata hai, cache.delete(key) sirf ek route.

    Example

    data = cache.get('venues')
    if data:
        return data          # hit
    data = Venue.query.all() # miss
    cache.set('venues', data, timeout=30)
    return data

    Project example: Pehli GET /api/venues — terminal mein SQL/print. Doosri GET turant — koi DB log nahi.

    Viva tipHit pe database queried nahi hota. print() after set sirf miss pe chalega.

  28. 28
    Does the database get queried on a cache hit?
    Times asked 1
    Official solution

    SimpleNahi — hit pe cached JSON, DB skip if you cached the query result.

    Unless another code path. print proof.

    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: SQL echo off on second GET.

    Project example: SQL echo off on second GET.

  29. 29
    What is Redis?
    Times asked 21
    Official solution

    SimpleRedis fridge pe sticky note hai — poori kitchen (database) kholne ki zarurat nahi.

    Redis in-memory key-value store hai. Data RAM mein rehta hai, isliye disk wale SQLite/Postgres se kai guna tez.

    MAD2 mein Redis do kaam karta hai:
    1) Cache — same venue/show/dashboard JSON baar-baar DB se mat nikaalo.
    2) Celery message broker — Flask task queue mein daalta hai, worker uthata hai.

    Source of truth database hi hai. Redis band ho to cache miss ho jaata hai aur Celery queue ruk sakti hai. Crash pe cache gayab ho sakta hai — isliye important data sirf Redis mein mat rakho.

    Example

    import redis
    r = redis.Redis(host='localhost', port=6379, db=0)
    r.set('venues', json.dumps(data), ex=30)
    print(r.get('venues'))

    Project example: GET /api/venues pehle Redis dekho. Miss pe SQLAlchemy query, phir SET with timeout. Celery worker Redis list se daily reminder uthata hai.

    Viva tipCache ke liye db=1, broker ke liye db=0 rakhna smart hai taaki keys mix na hon. Viva mein redis-cli ping → PONG dikhana strong hai.

  30. 30
    What is Celery?
    Times asked 19
    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.

  31. 31
    How have you implemented Celery?
    Times asked 1
    Official solution

    SimpleCelery instance, broker URL, @celery.task, worker command, Beat schedule.

    DB use karte waqt with app.app_context():. .delay() JSON-serializable args.

    Examiner files: celery.py / tasks.py / config beat dict / README commands.

    Celery Python ka distributed task queue — HTTP request ko 10s email/CSV ke liye mat rokna.

    Flow: Flask .delay() → Redis broker → Worker execute. Beat alag process hai (clock): crontab padhke due time pe queue mein daalta hai. Beat khud mail nahi bhejta; Worker haath hai.

    MAD2 typical: daily reminder (Beat), monthly report (Beat), user Export CSV (button, Beat nahi). JS async/await browser event loop hai, Celery server-side process — mix mat karo.

    Demo: tin terminals — redis-server, celery worker, celery beat — plus Flask. MailHog :8025 inbox. Result backend se task SUCCESS poll optional.

    Example

    celery = Celery(__name__, broker='redis://localhost:6379/0')
    @celery.task
    def ping():
        return 'ok'

    Project example: jobs.py daily_reminder, monthly_report, export_csv. config.py broker.

  32. 32
    Vue Lifecycle Hooks.
    Times asked 2
    Official solution

    SimpleLifecycle = component ki zindagi ke stages. API call tab jab DOM ready ho — mounted.

    created: instance bani, this data, DOM nahi. mounted/onMounted: page pe aa gaya — fetch, Chart.js, setInterval.
    updated: data change ke baad. unmounted: cleanup (clearInterval) warna memory leak.

    Dashboards onMounted isliye: canvas/API tab valid. created mein $el nahi.

    Composition: onMounted(() => {}) setup ke andar.

    Example

    export default {
      async mounted() {
        const r = await fetch('/api/venues')
        this.venues = await r.json()
      }
    }

    Project example: Venues.vue mounted fetch list. Clock component unmounted pe interval clear.

    Viva tipcreated: data setup, DOM nahi. mounted/onMounted: $el mil gaya — fetch yahi. Dashboards isliye onMounted use karti hain.

  33. 33
    What is a Promise?
    Times asked 4
    Official solution

    SimplePromise IOU hai: abhi nahi, baad mein value ya error.

    States: pending, fulfilled, rejected. fetch() promise return. then/catch/finally.

    async function hamesha Promise return. await usko unwrap. Galat: await without async; missing await to Promise object milta data nahi.

    JS browser ki language. const rebind nahi, let block. Arrow () => this lexical.

    Promise: pending/fulfill/reject. async/await usko seedha padhne jaisa. try/catch await pe. Yeh Celery nahi — Celery Python worker.

    fetch native AJAX. array.filter/map computed lists. Vue data reactive; plain JS DOM querySelector se manual.

    Example

    fetch('/api/hello')
      .then(r => r.json())
      .then(d => console.log(d))
      .catch(err => console.error(err))

    Project example: fetch venues .then json. Ya async mounted await.

  34. 34
    What is an Async function?
    Times asked 1
    Official solution

    Simpleasync hamesha Promise. return 1 → Promise.resolve(1).

    What async returns. Incorrect use SyntaxError or unresolved promise.

    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: async mounted.

    Project example: async mounted.

  35. 35
    Vue CLI vs Vue CDN.
    Times asked 6
    Official solution

    SimpleCDN = Vue script tag se, jaise pen drive. CLI/Vite = poori factory (SFC, npm, bundle).

    CDN: no build, chhote apps, exam PC pe Node nahi to bhi chal. Weak: no .vue compile, 3rd-party cache, scale/team.

    CLI/Vite: Single File Components, env, code-split, production dist/. Scalable.

    Examiner 'which + why' — jo use kiya wahi justify, doosra naam rato mat.

    Example

    <!-- CDN -->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    
    # Vite
    npm run dev
    npm run build

    Project example: CDN: index.html unpkg vue. CLI: package.json, npm run serve / vite.

    Viva tipCDN scalable large teams ke liye weak (no SFC compile, caching 3rd party). Examiner 'which + why' poochta hai — jo use kiya wahi justify karo.

  36. 36
    What is Lazy Loading?
    Times asked 3
    Official solution

    SimpleLazy = zarurat pe load. Relationship default extra query. Vue route import() code-split.

    lazy='dynamic' query object. noload mat laao. Fast first paint.

    ORM objects ko tables se map karta hai — raw SQL kam. SQLAlchemy MAD2 default.

    class User(db.Model) + Column + relationship. query.filter_by / db.session.get. Fayda: portable SQLite→Postgres, injection se safer. Nuksaan: N+1, complex SQL.

    SQLite file, zero server — course friendly. Postgres scale. Relationships: FK, backref, lazy/joinedload, cascade on delete. Constraints unique/not null integrity.

    Bookings source of truth DB, Redis cache copy.

    Project example: user.bookings access pe query. Dashboard joinedload instead.

  37. 37
    What is a Single Page Application (SPA)?
    Times asked 1
    Official solution

    SimpleSPA ek ghar, rooms (routes) ke beech bina poora ghar todo. MPA har room naya ghar (MAD1 Jinja).

    Vue Router client navigation. Backend JSON. Back button, shareable URL.

    MPA: har click full reload. SPA: first load JS bundle, phir fast.

    SPA = ek HTML, Vue Router se views, full reload nahi. MPA = MAD1 Jinja har URL naya HTML.

    Vue Router: routes array, router-view, router-link, meta.auth + beforeEach guard. Dynamic /venues/:id$route.params.id.

    Vite/CLI SFC + npm build dist/. CDN script tag, no SFC. Jo tumne use kiya wahi justify. Flask send_from_directory('dist') production pattern.

    Project example: /#/login vs /#/dashboard bina Flask template render.

    Viva tipVue Router client-side navigation. Backend sirf JSON APIs deta hai.

  38. 38
    Difference between filter() and filter_by() in SQLAlchemy.
    Times asked 1
    Official solution

    Simplefilter_by kwargs equality. filter expressions >, ilike, joins.

    Difference filter and filter_by.

    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.

    Example

    User.query.filter_by(email='a@b.com').first()
    User.query.filter(User.age > 30, User.name.ilike('%ram%')).all()

    Project example: email filter_by. age>30 filter.

  39. 39
    Difference between POST and PUT.
    Times asked 4
    Official solution

    SimplePOST naya janam (har baar naya id). PUT poori photo replace. PATCH sticker chipkao.

    POST create, not idempotent. PUT full update, idempotent. PATCH partial.

    POST ki jagah PUT se REST semantics toot. GET typically no body.

    CRUD map: POST create, GET read, PUT/PATCH update, DELETE delete.

    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.

    Example

    POST /api/venues
    PUT  /api/venues/1   {all fields}
    PATCH /api/venues/1 {only name}

    Project example: POST /api/venues create. PUT /venues/1 saari fields. PATCH sirf name.

  40. 40
    What is a server?
    Times asked 1
    Official solution

    SimpleServer process request sunta Flask. Client browser. Redis bhi server alag purpose. What is a server.

    How access without browser: curl Postman httpie.

    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.

    Example

    curl -H 'Authorization: Bearer TOKEN' http://localhost:5000/api/venues

    Project example: flask run is dev server.

  41. 41
    What is a JavaScript function?
    Times asked 1
    Official solution

    SimpleFunction reusable block. First-class. Arrow lexical this, chhote callbacks.

    Named vs anon. const f = () => {}.

    JS browser ki language. const rebind nahi, let block. Arrow () => this lexical.

    Promise: pending/fulfill/reject. async/await usko seedha padhne jaisa. try/catch await pe. Yeh Celery nahi — Celery Python worker.

    fetch native AJAX. array.filter/map computed lists. Vue data reactive; plain JS DOM querySelector se manual.

    Example

    function add(a, b) { return a + b }
    const cube = n => n ** 3

    Project example: methods: { book() {} } or setup functions.

  42. 42
    Change the Celery monthly schedule to the current time.
    Times asked 1
    Official solution

    SimpleSchedule current time / har minute, beat restart, logs + MailHog.

    Don't forget worker. Crontab fields. Demo ke baad revert if asked.

    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

    crontab(hour=17, minute=20)
    crontab(minute='*/1')
    @celery.task
    def add(a, b):
        return a + b

    Project example: CELERY_BEAT_SCHEDULE edit. Terminal beat 'Sending due task'.

  43. 43
    Change the color of the form/body/sidebar.
    Times asked 1
    Official solution

    SimpleLive CSS/Vue: sabse chhota change jo dikhe. Logic/API mat todo unless poochhein.

    Inspect element se class dhoondo. btn-success, navbar bottom fixed, center flex.

    Save, refresh, dikhao. Break mat karo layout poora.

    Example

    <button class="btn btn-success">Login</button>
    nav { position: fixed; bottom: 0; width: 100%; }
    .wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

    Project example: Jo button/navbar poocha usi file (Navbar.vue / App.vue / css).

    Viva tipDevTools se element inspect. Logic/API mat todo unless poochhein.

  44. 44
    Write a simple Flask route.
    Times asked 3
    Official solution

    Simple@app.route('/ping') jsonify ok. Write simple Flask route. Random Flask route same idea methods list.

    Mention GET.

    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.

    Example

    @app.route('/ping')
    def ping():
        return jsonify(ok=True)

    Project example: Don't forget return.

  45. 45
    Write a route to fetch all approved applications.
    Times asked 1
    Official solution

    Simple

    Application.query.filter_by(status='approved'). Route fetch approved applications.

    Admin.

    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: GET /api/applications?status=approved

    Project example: GET /api/applications?status=approved

  46. 46
    Write a route that returns all occupied parking spots and their users.
    Times asked 1
    Official solution

    Simplespots occupied join user vehicle. Route occupied parking spots and users.

    filter_by status occupied.

    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: Spot.query.filter_by(status='occupied')

  47. 47
    Write a route that accepts a username and returns the user's role.
    Times asked 1
    Official solution

    SimpleGET user by username return role. Route accepts username returns role.

    404 if missing.

    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: User.query.filter_by(username=).

    Project example: User.query.filter_by(username=).

  48. 48
    Write a route that returns all users with the role admin.
    Times asked 1
    Official solution

    Simpleusers with role admin. Route all users role admin.

    No hashes.

    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: roles.any name==admin.

    Project example: roles.any name==admin.

  49. 49
    Write a simple JavaScript function in Notepad.
    Times asked 1
    Official solution

    Simplefunction + console.log. Run node or browser. Write simple JS function Notepad.

    Examiner syntax.

    JS browser ki language. const rebind nahi, let block. Arrow () => this lexical.

    Promise: pending/fulfill/reject. async/await usko seedha padhne jaisa. try/catch await pe. Yeh Celery nahi — Celery Python worker.

    fetch native AJAX. array.filter/map computed lists. Vue data reactive; plain JS DOM querySelector se manual.

    Project example: Keep tiny.

    Project example: Keep tiny.

  50. 50
    Change approval-count logic to exclude/include pending entities as required.
    Times asked 1
    Official solution

    Simplecounts filter status==approved exclude pending. Change include/exclude pending. Check totals approved or all.

    func.count query.

    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: dashboard stats.

  1. 1
    Show your College ID.
    Times asked 16
    Official solution

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

    Pehle se ID haath mein rakho. Glare mat aane do. Examiner screenshot/verify karta hai. Iske baad GitHub + project run.

  2. 2
    Show your GitHub repository and collaborator.
    Times asked 16
    Official solution

    SimpleGitHub repo public/private policy ke hisaab, MAD-1 collaborator add, commits dikhao.

    Repo → Settings → Collaborators → instructor added.
    Commits: git log / GitHub History — regular commits better, ek dum 1 commit suspicious.
    README + report mein AI usage likha hona chahiye agar use kiya.

  3. 3
    Download the project from the Viva Portal.
    Times asked 7
    Official solution

    SimpleExaminer submitted ZIP chahta hai, local extra changes nahi.

    Portal se ZIP download → extract → venv → pip install -r requirements.txt → flask run / python app.py.
    Checksum maange to hash match karke dikhao. Camera/OPPE setup unke instructions.
    Linux/Mac: paths, gunicorn; Windows paths alag ho to relative paths use karo.
    Do browsers: admin + user parallel demo impressive lagta hai.

  4. 4
    Set up the project using a virtual environment (venv).
    Times asked 1
    Official solution

    Simplevenv isolated Python environment — project ke packages system Python se mix nahi hote.

    python -m venv .venv
    source .venv/bin/activate # Windows: .venv\Scripts\activate
    pip install -r requirements.txt
    Do projects alag Flask versions rakh sakte hain. Viva: pehle venv activate, phir flask run.

  5. 5
    What is venv?
    Times asked 1
    Official solution

    Simplevenv isolated Python environment — project ke packages system Python se mix nahi hote.

    python -m venv .venv
    source .venv/bin/activate # Windows: .venv\Scripts\activate
    pip install -r requirements.txt
    Do projects alag Flask versions rakh sakte hain. Viva: pehle venv activate, phir flask run.

  6. 6
    Demonstrate the core functionalities of the application.
    Times asked 2
    Official solution

    SimpleDemo script pehle se practice karo, 5-7 minute, saari roles.

    Suggested flow

    1) Register/login user 2) Admin login — CRUD 3) Approval/blacklist 4) Booking/apply 5) Search 6) Validation edge (slots 0, duplicate) 7) Logout
    Bolte-bolte dikhao: 'Yahan overbooking rokta hoon'. Code tab kholna jab poochhein.
    Crash ho to debug calmly: terminal error, typo, DB path.
    Mandatory features skip mat karna — examiner list tick karta hai.

  7. 7
    Create sample records (e.g., staff, users, treks).
    Times asked 1
    Official solution

    Yeh project-specific feature add/modify hai. 4 layers touch karo: model, route, template, validation.

    1) Data chahiye to models.py mein column/relationship + DB update (ALTER / migrate / create_all).
    2) Route: GET pe form/page, POST pe request.form se save, flash + redirect.
    3) Template: input name=... Jinja se {{ obj.field }} display.
    4) Rule: duplicate, range, role check backend pe.

    Example naya field 'city':

    user.city = db.Column(db.String(50))
    user.city = request.form.get('city')
    <input name='city'>  ...  {{ user.city }}
  8. 8
    Show the approval workflow.
    Times asked 1
    Official solution

    Yeh feature demo hai. Account ready rakho, steps bol ke dikhao.

    Role ke hisaab login → action (create/approve/book) → DB/UI pe result → edge case (fail when slots=0 / blacklisted).
    Do browser windows: admin + user. Search/filter alag se dikhao.
    Agar feature nahi hai to sach bolo aur 2 minute mein kaise add karoge (query + template) explain karo.

  9. 9
    Demonstrate slot/availability validation (e.g., second user cannot book when slots are full).
    Times asked 1
    Official solution

    SimpleValidation galat data rok ti hai — frontend turant, backend must.

    Frontend: required, min='18', maxlength='8', pattern='(?=.*[A-Z]).{8,}'
    Backend example:

    pwd = request.form.get('password','')
    if len(pwd) < 8 or not re.search(r'[A-Z]', pwd) or not re.search(r'[0-9]', pwd):
        flash('Weak password')

    Haan, regex se password rules ho sakte hain.
    Age 18-99, date >= today, slots <= 30 and > 0, confirm password == password, email '@' .
    Duplicate username: User.query.filter_by(email=email).first() or unique=True catch IntegrityError.
    Past date: if date < date.today(): reject. Negative slots: if slots < 0: reject; book pe available > 0 check.


    SimpleDemo script pehle se practice karo, 5-7 minute, saari roles.

    Suggested flow

    1) Register/login user 2) Admin login — CRUD 3) Approval/blacklist 4) Booking/apply 5) Search 6) Validation edge (slots 0, duplicate) 7) Logout
    Bolte-bolte dikhao: 'Yahan overbooking rokta hoon'. Code tab kholna jab poochhein.
    Crash ho to debug calmly: terminal error, typo, DB path.
    Mandatory features skip mat karna — examiner list tick karta hai.

  10. 10
    Demonstrate profile editing.
    Times asked 1
    Official solution

    SimpleDemo script pehle se practice karo, 5-7 minute, saari roles.

    Suggested flow

    1) Register/login user 2) Admin login — CRUD 3) Approval/blacklist 4) Booking/apply 5) Search 6) Validation edge (slots 0, duplicate) 7) Logout
    Bolte-bolte dikhao: 'Yahan overbooking rokta hoon'. Code tab kholna jab poochhein.
    Crash ho to debug calmly: terminal error, typo, DB path.
    Mandatory features skip mat karna — examiner list tick karta hai.

  11. 11
    Demonstrate search functionality.
    Times asked 3
    Official solution

    SimpleSearch box GET form, backend query filter, results template mein.

    q = request.args.get('q', '').strip()
    results = Doctor.query.filter(Doctor.name.ilike(f'%{q}%')).all() if q else []
    return render_template('search.html', results=results, q=q)

    Jinja: {{ results|length }} matches. Empty: 'No results'.
    JS-only filter: saara data pehle load, client filter — chhote lists. Bada data: server search.
    Search generally GET (shareable URL). Count: len(results) ya db.func.count.

  12. 12
    Explain how each demonstrated feature works in the code.
    Times asked 1
    Official solution

    SimpleDemo script pehle se practice karo, 5-7 minute, saari roles.

    Suggested flow

    1) Register/login user 2) Admin login — CRUD 3) Approval/blacklist 4) Booking/apply 5) Search 6) Validation edge (slots 0, duplicate) 7) Logout
    Bolte-bolte dikhao: 'Yahan overbooking rokta hoon'. Code tab kholna jab poochhein.
    Crash ho to debug calmly: terminal error, typo, DB path.
    Mandatory features skip mat karna — examiner list tick karta hai.

  13. 13
    Explain models.py.
    Times asked 21
    Official solution

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

    Viva mein file khol ke bolo:
    1) Kaunsi classes/tables hain (User, Role-specific, Booking...)
    2) Har table ka kaam 1 line
    3) Relationships: 1-1 / 1-M / M-M, backref, cascade, lazy
    4) Constraints: unique email, nullable, default status

    Example skeleton

    class User(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        email = db.Column(db.String(120), unique=True, nullable=False)
        role = db.Column(db.String(20), default='user')
        bookings = db.relationship('Booking', backref='user', cascade='all, delete-orphan')

    ER diagram: rectangles entities, lines relationships, PK/FK mark. Schema = yahi structure.
    Tables create: db.create_all() ya migrations. SQLite file SQL viewer se dikha sakte ho.

  14. 14
    Show the code responsible for displaying data on the dashboard.
    Times asked 1
    Official solution

    Yeh feature demo hai. Account ready rakho, steps bol ke dikhao.

    Role ke hisaab login → action (create/approve/book) → DB/UI pe result → edge case (fail when slots=0 / blacklisted).
    Do browser windows: admin + user. Search/filter alag se dikhao.
    Agar feature nahi hai to sach bolo aur 2 minute mein kaise add karoge (query + template) explain karo.

  15. 15
    Explain the implementation of a specific functionality in the code.
    Times asked 1
    Official solution

    Examiner code pe ungli rakh ke poochta hai — panic mat karo, 4-line formula bolo.

    1) Yeh file/line kya role hai (model / route / template / config)?
    2) Input kahan se aata hai (form, URL <id>, session, JSON)?
    3) DB pe kya query/write?
    4) Output kya (render_template / redirect / jsonify)?

    Example

    @app.route('/book/<int:id>', methods=['POST']) — logged-in user session se, trek id URL se, Booking add, slots--, redirect history.

    Unknown line: imports (request, url_for, flash), decorators, if checks, commit — har keyword ka reason ready rakho.

  16. 16
    Modify both frontend and backend code for a feature.
    Times asked 1
    Official solution

    SimpleFrontend user jo dekhta/click karta hai, Backend server logic + database.

    Frontend: HTML, CSS, Bootstrap, Jinja templates, thoda JS. Browser pe chalta hai.
    Backend: Flask routes, SQLAlchemy, session, validation. Python server pe.
    Data flow: form POST → Flask request.form → DB save → render_template/redirect → HTML dikha.
    MAD1 typical stack: Flask + Jinja + SQLAlchemy + SQLite + Bootstrap.

  17. 17
    What is ORM?
    Times asked 49
    Official solution

    SimpleORM = Object Relational Mapping. Database tables ko Python classes/objects se map karta hai, raw SQL kam likhni padti hai.

    Bina ORM: cursor.execute('SELECT * FROM user WHERE id=?', [5])
    ORM se: User.query.get(5) ya db.session.get(User, 5)

    Example model

    class User(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        email = db.Column(db.String(120), unique=True)

    FaydePython mein soch sakte ho, SQL injection se protection (parameterized), relationships easy, DB switch thoda aasan.

    Nuksaancomplex queries slow/abstract, seekhne ki layer extra, kabhi raw SQL phir bhi chahiye.

    MAD1: SQLAlchemy (Flask-SQLAlchemy). Tables db.create_all() ya migrations se banti hain.

  18. 18
    Difference between filter() and filter_by().
    Times asked 2
    Official solution

    Simplefilter_by simple keyword arguments, filter full SQL-style conditions.

    User.query.filter_by(email='a@x.com').first()  # column=value, easy
    User.query.filter(User.age > 18, User.city == 'Delhi').all()  # comparisons, OR, LIKE

    filter_by sirf equals ke liye. Greater-than, LIKE, joins ke liye filter() use karo.

    Example search

    Trek.query.filter(Trek.name.ilike(f'%{q}%')).all()

    Yeh filter_by se nahi hoga.

  19. 19
    Write the Flask code for a login route.
    Times asked 1
    Official solution

    SimpleLogin GET form dikhata hai, POST credentials check karke session set karta hai.

    @app.route('/login', methods=['GET','POST'])
    def login():
        if request.method == 'POST':
            u = User.query.filter_by(email=request.form.get('email')).first()
            if u and check_password_hash(u.password, request.form.get('password')):
                if getattr(u, 'blacklisted', False):
                    flash('Blocked'); return redirect(url_for('login'))
                session['user_id'] = u.id
                session['role'] = u.role
                return redirect(url_for('dashboard'))
            flash('Invalid')
        return render_template('login.html')

    Logout: session.clear(); redirect login. Incognito alag cookie jar — logged out dikhega.
    Single login page: role se redirect alag dashboards.

  20. 20
    Write a Flask route to check whether a number is even or odd.
    Times asked 1
    Official solution

    SimpleURL parameters se numbers lo, calculate karke return/render.

    @app.route('/sum/<int:a>/<int:b>')
    def add(a, b):
        return f'Hello, sum is {a+b}'

    Product: a*b. Square: n*n. Even/odd: 'even' if n%2==0 else 'odd'.
    Form se: request.form.get('a', type=int). Background color even/odd:
    color = 'green' if n%2==0 else 'red'

    return render_template('page.html', color=color)

    CSS: body { background: {{ color }}; }

  21. 21
    Write basic Flask code.
    Times asked 1
    Official solution

    Simple Hello World — notepad mein yeh likh ke run karke dikhao:

    from flask import Flask
    app = Flask(__name__)
    @app.route('/')
    def home():
        return 'Hello World'
    if __name__ == '__main__':
        app.run(debug=True)
    
    Jinja version: return render_template('hello.html', name='Shubham')

    hello.html: <h1>Hello {{ name }}</h1>
    POST-only: @app.route('/x', methods=['POST'])

  22. 22
    Write HTML code for a table.
    Times asked 1
    Official solution

    SimpleForm user input server ko bhejti hai. Table rows/columns dikhati hai.

    <form action="{{ url_for('register') }}" method='POST' enctype='multipart/form-data'>
      <input name='email' required>
      <button type='submit'>Go</button>
    </form>

    name attribute server pe key ban'ti hai: request.form['email']. id JS/CSS, value default/dikhta hua text.
    action URL. method GET/POST. enctype file upload pe multipart.
    required frontend empty submit rokta hai (backend phir bhi check).

    <table><thead><tr><th>Name</th></tr></thead><tbody><tr><td>{{ u.name }}</td></tr></tbody></table>

    th header, td data, tr row. Nested table: td ke andar table (avoid, messy).
    method hataoge to GET, password URL mein — buri baat.

  23. 23
    Write a Jinja for loop.
    Times asked 9
    Official solution

    Simple Jinja loop + if — examiner notepad mein likhwaata hai:

    {% for t in treks %}
      <p>{{ t.name }} — {{ t.location }}</p>
    {% else %}
      <p>No treks</p>
    {% endfor %}
    
    {% if user.role == 'admin' %}
      <button>Delete</button>
    {% endif %}

    List filter: {% if x > 10 %}{{ x }}{% endif %}
    Length: {{ items|length }} Upper: {{ name|upper }}
    Table: loop ke andar <tr><td>

  24. 24
    Modify the search functionality so searching by department displays doctors from that department.
    Times asked 1
    Official solution

    SimpleSearch box GET form, backend query filter, results template mein.

    q = request.args.get('q', '').strip()
    results = Doctor.query.filter(Doctor.name.ilike(f'%{q}%')).all() if q else []
    return render_template('search.html', results=results, q=q)

    Jinja: {{ results|length }} matches. Empty: 'No results'.
    JS-only filter: saara data pehle load, client filter — chhote lists. Bada data: server search.
    Search generally GET (shareable URL). Count: len(results) ya db.func.count.

  25. 25
    Difference between PUT and POST.
    Times asked 6
    Official solution

    SimplePOST nayi cheez create karta hai, PUT existing cheez ko replace/update karta hai.

    POST /books → naya book add. Har baar naya ID banega. Idempotent nahi — 2 baar POST = 2 records.
    PUT /books/5 → id=5 wale book ko poora update. Same PUT dubara bhejo to same result (idempotent).

    PUT se create bhi ho sakta hai (agar ID client decide kare), lekin REST convention: create = POST, replace = PUT, partial = PATCH.

    Example

    @app.route('/user', methods=['POST'])          # register naya user
    @app.route('/user/<int:id>', methods=['PUT'])  # poora profile replace

    HTML <form> PUT nahi bhejta, isliye Flask apps mein edit pe bhi POST use hota hai. Examiner ko yeh reason clearly bolo.

  26. 26
    What is an API?
    Times asked 8
    Official solution

    SimpleAPI = Application Programming Interface — do systems predefined rules se baat karti hain. REST API HTTP + JSON use karti hai.

    Controller/route HTML bhi return kar sakta hai. REST API generally JSON return karti hai, frontend alag ho (Vue/Postman).

    Example

    @app.route('/api/users/<int:id>')
    def get_user(id):
        u = User.query.get_or_404(id)
        return jsonify(id=u.id, name=u.name)

    MAD1 HTML apps mein 'API' kabhi-kabhi routes ko hi keh dete hain. Agar Vue nahi to bolo: server-rendered Flask, JSON APIs optional.
    Boolean return: technically jsonify(True) ho sakta hai, lekin meaningful JSON object better. Flask view None return kare to error.
    Test: Postman se GET/POST.
    Parsing: request.get_json() body se, request.args query se.

  27. 27
    Difference between Authentication and Authorization.
    Times asked 20
    Official solution

    SimpleAuthentication poochta hai "tu kaun hai?", Authorization poochta hai "tujhe yeh kaam karne ki permission hai?"

    Authentication: login. Username + password check karke prove karte ho ki tum genuine user ho. Success pe session/token milta hai.
    Authorization: uske baad role check. Admin hi parking lot delete kar sakta hai, normal user nahi.

    Example (Flask):
    # Authentication

    if user and check_password_hash(user.password, form_password):
        session['user_id'] = user.id
    
    # Authorization
    if session.get('role') != 'admin':
        abort(403)  # logged in ho, lekin allowed nahi

    Project example: student login = authentication. Student admin dashboard nahi khol sakta = authorization.
    Validation alag cheez hai (form sahi bhara hai ya nahi, jaise age 18+).

  28. 28
    Explain MVC/MVP architecture.
    Times asked 1
    Official solution

    SimpleMVC = Model-View-Controller. Code ko 3 hisson mein baant ta hai taaki mix na ho.

    Model: data + DB. models.py — User, Trek, Booking classes.
    View: jo user dekhta hai. templates/*.html + Jinja.
    Controller: beech ka logic. routes / app.py — request lo, model se data, view ko do.

    Example flow (register):
    Browser form POST → Controller register() → User model save → redirect → View dashboard.html

    Draw: Browser → Controller → Model → DB, phir Controller → View → Browser.
    ORM na ho to bhi MVC ho sakta hai — Model raw SQL functions ho sakte hain. Structure matter karta hai, library nahi.
    MVP/MVVM doosri architectures hain; MAD1 mein MVC expected hai.

  29. 29
    What is Git?
    Times asked 3
    Official solution

    SimpleVCS history track karta hai, Git ek distributed VCS hai.

    VCS: kaun kab kya change kiya, rollback, branches. Example: Git, SVN.
    Git distributed: har developer ke paas poori copy (commits) hoti hai. Central GitHub sirf remote hosting hai, lekin Git ka model distributed hai.
    SVN centralized: bina server ke history nahi.

    Commands: git status (kya dirty hai), git branch / git checkout -b feature (nayi branch), git rm --cached file (track band, file rahe).
    Fayda: collaboration, backup, experiment branches, viva GitHub collaborator check.
    Git ke bina bhi files rakh sakte ho, lekin history/merge nahi.

  30. 30
    Why do we use Git?
    Times asked 1
    Official solution

    SimpleGit files ki history rakhta hai. GitHub remote + collaborator viva check.

    git status — kya change/untracked
    git checkout -b viva-fix ya git switch -c viva-fix — nayi branch
    git rm --cached notes.txt — track band, file disk pe rahe (.gitignore)
    git log — commits (examiner poochta hai)
    Collaborator: repo → Settings → Collaborators. MAD-1 instructor add karna mandatory hota hai.

Created for educational purposes only. Questions are based on students' personal experiences and may not reflect actual exam content.