Viva prep · Real questions · Student experiences Enroll in Bootcamp

Proctor workspace

Proctor Level1_139

Share your experience Add your viva experience here
241 Questions
22 Sets
0 Topics
5 Reviews
Tips for this examiner: Understanding

Student reviews

Sujal mishra MAD1

she is calm and patient, mostly she will ask to explain code and theory but she tells you to make some changes it code and add more funtionality so be ready for it, i was really stressed and scared but you should control yourself, anyway she's good

Questions remembered
  1. I'd card
  2. Github collaborator
  3. Project download Explain the frameworks used
  4. Explain what you've done
  5. Explain the code structure what is your app do explain your app and idea behind it.
  6. explain models
  7. Relationship of tables. - you will tell one to many then she will ask where you have mentioned its one to many How you make one-one and one-to-many relationship? explain create_trek route, how you are getting info in it Which CSS you use ?
  8. CSS priority (inline, internal, external) ?
  9. Which CSS is more useful for large project? explain html code, app.py, models What is template inheritance? Show where you've done it. Run the code and show the app add age in register page and condition age>18 and age<100
Aman Raj MAD1

She is good and supportive when you stop answering than she help you by giving some concept hint.
Go through your code's and you must know each functions ; )

Questions remembered
  1. - show your id card.
  2. - show GitHub and collaborator.
  3. - download/checksum.
  4. - what is your app do explain your app and idea behind it.
  5. - explain models
  6. - Relationship of tables.
  7. - What is lazy?
  8. - How you make one-one and one-to-many relationship?
  9. - What is CRUD, Show in your code where you use it ?
  10. - What is Scaling?
  11. - Explain Vertical and horizontal Scaling.
  12. - Explain any route / How admin login and go to dashboard?
  13. - Your project has dynamic or static page ?
  14. - Explain Jinja2?
  15. - Difference between GET and POST in login page where you use GET?
  16. - Which CSS you use ?
  17. - CSS priority (inline, internal, external) ?
  18. - Which CSS is more useful for large project?
  19. - how data come in html ?
  20. - How models and frontend and backend interact with each other?
  21. - Run your app than create a trek.
  22. - Search trek .
  23. - Add new column in search result (trek id).
Anonymous MAD1

She helped me whenever I got stuck. She did even not see my whole app itself. She just saw the admin dashboard and asked more questions from the code only.

Questions remembered
  1. - Explain the frameworks used
  2. - Explain what you've done
  3. - Explain the code structure
  4. - Show where you've used Jinja
  5. - What do you think is the advantage for using Jinja
  6. - Show the app.py slowly, Explain the database.
  7. - Why you have used SQLAlchemy and what it is?
  8. - I used unique constraint with table args, so she asked what it is and asked to explain it.
  9. - What is template inheritance? Show where you've done it.
  10. - Show the routes code and Explain the login route and register route.
  11. - Show the login.html and Explain how does it shift from one route to another, what happens in the route, ans it without seeing the route code, just explain it by seeing the login.html page itself.
  12. - How does the code go to the database when you enter the details in the form?
  13. - Run the code and show the app
  14. - (I have more sections in the admin dashboard so she asked me to enter details into each section)
  15. - How does blacklist button work and what happens to the drive created by those blacklisted companies?
  16. - Add a button near the drive name saying that the company is blacklisted in admin dashboard (I had a button near the company name which says that the company is blacklisted or not so she asked me to add a similar button in the ongoing drives section also)
Naveen MAD1

My whole viva ended in about half an hour and the examiner was not just asking questions but also guiding me through them as I fumbled.

My advice is don't take too much stress just know what your program is doing and why.

All the best.

Questions remembered
  1. Level 2 of MAD 1
  2. - First the ID and checksum were vertified
  3. - Then I was tasked to explain what frameworks, I have used.
  4. - Then I was asked to explain my database.
  5. - Then came questions regarding HTTP Codes and to explain some.
  6. - Then It was about explaining how my controller is working (I mean how routes are connected and function)
  7. - Then I was asked questions about the schema
  8. - Primary key
  9. - unique key
  10. - static method
  11. - relationship
  12. - use of commit
  13. Then I was tasked with running the app (it took a while)
  14. - Then I showed the updates of the page from the admin end.
  15. - Then I was tasked to set the frontend and backend validation
  16. - Use of get_or_404
Sheet response MAD1

Just have a strong grip on theory concepts.

Questions remembered
  1. Level 2 Viva
  2. She is a bit strict
  3. Ask more theory questions.
  4. Asked to do some changes in the code.
  5. Using paint, draw three circles and explain MVC.
  6. What is ORM, have you used.
  7. Is your database structure or not.
  8. Gone through my CSS and asked about various things I have used.
  9. HTTP methods.
  10. Overall she took only 30 mins, but was a bit strict in nature.

