Viva prep · Real questions · Student experiences Enroll in Bootcamp

Proctor workspace

Proctor Level1_149

Share your experience Add your viva experience here
102 Questions
14 Sets
0 Topics
13 Reviews
Tips for this examiner: KNOW EVERYTHING ABOUT YOUR CODE AND SCHEMA

Student reviews

Atanu MAD1

Shared viva questions from response sheet: MAD 1 level 2; github check; ID check

Questions remembered
  1. MAD 1 level 2
  2. github check
  3. ID check
  4. 2 min smoke test, on particular condition.
  5. Coding question : make change to DB (models.py) , add a column in company model
  6. theory - around 20 Theory questions
  7. - explain your architechture
  8. •⁠ ⁠explain restful api
  9. •⁠ ⁠⁠how is login flow working - without looking code, explain everything
  10. •⁠ ⁠⁠cookie vs session
  11. •⁠ ⁠⁠what are jinja templates, what is template inheritance, how have you used it.
  12. •⁠ ⁠⁠explain model.py
  13. •⁠ ⁠⁠what is authorization vs authentication
  14. •⁠ ⁠⁠what is self padding vs self spacing
  15. •⁠ ⁠⁠explain search functionality - explain route in detail
  16. •⁠ ⁠⁠how is blackisted button backend works
  17. All About 40 mins
A MAD1

gave advice to work on debugging skills, more on implementation side, said concepts are good.
guy is patient, calm, helped in between where stuck. advice, just say no if you dont know, dont keep attempting.
keep strong hold of theory and your project, if you are sure, you gonna fuck up in coding part.
all the best to anyone facing this guy. better than any so called POD guys

Questions remembered
  1. github check
  2. ID check
  3. 2 min smoke test, on particular condition. (he was watching demo video side by side)
  4. gave one coding question (too hard) _ make change to DB (show no of openings) - > take input -> create backend -> create frontend route (messed up in panic - project bursted - cooked)
  5. theory - around 20 Theory questions
  6. - explain your architechture
  7. •⁠ ⁠explain ye route, vo route
  8. •⁠ ⁠⁠how is login flow working - without looking code, explain everything
  9. •⁠ ⁠⁠cookie vs session
  10. •⁠ ⁠⁠what are jinja templates, what is template inheritance, how have you used it.
  11. •⁠ ⁠⁠explain model.py
  12. •⁠ ⁠⁠what is authorization vs authentication
  13. •⁠ ⁠⁠what is self padding vs self spacing
  14. •⁠ ⁠⁠explain search functionality - explain route in detail
  15. •⁠ ⁠⁠how is blackisted button backend works
  16. •⁠ ⁠⁠and some 10 theory questions more, as compensation of my performance in coding questions
  17. allowed to use cheat materials like notepad content , commands etc.
Ps MAD1

Very nice and calm proctor, would guide u if u get stuck somewhere.Be confident and answer with conviction ,and greet him.

Questions remembered
  1. Mad1 Viva Level 2
  2. Demonstration (gave a flow to follow )
  3. Asked to add a field in the models.py and display it accordingly
  4. asked Abt backend logic of the search functionality without seeing the code
  5. Asked Abt the logic of login functionality without seeing the code
  6. Asked to explain the structure of the project, Asked some questions about the models
  7. What is cookies and session
  8. What is template inheritance
  9. What is restapi
  10. Cell padding and cell spacing
  11. One or two more but all were from the sheet
Sheet response MAD1

He is very chill. All the questions he asked for this term was from this sheet only. Be cool. Know your code as he will ask you to modify it (Probably that too only from the tasks stated in this sheet). Be calm and answer with confidence.

Questions remembered
  1. Theoretical Questions:
  2. What is a REST API? How is it different from standard HTTP methods?
  3. Explain the different HTTP methods and the difference between them (GET, POST, PUT, DELETE).
  4. What is the difference between cookies and sessions? Where are sessions stored?
  5. What is the difference between Authentication and Authorisation?
  6. What is scalability? What are its types (horizontal vs. vertical scalability) and what do they do?
  7. What is template inheritance? Have you used it in your application?
  8. What is an ORM (Object-Relational Mapping)?
  9. Explain your database schema, project structure, and relationships (specifically referring to models.py).
  10. What is the difference between back_populates and back_ref? Which one have you used and why? Project Features & Architecture: (To be explained without looking at code)
  11. Application Demo: Run the project, test edge cases, and demonstrate creating a student, a company, and a placement drive.
  12. Search Functionality: Explain how the Admin-Search works on both the frontend and backend, including how data is sent from the backend to the frontend.
  13. Authentication: Explain your login, verify, and logout functionalities on both the frontend and backend. Live Coding / Code Modification Tasks:
  14. Task: Add an "openings" field in the drive/post job section by the company to show the number of available roles. Make sure this reflects in the drives info table on the dashboard (requiring both frontend and backend changes).
Poovarasu G MAD1

Prepare all of your codes

Questions remembered
  1. He asked only the questions what we have already in this sheet