Approved viva sets

  1. 1
    first she asked to show the ID card. Before going to application walkthrough...she asked to explain the project structures, then asked...
    Times asked 2
  2. 2
    what is celery? what it does and why we need in this project.
    Times asked 2
  3. 3
    what is redis? what it does and why need of it.
    Times asked 1
  4. 4
    which db are you using? How sqlite and redis are different? then asked to go through with Models and asked: 4: what is to_dict() function in every table? what is the need of it? 5: what are other methods for serilizable data? then asked to show api's and asked: 6: what are the decorators? working and all. 7: how @admin_required working according to code which i had written? then send to go through with application. in mid she asked 8: to make the form validation while creating a new trek for prevention of negative inputs at last she just asked to show how celery is working and is user getting exported csv or not. and it's done!
    Times asked 1
Advice: she is very keen to know your theoretical knowledge. Prepare well.
  1. 1
    Diff btw redis and sqlite.
    Times asked 1
  2. 2
    Explain the database tables and their relationships.
    Times asked 1
  3. 3
    What are JWT tokens and where are they stored (client side or server side)? How
    Times asked 2
  4. 4
    What are other authentication methods besides JWT?
    Times asked 2
  5. 5
    What are alternatives to Local Storage for storing tokens (Sessions, Cookies)?
    Times asked 2
  6. 6
    Explain the complete flow of a user action with code.
    Times asked 2
  7. 7
    Explain a Vue component and how it is mapped to a URL.
    Times asked 2
  8. 8
    After showing a particular line of code, which line runs next?
    Times asked 2
  9. 9
    What happens if cascade="delete-orphan" is not used?
    Times asked 2
  10. 10
    Add a Confirm Password field to the registration form and prevent registration if the passwords do not match.
    Times asked 2
  11. 11
    Remove the id column from the exported CSV file.
    Times asked 2
Advice: She was asking questions throughout the code, often stopping at different lines and asking what happens next or how that part works. Know your code well.
  1. 1
    She asked first to explain the project structure where which file is there and which file do what..
    Times asked 2
  2. 2
    Then she asked to explain celery config
    Times asked 1
  3. 3
    Redis vs sqlite
    Times asked 2
  4. 4
    Then told to open models.py
    Times asked 2
  5. 5
    And asked about usermixin and role mixin classes
    Times asked 2
  6. 6
    Asked about significance of secondary="user_roles"
    Times asked 2
  7. 7
    Asked to explain components
    Times asked 2
  8. 8
    I explained admin component
    Times asked 2
  9. 9
    She asked how frontend backend gets connected and exchange and perform requests
    Times asked 2
  10. 10
    She asked where is this admin api is being called show me that
    Times asked 2
  11. 11
    Then told me to execute celery asynchronous jobs
    Times asked 2
  12. 12
    Asked to show the template of mail
    Times asked 2
  13. 13
    Asked about vbind vs vmodel
    Times asked 2
  14. 14
    Asked whether I did eligibility criteria in my application
    Times asked 2
  15. 15
    I did that
    Times asked 2
  16. 16
    But I had done like if company min criteria of year is 2 then only 2 nd year can apply not 3
    Times asked 2
  17. 17
    She told me to make changes so that both 2 and 3 can apply
    Times asked 2
  18. 18
    That's it
    Times asked 1
Advice: Just know your project code really well She will deep dive into that only And she is kind of unpredictable But she will definitely ask how you implemented your project and what you did
  1. 1
    Done with level 2 viva:
    Times asked 1
  2. 2
    -How have you approached the problem statement ?
    Times asked 2
  3. 3
    -show the component files & How does the program know where the components are stored?
    Times asked 2
  4. 4
    -looked at my code(a .js file) and asked 'what does this asyn function do here?
    Times asked 2
  5. 5
    -difference between Redis and celery ?
    Times asked 1
  6. 6
    -How is redis different from SQLlite DB? in terms of the way they store data.
    Times asked 2
  7. 7
    -Difference between v-if and v-show ? Where have you used them?
    Times asked 2
  8. 8
    -explain the data flow when a user tries to login
    Times asked 2
  9. 9
    *coding questions:*
    Times asked 2
  10. 10
    -implement a Custom alert message whenever you login into the admin dashboard.
    Times asked 2
  11. 11
    -remove a column from a student list table
    Times asked 2
Advice: She is calm, and patient. just asks a lot of questions. Be confident. PREPARE WELL, especially The theory.
  1. 1
    vif vshow
    Times asked 2
  2. 2
    write in vscode v-for
    Times asked 2
  3. 3
    about emit props
    Times asked 2
  4. 4
    show routes and vue files
    Times asked 2
Advice: examiner lets you take time to setup. Chill ,
  1. 1
    Done with viva2 level1_139
    Times asked 2
  2. 2
    she didn't see demo or anything.
    Times asked 2
  3. 3
    directly told to run everything and then show the files in vs code
    Times asked 2
  4. 4
    firstly asked what is the structure you followed
    Times asked 2
  5. 5
    then asked to show redis and celery configurations, explain what is redis, diff between broker url and result backend and what do they do
    Times asked 2
  6. 6
    what are props and where have you used them
    Times asked 2
  7. 7
    async await and what is the use of them, what does an async function return
    Times asked 2
  8. 8
    why have you not used .then or anything
    Times asked 2
  9. 9
    what are jwt tokens and where are you storing them, also what's the diff between session based and token based security
    Times asked 2
  10. 10
    explain models and all the relationships
    Times asked 2
  11. 11
    have you used joins on table in any api to get the data
    Times asked 2
  12. 12
    have you handled if someone enters a negative pricing (I had not) so asked to do that
    Times asked 2
  13. 13
    how are you handling success and error messages, also made me change some of them
    Times asked 2
  14. 14
    man in the middle or SQL injection or any of the attacks do you know? explain.
    Times asked 2
  15. 15
    that's all I remember.
    Times asked 2
Advice: she is calm and composed and gives time to think about answer or for changing anything in the code. but know your code very well because she asks most of the things after seeing your code and based on how you have implemented stuff
  1. 1
    Asked allot of questions
    Times asked 2
  2. 2
    >RBAC
    Times asked 2
  3. 3
    >Compment (what this is)
    Times asked 2
  4. 4
    >Functionalities
    Times asked 2
  5. 5
    >Show me celery and redis configuration
    Times asked 2
  6. 6
    >Demonstate mails coming
    Times asked 2
  7. 7
    >Explanation of some frontend code
    Times asked 2
  8. 8
    >Caching
    Times asked 2
  9. 9
    >Lot should not get deleted when some spot booked functionality
    Times asked 2
  10. 10
    >model relationship one to one, many to one
    Times asked 2
  11. 11
    >Explain life cycle hook
    Times asked 2
  12. 12
    Mam was co-operative and calm in nature. Just be confident.
    Times asked 2
  1. 1
    * No demo
    Times asked 2
  2. 2
    * Start redis,app, celery,beat
    Times asked 2
  3. 3
    * api, broker, result,what redis, explain models 1-1,1-2 relationship db.relationship
    Times asked 2
  4. 4
    * Difference between cycle hooks
    Times asked 2
  5. 5
    * authentication Authorization working
    Times asked 2
  6. 6
    * Watch in vue
    Times asked 2
  7. 7
    * fetch call explain
    Times asked 2
  8. 8
    * Show frontend asked some questions
    Times asked 2
  9. 9
    * Then some codes change in beat n js
    Times asked 2
  10. 10
    * B bind apply
    Times asked 2
  11. 11
    * Const var let
    Times asked 2
  12. 12
    * Make Component and reuse into another component
    Times asked 2
  13. 13
    * make pincode that accept number digit only if user enters string it should show no strings allowed for pincode
    Times asked 2
  14. 14
    * Celery beat time change this day at that time
    Times asked 2
  15. 15
    48 min asks lot of questions
    Times asked 2
Advice: Understanding
  1. 1
    I'd card
    Times asked 1
    Official solution

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

  2. 2
    Project download Explain the frameworks used
    Times asked 1
    Official solution

    SimpleStack bolo: Python, Flask, Jinja2, SQLAlchemy, SQLite, HTML/CSS/Bootstrap, maybe Chart.js.

Advice: she is calm and patient, mostly she will ask to explain code and theory but she tells you to make some changes it code and add more funtionality so be ready for it, i was really stressed and scared but you should control yourself, anyway she's good
  1. 1
    - show your id card.
    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
    - what is your app do explain your app and idea behind it.
    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
    - Relationship of tables.
    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
    - What is lazy?
    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
    - How you make one-one and one-to-many relationship?
    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')
  6. 6
    - What is CRUD, Show in your code where you use it ?
    Times asked 1
    Official solution

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

  7. 7
    - Explain Vertical and horizontal Scaling.
    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
    - Explain any route / How admin login and go to dashboard?
    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.

  9. 9
    - Your project has dynamic or static 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.

  10. 10
    - Difference between GET and POST in login page where you use GET?
    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')
  11. 11
    - Which CSS you use ?
    Times asked 1
    Official solution

    SimpleCSS page ko style karti hai — color, layout, font. HTML structure, CSS look.

    h1 { color: navy; } .card { padding: 16px; } #logo { width: 80px; }
    Selectors: element (h3), class (.btn), id (#nav), pseudo (:hover).
    display:flex — ek line/row mein items, justify-content/align-items se center.
    Multiple classes: saari apply, conflict pe specificity/order.
    Responsive: media queries / Bootstrap grid. Bina CSS limited (old tables) — practically CSS chahiye.

  12. 12
    - Which CSS is more useful for large project?
    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.

  13. 13
    - how data come in html ?
    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.

  14. 14
    - How models and frontend and backend interact with each other?
    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)
  15. 15
    - Run your app than create a trek.
    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
  16. 16
    - Search trek .
    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()