Faria MAD1

He's a very nice proctor, helps you in coding if you are stuck, just go thru all the questions asked by him in this sheet he asks the same

Questions remembered
  1. 1.What is ORM
  2. 2.What is scalability and its types
  3. 3.Diff between cell padding and cell spacing
  4. 4.Explain your db schema and the relationships (models.py)
  5. 5.Diff between cookie and session
  6. 6.Explain search functionality without looking at your code (and how does the data from the backend get sent to the frontend)
  7. 7.Authentication and Authorisation
  8. 8.back_ref and back_populates which have you used and why
  9. 9.What is REST API
  10. 10.What are the HTTP methods (get, post, put, delete)
  11. 11.What is template inheritance and have u used it in ur application
  12. 12.Explain your login and logout route without looking at code
  13. 13.Code question: add openings field in drive table and make changes to the frontend and backend
Anonymous MAD1

The proctor was very kind and patient he would let you speak but once done with the demo he would ask many questions back to back like rapid fire
He will give you ample amount of time for code changes so don't worry

Questions remembered
  1. Level1_149 *Theory* : There were lot of theory ques so I don't remember all but most of them were from this sheet
  2. Demo of the app...asked me to create a student and a company and a placement drive and tested the edge cases
  3. Explain database schema and your project structure
  4. Explain RESTApi and it's methods
  5. Difference between sessions and cookies
  6. Explain about different HTTP methods
  7. Difference between authentication and authorisation
  8. Explain the search functionality both frontend and backend
  9. Explain your login feature both frontend and backend
  10. How are you handling db migration
  11. Where are session stored
  12. What is stateless
  13. How do you store the state of an object in flask *Code Change* Add a field "openings" in the post job section of Company also add it in the drives info table on the dashboard make both frontend and back-end changes
Meet MAD1

The proctor is very chill he will help you if you get stuck while coding jus know your proj in and out and practice the theory questions in the sheet he follows repeated pattern of theory questions so prepare well

Questions remembered
  1. 1.Download the proj and run it 2.Checked the edge cases of my project 3.What is ORM 4.What is scalability? What are its type? and what do they do? 5.What is cell spacing and cell padding 6.explain models.py(your db file)
  2. explain search functionality without seeing the code
  3. Coding question: Add a new row in the drive section named openings to show number of openings for the drive by the company Took my 30 mins for the viva
Sheet response MAD1

He is very chill guy so don't take stress or tension. Also he opens the video of him this is a new thing I noticed.

Questions remembered
  1. Lot of theory questions like
  2. What is the difference between url and redirect?
  3. What is cookies vs session
  4. What is ORM?
  5. What is scalable?
  6. What is cell spacing vs cell padding ?
  7. Student and drive duplicate prevention?
  8. How is search functionality works?
  9. Theory question is only one that is
  10. 1- Add an age field in the student registration form and show me the effect on the database structure?
Sahil Mishra MAD1

The proctor was chill and kind. Just do one thing, before viva begin greet him Good Evening. And at the end he asked me for any further doubt or query, so I asked him about giving feedback for me, he told me everything honestly about the viva. At the end he told me, all the best for future and have a great day ahead.

Questions remembered
  1. Project Demo
  2. Database Schema
  3. Authentication and Authorisation
  4. Cell Padding and Cell Spacing
  5. Create age input on Register Page and show the Impact on DB
  6. What is ORM?
  7. back_ref and back_populates
  8. Difference between cookies and session
  9. Explain models.py.
  10. What is REST API? How is it different from HTTP Methods?
  11. Explain login verify functionality without seeing the code.
  12. What is template inheritance?
Veena Singh MAD1

Proctor was kind and helpful. Sir was asking lots of theory questions. So, prepare well. AND have the all logic of the routes clear because you have to explain the logic without opening the app.py or any route.
Sir will help you if u find any difficulties while changing the code.
Didn't have any of the question from sir in this sheet for this term But I have preferred his PYQs from this sheet(only 2 entries where there).So, Hope this will help!!!

All the very best!!!

Questions remembered
  1. MAD1 LEVEL-2
  2. Explain the functionality of Admin-Search without seeing the code
  3. Explain the model.py
  4. Difference between back_populates and back_ref.
  5. What is ORM ?
  6. Difference between render_template and redirect
  7. Difference between cookies and session.
  8. explain the REST API and HTTP methods
  9. Explain login verify functionality without seeing the code.
  10. What is template inheritance.Have you used it?
  11. What is scalability , horizontal vs vertical scalability
  12. Add a company address field and reflect the added field on the company's profile page if you have or in admin dashboard in company's view details section. 12.Explain the db schema.
  13. where are you storing blacklisted field in your database
  14. Difference between GET,POST,PUT,DELETE
  15. how data is passed in render_template and redirect()
  16. Application demo.
  17. Difference between Cell padding and Cell Spacing MAD1 LEVEL-1 (Proctor ID 1_93)
  18. Please refer to her PYQs. She is a very kind proctor.
Sheet response MAD1