Advice: She is good and supportive when you stop answering than she help you by giving some concept hint. Go through your code's and you must know each functions ; )
  1. 1
    - Explain what you've done
    Times asked 1
    Official solution

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

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

  2. 2
    - Show where you've used Jinja
    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 %}
  3. 3
    - What do you think is the advantage for using Jinja
    Times asked 1
    Official solution

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

    Example

    {% for u in users %}
      <tr><td>{{ loop.index }}</td><td>{{ u.email }}</td></tr>
    {% endfor %}
  4. 4
    - Show the app.py slowly, Explain 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.

  5. 5
    - I used unique constraint with table args, so she asked what it is and asked to explain it.
    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
    - What is template inheritance? Show where you've done 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 %}
  7. 7
    - Show the routes code and Explain the login route and register route.
    Times asked 1
    Official solution

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

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

  8. 8
    - Show the login.html and Explain how does it shift from one route to another, what happens in the route, ans it without seeing the route code, just explain it by seeing the login.html page itself.
    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.

  9. 9
    - How does the code go to the database when you enter the details in the 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
  10. 10
    - (I have more sections in the admin dashboard so she asked me to enter details into each section)
    Times asked 1
    Official solution

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

  11. 11
    - How does blacklist button work and what happens to the drive created by those blacklisted companies?
    Times asked 1
    Official solution

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

  12. 12
    - Add a button near the drive name saying that the company is blacklisted in admin dashboard (I had a button near the company name which says that the company is blacklisted or not so she asked me to add a similar button in the ongoing drives section also)
    Times asked 1
    Official solution

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

Advice: She helped me whenever I got stuck. She did even not see my whole app itself. She just saw the admin dashboard and asked more questions from the code only.
  1. 1
    Level 2 of MAD 1
    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
    - First the ID and checksum were vertified
    Times asked 1
    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.

  3. 3
    - Then I was tasked to explain what frameworks, I have used.
    Times asked 1
    Official solution

    SimpleStack bolo: Python, Flask, Jinja2, SQLAlchemy, SQLite, HTML/CSS/Bootstrap, maybe Chart.js.

  4. 4
    - Then I was asked to explain my database.
    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
    - Then came questions regarding HTTP Codes and to explain some.
    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
    - Then It was about explaining how my controller is working (I mean how routes are connected and function)
    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
    - Then I was asked questions about the schema
    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
    - static method
    Times asked 1
    Official solution

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

  9. 9
    - use of commit
    Times asked 1
    Official solution

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

    Example

    try:
        db.session.add(obj)
        db.session.commit()
    except Exception:
        db.session.rollback()
        raise
  10. 10
    Then I was tasked with running the app (it took a while)
    Times asked 1
    Official solution

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

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

    Example

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

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

  11. 11
    - Then I showed the updates of the page from the admin end.
    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
    - Then I was tasked to set the frontend and backend validation
    Times asked 1
    Official solution

    SimpleValidation = input rules: required, email format, length, unique. Frontend UX, backend security — dono.

    Example

    if not email or '@' not in email:
        flash('Invalid email')
        return redirect(request.url)
    if User.query.filter_by(email=email).first():
        flash('Email taken')
  13. 13
    - Use of get_or_404
    Times asked 1
    Official solution

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

Advice: My whole viva ended in about half an hour and the examiner was not just asking questions but also guiding me through them as I fumbled. My advice is don't take too much stress just know what your program is doing and why. All the best.
  1. 1
    She is a bit strict
    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
    Ask more theory questions.
    Times asked 1
    Official solution

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

  3. 3
    Asked to do some changes in the code.
    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
    Using paint, draw three circles and explain MVC.
    Times asked 1
    Official solution

    SimpleMVC: Model=data (SQLAlchemy), View=Jinja HTML, Controller=Flask routes/business logic.

    Flask loosely MVC follow karta hai — routes controllers, templates views, models.py models.

  5. 5
    What is ORM, have you used.
    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
  6. 6
    Is your database structure or not.
    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
    Gone through my CSS and asked about various things I have used.
    Times asked 1
    Official solution

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

Advice: Just have a strong grip on theory concepts.
  1. 1
    first she asked to show the ID card. Before going to application walkthrough...she asked to explain the project structures, then asked...
    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.

  2. 2
    what is celery? what it does and why we need in this project.
    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.

Advice: she is very keen to know your theoretical knowledge. Prepare well.
  1. 1
    What are JWT tokens and where are they stored (client side or server side)? How
    Times asked 2
    Official solution

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

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

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

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

    Example

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

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

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

  2. 2
    What are other authentication methods besides JWT?
    Times asked 2
    Official solution

    SimpleAuthentication: tu kaun hai? (login). Authorization: tujhe permission hai? (role check).

    Example

    # auth
    if check_password_hash(user.password, pwd):
        session['user_id'] = user.id
    
    # authz
    if user.role != 'admin':
        abort(403)
  3. 3
    What are alternatives to Local Storage for storing tokens (Sessions, Cookies)?
    Times asked 2
    Official solution

    SimpleMAD1 mein usually session-based auth: login pe session['user_id'], har request pe verify.

    Example

    session['user_id'] = user.id
    uid = session.get('user_id')
    user = User.query.get(uid)

    Viva tipSECRET_KEY set karo warna session insecure. logout pe session.clear().

  4. 4
    Explain the complete flow of a user action with code.
    Times asked 2
    Official solution

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

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

  5. 5
    Explain a Vue component and how it is mapped to a URL.
    Times asked 2
    Official solution

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

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

  6. 6
    After showing a particular line of code, which line runs next?
    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.

  7. 7
    What happens if cascade="delete-orphan" is not used?
    Times asked 2
    Official solution

    SimpleCascade parent delete pe children pe kya ho: delete-orphan related rows hata deta hai.

    Example

    db.relationship('Spot', cascade='all, delete-orphan')

    Viva tipParking lot delete → uske spots/bookings policy clear bolo.

  8. 8
    Add a Confirm Password field to the registration form and prevent registration if the passwords do not match.
    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
  9. 9
    Remove the id column from the exported CSV file.
    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.

Advice: She was asking questions throughout the code, often stopping at different lines and asking what happens next or how that part works. Know your code well.
  1. 1
    Level 2 viva
    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
    She asked first to explain the project structure where which file is there and which file do what..
    Times asked 2
    Official solution

    Simplebackend create_app models api jobs. frontend src router. config env. README.

    Don't read every file. 6 roles.

    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: tree command or VSCode explorer.

  3. 3
    Redis vs sqlite
    Times asked 2
    Official solution

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

    Example

    SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
  4. 4
    Then told to open models.py
    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)
  5. 5
    And asked about usermixin and role mixin classes
    Times asked 2
    Official solution

    SimpleUserMixin RoleMixin Flask-Security interfaces: is_authenticated, roles relation.

    Methods milte. Models inherit.

    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: class User(db.Model, UserMixin).

  6. 6
    Asked about significance of secondary="user_roles"
    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.

  7. 7
    Asked to explain components
    Times asked 2
    Official solution

    SimpleVue.js frontend framework — reactive UI components. MAD2 mein common, MAD1 optional.

    Component: reusable UI (Navbar.vue) + data + template.
    Props: parent → child data. Child → parent: $emit('update', val).
    Slots: parent child ke andar extra HTML daal sakta hai.
    Lifecycle: created (data setup), mounted (DOM ready — API call), updated, unmounted.
    v-model two-way bind. Vue Router SPA routes (routes.js). Vuex/Pinia global state; mutations sync change, actions async.
    Standalone component: khud ke saath compile, parent register kam.

  8. 8
    I explained admin component
    Times asked 2
    Official solution

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

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

  9. 9
    She asked how frontend backend gets connected and exchange and perform requests
    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
  10. 10
    She asked where is this admin api is being called show me that
    Times asked 2
    Official solution

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

  11. 11
    Then told me to execute celery asynchronous jobs
    Times asked 2
    Official solution

    SimpleSync line pe ruk jao (2+2). Async I/O pe wait karte hue baaki kaam chalte (fetch, Celery).

    JS async ≠ Celery async jobs. Context se bolo.

    Why async jobs: slow/scheduled/bulk off request thread.

    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: Login sync hash check fast. Email Celery async. Vue fetch async.

  12. 12
    Asked to show the template of mail
    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.

  13. 13
    Asked about vbind vs vmodel
    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)
  14. 14
    Asked whether I did eligibility criteria in my application
    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.

  15. 15
    I did that
    Times asked 2
    Official solution

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

  16. 16
    But I had done like if company min criteria of year is 2 then only 2 nd year can apply not 3
    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.

  17. 17
    She told me to make changes so that both 2 and 3 can apply
    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.

Advice: Just know your project code really well She will deep dive into that only And she is kind of unpredictable But she will definitely ask how you implemented your project and what you did
  1. 1
    -How have you approached the problem statement ?
    Times asked 2
    Official solution

    SimpleApproach: requirements → roles/entities → ER → routes → templates → validate → demo edge cases.

  2. 2
    -show the component files & How does the program know where the components are stored?
    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
    -looked at my code(a .js file) and asked 'what does this asyn function do here?
    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'
  4. 4
    -How is redis different from SQLlite DB? in terms of the way they store data.
    Times asked 2
    Official solution

    Simpledata() local diary. Store school notice board.

    Search query local. Logged-in user store. Persist: store + localStorage together.

    state vs data: similar concept, scope alag.

    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

    // local
    data() { return { q: '' } }
    // global
    this.$store.state.user

    Project example: Login.vue local form fields. this.$store.state.user Navbar.

  5. 5
    -Difference between v-if and v-show ? Where have you used them?
    Times asked 2
    Official solution

    Simplev-if ghar se nikaal deta hai (DOM se). v-show sirf light band karta hai (display:none).

    v-if false → element exist hi nahi — costly create/destroy, lekin secret HTML DOM mein nahi.
    v-show → hamesha DOM, CSS hide, toggle tez.

    Rare / permission UI: v-if (admin panel). Dropdown bar-bar: v-show.

    : shorthand v-bind ka, v-if ka nahi.

    Example

    <div v-if="isAdmin">Admin panel</div>
    <div v-show="open">Dropdown</div>

    Project example: Admin links v-if="role==='admin'". FAQ accordion v-show="open".

    Viva tipSecurity ke liye sirf v-if kaafi nahi — API 403 bhi chahiye.

  6. 6
    -explain the data flow when a user tries to login
    Times asked 2
    Official solution

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

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

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

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

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

    Example

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

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

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

  7. 7
    *coding questions:*
    Times asked 2
    Official solution

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

  8. 8
    -implement a Custom alert message whenever you login into the admin dashboard.
    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.

  9. 9
    -remove a column from a student list table
    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.