-He is chill, just know ur code, and just answer what u know
-At the end he will ask if u have any questions
-I asked about the feedback of my response

Questions remembered
  1. -He asked the same questions as asked to the guy whose response is in 308 row number
  2. -even the code change was the same, so just learn the adding age thing to ur user code and displaying it in the manage users page(in admin)
Sheet response MAD1

KNOW EVERYTHING ABOUT YOUR CODE AND SCHEMA

Questions remembered
  1. STRUCTURE OF MY CODE
  2. DEMO
  3. CHECKED IF EVERYTHING IS WORKING PROPERLY(edge cases like DELETION WHEN SLOTS ARE FILLED etc)
  4. STRUCTURED VS UNSTRUCTURED DATABASES
  5. RANDOM LINES OF MY CODE
  6. ROUTES AND MODELS IN DETAIL
  7. ASKED TO GET USER AGE IN REGISTRATION AND UPDATE ROUTE/TEMPLATE TO DISPLAY LIST OF USERS ALONG WITH AGE
  8. TEMPLATE INHERITANCE AND CSS
  9. REST,HTTP METHODS,STATUS CODES, WHAT I HAVE USED
  10. MVC ARCHITECTURE
  11. CAN HTML SUPPORT REQUESTS
  12. CASCADE ALL,DELETE,LAZY LOADING
  13. KEPT ASKING QUESTIONS FROM WHATEVER I ANSWERED

Approved viva sets

Download all
  1. 1
    MAD 1 level 2
    Times asked 1
    Official solution

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

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

  2. 2
    2 min smoke test, on particular condition.
    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
    Coding question : make change to DB (models.py) , add a column in company model
    Times asked 1
    Official solution

    SimpleLive coding: notepad/editor mein chhota Flask route / Jinja loop / model field. Calm raho, run karke dikhao.

  4. 4
    •⁠ ⁠explain restful api
    Times asked 1
    Official solution

    SimpleREST: resources + HTTP verbs. GET read, POST create, PUT/PATCH update, DELETE remove. Stateless ideal.

  5. 5
    All About 40 mins
    Times asked 1
    Official solution

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

  1. 1
    gave one coding question (too hard) _ make change to DB (show no of openings) - > take input -> create backend -> create frontend route (messed up in panic - project bursted - cooked)
    Times asked 1
    Official solution

    SimpleLive coding: notepad/editor mein chhota Flask route / Jinja loop / model field. Calm raho, run karke dikhao.

  2. 2
    theory - around 20 Theory questions
    Times asked 1
    Official solution

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

  3. 3
    - explain your architechture
    Times asked 1
    Official solution

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

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

  4. 4
    •⁠ ⁠explain ye route, vo route
    Times asked 1
    Official solution

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

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

  5. 5
    •⁠ ⁠⁠explain search functionality - explain route in detail
    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()
  6. 6
    •⁠ ⁠⁠how is blackisted button backend works
    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.

  7. 7
    •⁠ ⁠⁠and some 10 theory questions more, as compensation of my performance in coding questions
    Times asked 1
    Official solution

    SimpleLive coding: notepad/editor mein chhota Flask route / Jinja loop / model field. Calm raho, run karke dikhao.

  8. 8
    allowed to use cheat materials like notepad content , commands etc.
    Times asked 1
    Official solution

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