Advice: She is calm, and patient. just asks a lot of questions. Be confident. PREPARE WELL, especially The theory.
  1. 1
    vif vshow
    Times asked 2
    Official solution

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

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

  2. 2
    write in vscode v-for
    Times asked 2
    Official solution

    SimpleVue live: two inputs v-model, button @click se first+last concat karke dikhao.

    Example

    <input v-model="first" /><input v-model="last" />
    <button @click="full = first + ' ' + last">Go</button>
    <p>{{ full }}</p>
  3. 3
    about emit props
    Times asked 2
    Official solution

    SimpleProps parent→child values. Emit child→parent signal. Basic communication.

    Difference props and emit.

    Component = reusable UI block (Navbar, Card). Props parent→child data, emit child→parent event. Slots parent HTML inner content.

    computed cache + reactive derive (filtered list). watch side-effect (query change pe API). methods events. ref() primitive, reactive() object. Vuex/Pinia global store; localStorage persist, store nahi.

    SFC: template + script + style ek .vue file. Parent-child exam favourite: list parent, row child :item + @delete.

    Project example: Card props venue emit select.

  4. 4
    show routes and vue files
    Times asked 2
    Official solution

    SimpleRoute URL ko Python function se map karta hai. Decorator @app.route ya blueprint.route.

    Example

    @app.route('/lots', methods=['GET', 'POST'])
    def lots():
        if request.method == 'POST':
            ...
        return render_template('lots.html', lots=Lot.query.all())
Advice: examiner lets you take time to setup. Chill ,
  1. 1
    Done with viva2 level1_139
    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
    she didn't see demo or anything.
    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
    directly told to run everything and then show the files in vs code
    Times asked 2
    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.

  4. 4
    firstly asked what is the structure you followed
    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
    then asked to show redis and celery configurations, explain what is redis, diff between broker url and result backend and what do they do
    Times asked 2
    Official solution

    SimpleRedis box hai, Celery us box se kaam uthane wala worker hai — same cheez nahi.

    Redis: store (cache keys) + queue (broker lists).
    Celery: Python library jo tasks define karti hai, .delay() se queue mein daalti hai, worker execute karta hai.

    Dono localhost pe ho sakte hain. Alag Redis DB index use karo. Redis band = cache miss + Celery stuck.

    Example

    Celery: broker_url='redis://localhost:6379/0'
    Cache:  CACHE_REDIS_URL='redis://localhost:6379/1'

    Project example: export_csv.delay(user_id) Flask se. Worker Redis se task uthata hai, CSV+email. Cache alag keys venues.

    Viva tipAgar possible ho to cache db=1, broker db=0 — keys mix nahi hoti.

  6. 6
    what are props and where have you used them
    Times asked 2
    Official solution

    SimpleProps parent ki thali child ko dena. Child thali tod ke parent ki thali na badle — emit bolo.

    Declare props, parent :venue="v". One-way. Mutate mat. Types/required Vue 3.

    List parent, card child — classic viva.

    Component = reusable UI block (Navbar, Card). Props parent→child data, emit child→parent event. Slots parent HTML inner content.

    computed cache + reactive derive (filtered list). watch side-effect (query change pe API). methods events. ref() primitive, reactive() object. Vuex/Pinia global store; localStorage persist, store nahi.

    SFC: template + script + style ek .vue file. Parent-child exam favourite: list parent, row child :item + @delete.

    Example

    <VenueCard :venue="v" @select="onSelect" />
    props: ['venue']
    this.$emit('select', this.venue.id)

    Project example: VenueCard :venue. Child $emit('select', id).

  7. 7
    async await and what is the use of them, what does an async function return
    Times asked 2
    Official solution

    SimpleAlways a Promise.

    Even return 5.

    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: Don't console.log(asyncFn()) expecting 5 without await.

    Project example: Don't console.log(asyncFn()) expecting 5 without await.

  8. 8
    why have you not used .then or anything
    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.

  9. 9
    what are jwt tokens and where are you storing them, also what's the diff between session based and token based security
    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().

  10. 10
    explain models and all the relationships
    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)
  11. 11
    have you used joins on table in any api to get the data
    Times asked 2
    Official solution

    SimpleJOIN related tables ek result mein. Inner = match only; left = left side sab + match.

    Example

    db.session.query(Booking, User).join(User).filter(User.id == uid).all()
  12. 12
    have you handled if someone enters a negative pricing (I had not) so asked to do that
    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.

  13. 13
    how are you handling success and error messages, also made me change some of them
    Times asked 2
    Official solution

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

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

  14. 14
    man in the middle or SQL injection or any of the attacks do you know? explain.
    Times asked 2
    Official solution

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

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

  15. 15
    that's all I remember.
    Times asked 2
    Official solution

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