Advice: gave advice to work on debugging skills, more on implementation side, said concepts are good. guy is patient, calm, helped in between where stuck. advice, just say no if you dont know, dont keep attempting. keep strong hold of theory and your project, if you are sure, you gonna fuck up in coding part. all the best to anyone facing this guy. better than any so called POD guys
  1. 1
    Demonstration (gave a flow to follow )
    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 add a field in the models.py and display it accordingly
    Times asked 1
    Official solution

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

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

    Example

    class Lot(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        name = db.Column(db.String(80), nullable=False)
        spots = db.relationship('Spot', backref='lot', lazy=True)
  3. 3
    asked Abt backend logic of the search functionality without seeing the code
    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 to explain the structure of the project, Asked some questions about the 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
    What is restapi
    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
    One or two more but all were from the sheet
    Times asked 1
    Official solution

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

Advice: Very nice and calm proctor, would guide u if u get stuck somewhere.Be confident and answer with conviction ,and greet him.
  1. 1
    Theoretical Questions:
    Times asked 2
    Official solution

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

Advice: He is very chill. All the questions he asked for this term was from this sheet only. Be cool. Know your code as he will ask you to modify it (Probably that too only from the tasks stated in this sheet). Be calm and answer with confidence.
  1. 1
    He asked only the questions what we have already in this sheet
    Times asked 1
    Official solution

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

Advice: Prepare all of your codes
  1. 1
    2.What is scalability and its types
    Times asked 1
    Official solution

    SimpleLoad badhe to handle: scale up/out, cache, async, DB tune.

    SQL scale: indexes, pool, replicas, partition, cache hot queries.

    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: If 10k: URI postgres, gunicorn, cache, celery concurrency.

  2. 2
    3.Diff between cell padding and cell spacing
    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
    4.Explain your db schema and the relationships (models.py)
    Times asked 1
    Official solution

    Simpledb.relationship se object graph: lot.spots, booking.user. backref reverse side auto deta hai.

    Example

    spots = db.relationship('Spot', backref='lot', cascade='all, delete-orphan')
  4. 4
    5.Diff between cookie and session
    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
    8.back_ref and back_populates which have you used and why
    Times asked 1
    Official solution

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

    Example

    # backref
    spots = db.relationship('Spot', backref='lot')
    # spot.lot available
    
    # back_populates
    spots = db.relationship('Spot', back_populates='lot')
    # Spot.lot = db.relationship('Lot', back_populates='spots')
  6. 6
    10.What are the HTTP methods (get, post, put, delete)
    Times asked 1
    Official solution

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

    Example

    @app.route('/login', methods=['GET', 'POST'])
    def login():
        if request.method == 'POST':
            # validate + session
            ...
        return render_template('login.html')
  7. 7
    12.Explain your login and logout route without looking at code
    Times asked 1
    Official solution

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

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

  8. 8
    13.Code question: add openings field in drive table and make changes to the 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.

Advice: He's a very nice proctor, helps you in coding if you are stuck, just go thru all the questions asked by him in this sheet he asks the same
  1. 1
    Level1_149 *Theory* : There were lot of theory ques so I don't remember all but most of them were from this sheet
    Times asked 1
    Official solution

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

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

  2. 2
    Explain database schema and your project structure
    Times asked 1
    Official solution

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

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

  3. 3
    Explain RESTApi and it's methods
    Times asked 1
    Official solution

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

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

  4. 4
    Explain about different HTTP methods
    Times asked 1
    Official solution

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

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

  5. 5
    Explain your login feature both frontend and backend
    Times asked 1
    Official solution

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

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

  6. 6
    How are you handling db migration
    Times asked 1
    Official solution

    SimpleMigration = schema change history (Flask-Migrate/Alembic). Model badlo → migrate → upgrade.

    Example

    flask db migrate -m 'add spot status'
    flask db upgrade
  7. 7
    Where are session stored
    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().

  8. 8
    How do you store the state of an object in flask *Code Change* Add a field "openings" in the post job section of Company also add it in the drives info table on the dashboard make both frontend and back-end changes
    Times asked 1
    Official solution

    SimpleFlask lightweight Python web framework — routes, request/response, templates. MAD1 ka backend yahi hai.

    Example

    from flask import Flask
    app = Flask(__name__)
    
    @app.route('/')
    def home():
        return 'Hello'

    Viva tipFlask micro hai: jo chahiye (DB, login, forms) khud jodte ho.

Advice: The proctor was very kind and patient he would let you speak but once done with the demo he would ask many questions back to back like rapid fire He will give you ample amount of time for code changes so don't worry
  1. 1
    Coding question: Add a new row in the drive section named openings to show number of openings for the drive by the company Took my 30 mins for the viva
    Times asked 1
    Official solution

    SimpleLive coding: notepad/editor mein chhota Flask route / Jinja loop / model field. Calm raho, run karke dikhao.

Advice: The proctor is very chill he will help you if you get stuck while coding jus know your proj in and out and practice the theory questions in the sheet he follows repeated pattern of theory questions so prepare well
  1. 1
    Lot of theory questions like
    Times asked 1
    Official solution

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

  2. 2
    What is the difference between url and redirect?
    Times asked 1
    Official solution

    Simpleredirect dusre URL pe bhejta hai. flash one-time message session mein rakh ke next page pe dikhata hai.

    Example

    flash('Login successful', 'success')
    return redirect(url_for('user.dashboard'))
  3. 3
    What is cookies vs session
    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().

  4. 4
    What is scalable?
    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.

  5. 5
    What is cell spacing vs cell padding ?
    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.

  6. 6
    Student and drive duplicate prevention?
    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.

  7. 7
    How is search functionality works?
    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()
  8. 8
    Theory question is only one that is
    Times asked 1
    Official solution

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

  9. 9
    1- Add an age field in the student registration form and show me the effect on the database structure?
    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
Advice: He is very chill guy so don't take stress or tension. Also he opens the video of him this is a new thing I noticed.
  1. 1
    Authentication and Authorisation
    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)
  2. 2
    Create age input on Register Page and show the Impact on DB
    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: The proctor was chill and kind. Just do one thing, before viva begin greet him Good Evening. And at the end he asked me for any further doubt or query, so I asked him about giving feedback for me, he told me everything honestly about the viva. At the end he told me, all the best for future and have a great day ahead.
  1. 1
    MAD1 LEVEL-2
    Times asked 1
    Official solution

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

  2. 2
    Explain the functionality of Admin-Search without seeing the code
    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()
  3. 3
    Explain the model.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)
  4. 4
    Difference between back_populates and back_ref.
    Times asked 1
    Official solution

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

    Example

    # backref
    spots = db.relationship('Spot', backref='lot')
    # spot.lot available
    
    # back_populates
    spots = db.relationship('Spot', back_populates='lot')
    # Spot.lot = db.relationship('Lot', back_populates='spots')
  5. 5
    Difference between cookies and session.
    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().

  6. 6
    explain the REST API and HTTP methods
    Times asked 1
    Official solution

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

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

  7. 7
    Explain login verify functionality without seeing the code.
    Times asked 1
    Official solution

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

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

  8. 8
    What is template inheritance.Have you used it?
    Times asked 1
    Official solution

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

    Example

    {# base.html #}
    {% block content %}{% endblock %}
    
    {# home.html #}
    {% extends 'base.html' %}
    {% block content %}
      <h1>Home</h1>
    {% endblock %}
  9. 9
    Add a company address field and reflect the added field on the company's profile page if you have or in admin dashboard in company's view details section. 12.Explain the db schema.
    Times asked 1
    Official solution

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

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

  10. 10
    where are you storing blacklisted field in your database
    Times asked 1
    Official solution

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

  11. 11
    how data is passed in render_template and redirect()
    Times asked 1
    Official solution

    Simplerender_template Jinja HTML file ko data deke final HTML banata hai.

    Example

    return render_template('dashboard.html', user=user, lots=lots)
  12. 12
    Please refer to her PYQs. She is a very kind proctor.
    Times asked 1
    Official solution

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

Advice: Proctor was kind and helpful. Sir was asking lots of theory questions. So, prepare well. AND have the all logic of the routes clear because you have to explain the logic without opening the app.py or any route. Sir will help you if u find any difficulties while changing the code. Didn't have any of the question from sir in this sheet for this term But I have preferred his PYQs from this sheet(only 2 entries where there).So, Hope this will help!!! All the very best!!!
  1. 1
    -He asked the same questions as asked to the guy whose response is in 308 row number
    Times asked 1
    Official solution

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

  2. 2
    -even the code change was the same, so just learn the adding age thing to ur user code and displaying it in the manage users page(in admin)
    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.

Advice: -He is chill, just know ur code, and just answer what u know -At the end he will ask if u have any questions -I asked about the feedback of my response
  1. 1
    STRUCTURE OF MY CODE
    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.

  2. 2
    DEMO
    Times asked 3
    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
    CHECKED IF EVERYTHING IS WORKING PROPERLY(edge cases like DELETION WHEN SLOTS ARE FILLED etc)
    Times asked 1
    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(...)
  4. 4
    STRUCTURED VS UNSTRUCTURED DATABASES
    Times asked 1
    Official solution

    SimpleUngli rakhe to 4-line formula — panic ki jagah structure.

    1) File ka role: model / Flask route / Vue SFC / celery task / config
    2) Input kahan: JSON, params, token, props, $route
    3) Kya kaam: query, cache, validation, .delay()
    4) Output: jsonify, this.items, email, redirect

    Unknown keyword: import, decorator, if, commit — har ka reason. Bluff mat.

    Suggested flow1) Kaunsi layer?
    2) Input?
    3) DB/cache/task?
    4) Response/UI?

    Project example: Booking POST: jwt, seats check, commit, 201, Vue list push.

    Viva tipUnknown keyword: import, decorator, if, commit — har ka reason. Panic mat.

  5. 5
    RANDOM LINES OF MY CODE
    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
    ROUTES AND MODELS IN DETAIL
    Times asked 1
    Official solution

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

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

    Example

    class Lot(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        name = db.Column(db.String(80), nullable=False)
        spots = db.relationship('Spot', backref='lot', lazy=True)
  7. 7
    ASKED TO GET USER AGE IN REGISTRATION AND UPDATE ROUTE/TEMPLATE TO DISPLAY LIST OF USERS ALONG WITH AGE
    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.

  8. 8
    TEMPLATE INHERITANCE AND CSS
    Times asked 1
    Official solution

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

    Example

    {# base.html #}
    {% block content %}{% endblock %}
    
    {# home.html #}
    {% extends 'base.html' %}
    {% block content %}
      <h1>Home</h1>
    {% endblock %}
  9. 9
    REST,HTTP METHODS,STATUS CODES, WHAT I HAVE USED
    Times asked 1
    Official solution

    SimpleStatus code server ka result: 200 OK, 302 redirect, 400 bad input, 401/403 auth, 404 not found, 500 server error.

  10. 10
    MVC ARCHITECTURE
    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

  11. 11
    CAN HTML SUPPORT REQUESTS
    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.

  12. 12
    CASCADE ALL,DELETE,LAZY LOADING
    Times asked 1
    Official solution

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

  13. 13
    KEPT ASKING QUESTIONS FROM WHATEVER I ANSWERED
    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.

Advice: KNOW EVERYTHING ABOUT YOUR CODE AND SCHEMA
  1. 1
    GitHub check, ID verification, download/checksum/smoke test.
    Times asked 1
    Official solution

    SimpleChecksum file ka hash (jaise SHA256) — file change hui ya nahi verify.

    Portal pe submitted ZIP ka checksum diya hota hai. Local file ka hash nikaalo, match hona chahiye.
    Linux: sha256sum project.zip
    Mismatch = galat file / corrupt download. Examiner integrity check karta hai ki tumhari submitted copy hi run ho rahi hai.

  2. 2
    Demonstrate the complete application and explain the project flow.
    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.

  3. 3
    Explain the project architecture and folder structure. Explain edge cases in your project.
    Times asked 1
    Official solution

    SimpleRoutes/controllers URLs handle karte hain. app.py app banata hai, models.py data, templates/ views, static/ CSS-JS.

    Typical structure:
    app.py / __init__.py → Flask app, db.init, register blueprints
    models.py → tables
    routes.py / views → @app.route functions
    templates/ → Jinja HTML
    static/ → css, images
    instance/*.db → SQLite

    Ek route explain karne ka template:
    1) URL + methods 2) Auth/role check 3) Form/query se data 4) Business rule (duplicate, slots) 5) db.session 6) render ya redirect

    Example GET+POST same route: GET form, POST save.
    Data HTML se: form name= → request.form. Data HTML ko: render_template(..., items=query).
    Nayi .py file: import karke use karo, warna Flask ko pata nahi. Folder rename: imports/paths/templates check.

  4. 4
    Explain models.py and the database schema.
    Times asked 1
    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.

  5. 5
    Explain relationships between models. One-to-One / One-to-Many. backref vs back_populates.
    Times asked 1
    Official solution

    Simpledono SQLAlchemy relationships ko do taraf se connect karte hain, farq sirf likhne ke style ka hai.

    backref: relationship ek side pe likhte ho, doosri side SQLAlchemy khud bana deta hai. Short hai, lekin dono models dekh ke relationship clearly nahi dikhti.

    back_populates: dono models pe relationship explicitly likhte ho. Code padhne wale ko turant samajh aa jaata hai ki User.posts aur Post.author linked hain.

    Example

    class User(db.Model):
        posts = db.relationship('Post', backref='author')

    Yahan Post.author automatically mil jaata hai.

    Explicit version:

    class User(db.Model):
        posts = db.relationship('Post', back_populates='author')
    class Post(db.Model):
        author = db.relationship('User', back_populates='posts')

    Viva tipexaminer ko bolo — MAD1 project mein back_populates zyada clear hai, isliye preferred.


    Simplebackref relationship ki reverse side automatically bana deta hai.

    class Post(db.Model):
        user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
        user = db.relationship('User', backref='posts')

    Ab post.user milta hai, aur user.posts bhi — Post model pe sirf ek line.
    secondary Many-to-Many junction table ke liye: relationship(..., secondary=likes_table, backref='liked_by').
    Explicit chahiye to back_populates use karo.

  6. 6
    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.

  7. 7
    Where is the blacklisted field stored? Explain database migration (if asked).
    Times asked 1
    Official solution

    SimpleBlacklist flag user/company ko block karta hai — login ya features band.

    user.is_blacklisted = True; db.session.commit()
    Login: if user.is_blacklisted: flash('Blocked'); return
    Student dashboard: blacklisted company ke drives hide — query filter join Company.is_blacklisted==False.
    Demo: admin blacklist → us user se login fail.

  8. 8
    Explain duplicate prevention (student applying twice, duplicate drives, etc.).
    Times asked 1
    Official solution

    SimpleDuplicate/overbook rokne ke liye DB constraint + route check dono.

    Pehle query: Booking.query.filter_by(user_id=uid, trek_id=tid).first()
    Agar exists: flash('Already booked'); return
    Slots: if trek.available <= 0: reject else trek.available -= 1; commit
    Race condition: unique(user_id, trek_id) constraint — do tabs se double click pe bhi ek hi row.
    Blacklist: login pe is_blacklisted check.
    Active drive limit: if Company ke paas status=open drive hai to naya mat banne do.

  9. 9
    Explain the login flow (without looking at the code).
    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.

  10. 10
    Explain the logout flow.
    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.

  11. 11
    Explain the search functionality (frontend + backend) without looking at the code.
    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.


    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 any route and its backend logic.
    Times asked 1
    Official solution

    SimpleRoutes/controllers URLs handle karte hain. app.py app banata hai, models.py data, templates/ views, static/ CSS-JS.

    Typical structure:
    app.py / __init__.py → Flask app, db.init, register blueprints
    models.py → tables
    routes.py / views → @app.route functions
    templates/ → Jinja HTML
    static/ → css, images
    instance/*.db → SQLite

    Ek route explain karne ka template:
    1) URL + methods 2) Auth/role check 3) Form/query se data 4) Business rule (duplicate, slots) 5) db.session 6) render ya redirect

    Example GET+POST same route: GET form, POST save.
    Data HTML se: form name= → request.form. Data HTML ko: render_template(..., items=query).
    Nayi .py file: import karke use karo, warna Flask ko pata nahi. Folder rename: imports/paths/templates check.

  13. 13
    Explain how the blacklist functionality works. Explain how backend data is sent to the frontend.
    Times asked 1
    Official solution

    Simple flow: Browser → Route (controller) → Model/DB → phir template (view) → Browser.

    Submit example:
    1) HTML form POST /register, name='email'
    2) register() request.form.get('email')
    3) User(email=...) ; db.session.add; commit
    4) redirect dashboard
    5) dashboard query + render_template
    6) Jinja {{ user.email }} / {% for %}

    GET search: /search?q=flask → request.args.get('q') → filter ilike → template list.
    JSON API: jsonify, frontend fetch().


    SimpleBlacklist flag user/company ko block karta hai — login ya features band.

    user.is_blacklisted = True; db.session.commit()
    Login: if user.is_blacklisted: flash('Blocked'); return
    Student dashboard: blacklisted company ke drives hide — query filter join Company.is_blacklisted==False.
    Demo: admin blacklist → us user se login fail.

  14. 14
    Difference between: render_template() and redirect(). url_for() and redirect().
    Times asked 1
    Official solution

    Simplerender_template HTML page bana ke turant dikhata hai, redirect user ko doosre URL pe bhej deta hai.

    render_template('home.html', user=user) → server template fill karke 200 response deta hai. URL same rehta hai.
    redirect(url_for('dashboard')) → 302 response, browser naya GET karta hai. URL change ho jaata hai.

    Examplelogin POST successful hone ke baad render_template mat use karo, warna refresh pe form dubara submit ho jaayega.

    Sahi tarika: redirect(url_for('dashboard')) — yeh Post-Redirect-Get pattern hai.

    render_template tab: page dikhana hai with data.
    redirect tab: kaam ho gaya, ab doosre page pe le jaana hai (login, delete, update ke baad).


    Simpleurl_for sirf URL string banata hai, redirect us URL pe browser ko bhejta hai.

    url_for('home') → '/home' (function name se URL nikalta hai)
    redirect(url_for('home')) → browser ko /home pe le jaata hai

    Example

    return redirect(url_for('dashboard'))  # sahi
    return redirect('/dashboard')         # hardcode, route change pe toot jaayega
    
    Agar redirect se url_for hata do to khud path string dena padega: redirect('/dashboard').
    Agar url_for('home') ko url_for('home_page') kar do aur home_page naam ka function nahi hai to BuildError aayega.

    url_for ko function ka naam chahiye, URL path nahi.

  15. 15
    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 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+).

  16. 16
    Cookies vs Sessions. Where are sessions stored?
    Times asked 1
    Official solution

    SimpleCookie browser mein save hoti hai, Session server pe data rakhta hai aur browser ko sirf ID deta hai.

    Cookie: key-value browser pe. JS padh sakta hai (agar HttpOnly nahi). Size chhoti (~4KB).
    Session: server-side dict. Flask default mein session data signed cookie mein hi store hota hai (client pe, lekin tamper-proof).

    Example

    session['user_id'] = 12 # login ke baad
    # browser ko Set-Cookie milti hai

    Tab close: default Flask session cookie browser close pe delete (session cookie). Permanent session alag hota hai.
    Incognito: cookies isolated, isliye logged-in nahi dikhega.
    SECRET_KEY se session sign hota hai — key nahi to session insecure/kaam nahi karega.

  17. 17
    What is a stateless application? How does Flask maintain object/application state?
    Times asked 1
    Official solution

    SimpleHTTP stateless hai — har request independent, server previous request yaad nahi rakhta.

    Isliye login ke baad bhi har request pe kaun ho yeh prove karna padta hai: cookie/session/JWT.
    State = yaad rakhna (user_id, cart). HTTP khud nahi rakhta; Flask session iske upar layer hai.
    Fayda: scale aasan, koi bhi server next request handle kar sake (sticky session ke bina, token use karke).

  18. 18
    What is a REST API? REST API vs HTTP Methods.
    Times asked 1
    Official solution

    SimpleHTTP methods batate hain request kya karna chahti hai. Common: GET POST PUT PATCH DELETE.

    GETread/fetch. Safe, URL se. Page kholna, search.

    POSTcreate/submit. Form, login.

    PUTpoora replace/update. Idempotent.

    PATCHpartial update.

    DELETEhataana.

    HEAD: sirf headers. OPTIONS: CORS preflight.

    Flask: @app.route('/x', methods=['GET','POST'])
    Agar methods na likho to default sirf GET.
    HTML form native sirf GET/POST. PUT/DELETE JS/fetch ya hidden _method se.
    GET se data fetch ho sakta hai, create nahi karna chahiye. POST se theoretically fetch ho sakta hai lekin cache/semantics galat.
    DELETE fetch ke liye nahi. GET POST ka kaam officially nahi karta — side effects GET pe mat rakho.

  19. 19
    Explain HTTP methods (GET, POST, PUT, DELETE). Difference between GET, POST, PUT and DELETE.
    Times asked 1
    Official solution

    SimpleGET read karta hai, PUT existing resource replace/update karta hai.

    GET /users/1 → data lao, side-effect nahi. PUT /users/1 → poora user update, idempotent.
    PUT vs FETCH: FETCH HTTP method nahi, JS fetch() function hai jo GET/PUT/POST kuch bhi bhej sakta hai.
    Search GET, edit-save PUT/POST. GET se create mat karo.


    SimpleGET data mangta hai (read), POST data bhejta hai (create/submit).

    GETURL mein dikhta hai, bookmark ho sakta hai, browser back/refresh safe hai, data URL query mein jaata hai. Search, page open, login form dikhana.

    POSTbody mein data jaata hai, URL mein password nahi dikhta, refresh pe dubara submit ho sakta hai. Login, register, form save.

    Example

    # page dikhana

    @app.route('/login', methods=['GET', 'POST'])
    def login():
        if request.method == 'GET':
            return render_template('login.html')
        # POST: form submit
        email = request.form.get('email')
        ...

    GET se theoretically data bhej sakte ho (?q=flask), lekin create/update ke liye nahi use karna — data log/history mein save ho jaata hai, length limit hoti hai.
    HTML form default GET hota hai; method='POST' likhna zaroori hai login/register pe.

  20. 20
    What are Jinja templates? What is Template Inheritance?
    Times asked 1
    Official solution

    Simpleextends poora layout inherit karta hai, include chhota piece insert karta hai.

    extends: child page base.html ka structure use karti hai, blocks override karti hai. Ek hi parent.
    include: navbar.html / footer.html jahan chaho insert. Kai baar use ho sakta hai.

    base.html:

    {% block content %}{% endblock %}
    
    home.html:
    {% extends 'base.html' %}
    {% block content %}<h1>Home</h1>{% endblock %}
    
    {% include 'navbar.html' %}  → navbar har page pe

    Fayda: header/footer ek jagah, change once — saari pages update. MAD1 mein almost har project use karta hai.

  21. 21
    How have you used Template Inheritance? Cell Padding vs Cell Spacing.
    Times asked 1
    Official solution

    Simplecellpadding cell ke andar gap, cellspacing cells ke beech gap.

    cellpadding: text aur cell border ke beech khali jagah (andar).
    cellspacing: do cells ke beech khali jagah (bahar).

    Old HTML: <table cellpadding='10' cellspacing='5'>
    Modern CSS:
    td { padding: 10px; } /* padding */
    table { border-spacing: 5px; } /* spacing */

    border-collapse: collapse spacing hata deta hai, borders mil jaate hain.

  22. 22
    What is Scalability? Horizontal vs Vertical Scaling.
    Times asked 1
    Official solution

    SimpleVertical = same machine ko powerful banao. Horizontal = aur machines add karo.

    Vertical (scale up): RAM/CPU badhao. Simple, lekin ek limit hai, downtime ho sakta hai, single point of failure.
    Horizontal (scale out): 5 servers + load balancer. Sasta long-term, fault tolerant, lekin session/DB sharing sochna padta hai.

    Example10k users aaye to Flask app ke 4 copies chalao nginx peeche, DB alag machine pe.

    Thousands of requests on one machine: caching (Redis), DB indexes, gunicorn workers, phir horizontal.

  23. 23
    Add an Age field to the registration page and reflect it in the database/admin.
    Times asked 1
    Official solution

    Simple 4-step: Model → DB → Form → Route → Template. Yeh sabse common live-coding hai.

    1) models.py: age = db.Column(db.Integer, nullable=True)
    2) DB: SQLite viewer se column, ya DB delete karke create_all, ya ALTER TABLE user ADD COLUMN age INTEGER; production mein Flask-Migrate.
    3) register.html: <input type='number' name='age' min='18' required>
    4) route: user.age = request.form.get('age', type=int); commit
    5) dashboard: {{ user.age }} admin table mein <td>{{ u.age }}</td>

    Print terminal: print('AGE', request.form.get('age'))
    Phone/city same pattern, String(20). Openings on Drive: integer column + form + create_drive route.

  24. 24
    Add an Address field to the Company model and display it.
    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 }}
  25. 25
    Add an Openings field to the Drive model and update both backend and frontend.
    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 }}
  26. 26
    Make corresponding database, route, and template changes for newly added fields.
    Times asked 1
    Official solution

    Yeh MAD-1 viva question tumhare project ke context se linked hai. Short answer is structure se do:

    Pehle 1 line definition/purpose, phir tumhare project ka example, phir chhota code/flow.

    Typical Flask flowBrowser request → @app.route controller → SQLAlchemy model/DB → Jinja template response.

    Auth: session['user_id'] + role check. CRUD: add/commit, query.all, field update, delete.
    Live change maange to: related model → route → template, phir browser refresh karke dikhao.

    Example (generic create):
    obj = Model(name=request.form.get('name'))

    db.session.add(obj); db.session.commit()
    return redirect(url_for('list_view'))
Created for educational purposes only. Questions are based on students' personal experiences and may not reflect actual exam content.