Advice: she is calm and composed and gives time to think about answer or for changing anything in the code. but know your code very well because she asks most of the things after seeing your code and based on how you have implemented stuff
  1. 1
    Asked allot of questions
    Times asked 2
    Official solution

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

  2. 2
    >RBAC
    Times asked 2
    Official solution

    SimpleRBAC = Role Based Access Control. Roles (admin/user) se permissions milti hain, har user pe alag list nahi.

    Example

    if current_user.role != 'admin':
        flash('Not allowed')
        return redirect(url_for('user.home'))
  3. 3
    >Compment (what this is)
    Times asked 2
    Official solution

    SimpleComponent = reusable UI piece (navbar, card, form). Props in, events out. Vue SFC ya Jinja macros/includes.

    Viva tipParent-child: props down, emit/$emit up.

  4. 4
    >Functionalities
    Times asked 2
    Official solution

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

  5. 5
    >Show me celery and redis configuration
    Times asked 2
    Official solution

    SimpleRedis box hai, Celery us box se kaam uthane wala worker hai — same cheez nahi.

    Redis: store (cache keys) + queue (broker lists).
    Celery: Python library jo tasks define karti hai, .delay() se queue mein daalti hai, worker execute karta hai.

    Dono localhost pe ho sakte hain. Alag Redis DB index use karo. Redis band = cache miss + Celery stuck.

    Example

    Celery: broker_url='redis://localhost:6379/0'
    Cache:  CACHE_REDIS_URL='redis://localhost:6379/1'

    Project example: export_csv.delay(user_id) Flask se. Worker Redis se task uthata hai, CSV+email. Cache alag keys venues.

    Viva tipAgar possible ho to cache db=1, broker db=0 — keys mix nahi hoti.

  6. 6
    >Demonstate mails coming
    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.

  7. 7
    >Explanation of some frontend code
    Times asked 2
    Official solution

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

  8. 8
    >Caching
    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.

  9. 9
    >Lot should not get deleted when some spot booked functionality
    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.

  10. 10
    >model relationship one to one, many to one
    Times asked 2
    Official solution

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

    Example

    spots = db.relationship('Spot', backref='lot', cascade='all, delete-orphan')
  11. 11
    >Explain life cycle hook
    Times asked 2
    Official solution

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

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

  12. 12
    Mam was co-operative and calm in nature. Just be confident.
    Times asked 2
    Official solution

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

  1. 1
    * No 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.

  2. 2
    * Start redis,app, celery,beat
    Times asked 2
    Official solution

    SimpleRedis box hai, Celery us box se kaam uthane wala worker hai — same cheez nahi.

    Redis: store (cache keys) + queue (broker lists).
    Celery: Python library jo tasks define karti hai, .delay() se queue mein daalti hai, worker execute karta hai.

    Dono localhost pe ho sakte hain. Alag Redis DB index use karo. Redis band = cache miss + Celery stuck.

    Example

    Celery: broker_url='redis://localhost:6379/0'
    Cache:  CACHE_REDIS_URL='redis://localhost:6379/1'

    Project example: export_csv.delay(user_id) Flask se. Worker Redis se task uthata hai, CSV+email. Cache alag keys venues.

    Viva tipAgar possible ho to cache db=1, broker db=0 — keys mix nahi hoti.

  3. 3
    * api, broker, result,what redis, explain models 1-1,1-2 relationship db.relationship
    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)
  4. 4
    * Difference between cycle hooks
    Times asked 2
    Official solution

    SimpleLifecycle hooks = component stages (created/mounted/updated/unmounted). Data fetch usually mounted/onMounted.

  5. 5
    * authentication Authorization working
    Times asked 2
    Official solution

    SimpleAuthentication: tu kaun hai? (login). Authorization: tujhe permission hai? (role check).

    Example

    # auth
    if check_password_hash(user.password, pwd):
        session['user_id'] = user.id
    
    # authz
    if user.role != 'admin':
        abort(403)
  6. 6
    * Watch in vue
    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.

  7. 7
    * fetch call explain
    Times asked 2
    Official solution

    SimpleAxios JS HTTP client — fetch ka convenient wrapper. Promises, JSON auto, interceptors.

    Example

    axios.get('/api/lots', { headers: { Authorization: 'Bearer ' + token } })
      .then(res => console.log(res.data))
  8. 8
    * Show frontend asked some questions
    Times asked 2
    Official solution

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

  9. 9
    * Then some codes change in beat n js
    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.

  10. 10
    * B bind apply
    Times asked 2
    Official solution

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

  11. 11
    * Const var let
    Times asked 2
    Official solution

    Simplevar old function-scope, let block-scope changeable, const block-scope reassign nahi.

    var x = 1; // hoisted, function scoped — avoid
    let count = 0; count = 1; // theek
    const PI = 3.14; // reassign error, object ke andar field change ho sakti hai
    Modern JS: let/const use karo, var mat karo.

  12. 12
    * Make Component and reuse into another component
    Times asked 2
    Official solution

    SimpleComponent = reusable UI piece (navbar, card, form). Props in, events out. Vue SFC ya Jinja macros/includes.

    Viva tipParent-child: props down, emit/$emit up.

  13. 13
    * make pincode that accept number digit only if user enters string it should show no strings allowed for pincode
    Times asked 2
    Official solution

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

  14. 14
    * Celery beat time change this day at that 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.

  15. 15
    48 min asks lot of questions
    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: Understanding
  1. 1
    Show ID card, GitHub collaborator, download/checksum, run the project.
    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
    Explain your project, its purpose, core features, and demonstrate the application.
    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 overall project/code structure.
    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.

  4. 4
    Explain MVC (draw it using Paint if asked).
    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.

  5. 5
    Explain how Models, Routes (Controllers), and Templates (Views) interact.
    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.

  6. 6
    Explain how data flows from the database to the HTML.
    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().

  7. 7
    Explain any route (e.g., create_trek) and the Admin login/dashboard flow.
    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.

  8. 8
    Explain CRUD operations and show where they are implemented.
    Times asked 1
    Official solution

    SimpleCRUD = Create, Read, Update, Delete — kisi bhi resource ke 4 basic operations.

    Create: POST, db.session.add(new_user); commit() — register, add trek.
    Read: GET, User.query.all() — dashboard list.
    Update: POST/PUT, user.name = 'Ram'; commit() — edit profile.

    DeletePOST/DELETE, db.session.delete(obj); commit().

    REST mapping: POST create, GET read, PUT/PATCH update, DELETE delete.
    Admin panel mein yeh 4 dikhana viva demo ka common task hai.

  9. 9
    Explain your database schema and models.py.
    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.

  10. 10
    Explain relationships between tables. One-to-One One-to-Many Where these relationships are defined.
    Times asked 1
    Official solution

    SimpleRelationships tables ko jodti hain taaki related data object se mil jaaye.

    One-to-Many: User → kai Posts. posts = relationship('Post', backref='author'). FK post.user_id.
    One-to-One: User → Profile. uselist=False + unique FK. Profile.user_id unique.
    Many-to-Many: Student ↔ Drive. Junction/secondary table (student_id, drive_id).

    Example 1-1:

    class Profile(db.Model):
        user_id = db.Column(db.Integer, db.ForeignKey('user.id'), unique=True)
        user = db.relationship('User', back_populates='profile', uselist=False)

    1-M ko 1-1: child FK pe unique=True + uselist=False.
    Parent-child: parent PK, child FK. Junction table extra columns bhi rakh sakti hai (applied_on).

  11. 11
    Explain: Primary Key Unique Key ORM lazy commit() get_or_404()
    Times asked 1
    Official solution

    SimplePrimary Key table ki main identity hai (ek hi), Unique Key extra unique column ho sakta hai (kai).

    PK: NOT NULL + UNIQUE, sirf ek clustered identity. Example: id
    Unique: duplicate nahi, lekin NULL allow ho sakta hai. Example: email, username

    UNIQUE + NOT NULL + AUTO_INCREMENT PK jaisa behave karta hai, lekin table ki official PK nahi. Relationships/FK generally PK ko refer karti hain.
    Isliye alag Primary Key rakhna better hai.

  12. 12
    Explain HTTP Methods and HTTP Status Codes. Difference between GET and POST.
    Times asked 1
    Official solution

    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.

  13. 13
    Why is GET used where it is (e.g., login page)?
    Times asked 1
    Official solution

    Definition style question: 1 line simple Hinglish + project example + mini code.

    Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'

    Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'

    Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example do.

  14. 14
    Explain Jinja2.Explain Template Inheritance and where you've used it. Explain your HTML templates.
    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.


    SimpleJinja2 Flask ka template engine hai. HTML ke andar Python-jaisa data print/loop/if kar sakte ho.

    Bina Jinja har user ke liye alag HTML file. Jinja se ek template + data.

    {{ user.name }} print, {% for x in items %} loop, {% if %} condition, {% extends %} layout.

    Example routereturn render_template('dash.html', treks=treks)

    dash.html: {% for t in treks %}<li>{{ t.name }}</li>{% endfor %}

    HTML files templates/ folder mein isliye kyunki Flask default wahan dhundhta hai. render_template Jinja ko run karta hai.
    Boolean Jinja handle karta hai: {% if user.is_admin %}.

  15. 15
    Explain CSS used in your project. CSS Priority (Inline > Internal > External).
    Times asked 1
    Official solution

    SimpleCSS 3 tarikon se lagti hai, priority Inline > Internal > External (same specificity pe).

    Inline: style='color:red' element pe. Highest priority, lekin reuse nahi. Debugging mushkil.
    Internal: <style> tag HTML head mein. Us page tak limited.
    External: style.css file. Large project ke liye best — ek jagah change, saari pages update.

    Example same button pe teeno:
    /* external */ .btn { color: blue; }
    /* internal */ .btn { color: green; }
    <!-- inline --> <button class='btn' style='color:red'> → red jeetega

    ID (#box) class (.btn) se strong, class element (button) se strong.
    !important sabko override karta hai — avoid karo.
    Large project: external CSS preferred.

  16. 16
    Which CSS approach is preferred for large projects?
    Times asked 1
    Official solution

    SimpleCSS page ko style karti hai — color, layout, font. HTML structure, CSS look.

    h1 { color: navy; } .card { padding: 16px; } #logo { width: 80px; }
    Selectors: element (h3), class (.btn), id (#nav), pseudo (:hover).
    display:flex — ek line/row mein items, justify-content/align-items se center.
    Multiple classes: saari apply, conflict pe specificity/order.
    Responsive: media queries / Bootstrap grid. Bina CSS limited (old tables) — practically CSS chahiye.

  17. 17
    What is Scaling?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.

  18. 18
    Add frontend and backend validation. Add an Age field to the registration page. Validate that 18 ≤ Age < 100.
    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.


    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.

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