Viva prep · Real questions · Student experiences Enroll in Bootcamp

Proctor workspace

Proctor Level2_86

Share your experience Add your viva experience here
222 Questions
30 Sets
0 Topics
2 Reviews
Tips for this examiner: Just know your code better , and relax . If you don't anything he will tell you and explain .

Student reviews

Karthik Reddy MAD1

Shared viva questions from response sheet: Very good proctor; Asked Demo of the app; Show models and explain

Questions remembered
  1. Very good proctor
  2. Asked Demo of the app
  3. Show models and explain
  4. why you are using fs_uniquifier
  5. How RBAC implemented
  6. Explain redis and how you implemented
  7. Explain celery and how you implemented
  8. caching
  9. Explain props in vue
  10. Different Lifecycle hooks in vue
  11. show job Scheduling report
  12. no code changes were asked
Paul Binu MAD1

Shared viva questions from response sheet: chill proctor, went over library management project demo, explained vue component and backend route, showed backend jobs; what is vue, why do we use vue; what are the different lifecycle hooks in vue

Questions remembered
  1. chill proctor, went over library management project demo, explained vue component and backend route, showed backend jobs
  2. what is vue, why do we use vue
  3. what are the different lifecycle hooks in vue
  4. whats the advantages of using relational databases
  5. what is API
  6. all over in 20 mins (no coding changes asked)

Approved viva sets

  1. 1
    very chill guy finished viva in 40 mins.
    Times asked 1
  2. 2
    DEMO(FULL)
    Times asked 2
  3. 3
    Asked me to show controllers and models
    Times asked 2
  4. 4
    If 1 million patients are present in ur application. and u have to send midnight reminders in 15 mins how would u scale.
    Times asked 2
  5. 5
    What is decorators. why not just use a function instead.
    Times asked 2
  6. 6
    Steps to create a new route in frontend.
    Times asked 2
  7. 7
    Do you know about child routes and parent routes?
    Times asked 2
  8. 8
    why have you used joinedload.
    Times asked 2
  9. 9
    Where should u use joinedload (N+1 query problem).
    Times asked 2
Advice: Very chill guy. Dont piss him off by bluffing.
  1. 1
    Demo of the whole application
    Times asked 2
  2. 2
    How do you delete the cache? Show me
    Times asked 2
Advice: Make sure to explain the demo clearly and confidently. He is a very chill proctor. Refer to the previous responses — it was the same.
  1. 1
    Show backend jobs
    Times asked 2
  2. 2
    what database used (SQLite and Redis),
    Times asked 2
  3. 3
    what is RDBMS (Uses structured tables and defines relations between the tables).
    Times asked 2
  4. 4
    That's it!
    Times asked 2
Advice: Very good proctor, checks theory
  1. 1
    show me the demo
    Times asked 2
  2. 2
    show me the celery part you implemented
    Times asked 1
  3. 3
    and show me the emails you sent
    Times asked 1
  4. 4
    ask questions:
    Times asked 2
  5. 5
    what is celery
    Times asked 3
  6. 6
    what is no sql
    Times asked 2
Advice: if you get this proctor then you are lucky , he so calm , the viva goes around 20-25 minutes only
  1. 1
    Level-2
    Times asked 3
  2. 2
    Id card
    Times asked 8
  3. 3
    Tell me how you implemented celery
    Times asked 1
  4. 4
    Which database are you using in this project
    Times asked 2
  5. 5
    Show me your code of models.py and explain the which all columns you have.
    Times asked 1
  6. 6
    Tell me about Nosql databases
    Times asked 2
  7. 7
    Database index
    Times asked 2
Advice: If you get this proctor you are very lucky, i think he is the best proctor, viva ended in 20-25 mins, no code changes, he is very patient, very easy viva, also refer to other responses of this proctor.
  1. 1
    - The examiner joined late.
    Times asked 2
  2. 2
    - Explained the entire app with all features, and this took 20 minutes.
    Times asked 2
  3. 3
    - What is hashing.?
    Times asked 2
Advice: No coding-related questions were asked of me , but I explained everything with confidence.
  1. 1
    He joined 5 min late, yet the viva ending within 20 mins
    Times asked 2
  2. 2
    No coding questions asked
    Times asked 4
  1. 1
    exact same questions as mentioned in the other entries for this proctor
    Times asked 2
  2. 2
    very chill dude
    Times asked 2
  3. 3
    did not ask me to code anything at all
    Times asked 2
  4. 4
    he joined 7 mins late, yet the viva was completed by the 25 min mark, meaning it only lasted 18 mins
    Times asked 2
Advice: just do the questions mentioned by others for level2_86 or l2_86
  1. 1
    Forgot to mention also saw how emails were getting sent through SMTP
    Times asked 2
  2. 2
    how I was exporting CSV in user part
    Times asked 2
  3. 3
    and how daily reminders and monthly reports were generated and in which format
    Times asked 2
  1. 1
    Minor code change to change crontab to 1 min and nothing else
    Times asked 2
Advice: Although I was given some other examiner but he was not available so lvl2_86 examiner joined at 12:30 and VIVA went on for 30 min. Checked all the features Very calm, polite, friendly and knowledgeable examiner Gives you time to think for the answer and also if any issues come up Just practice the questions in this sheet and that would be enough for all the VIVAs you are going to attend. Also said you have made very good project and your theory is also good. Wished All The Best at the end and cleared some of the queries I had
  1. 1
    Very good proctor
    Times asked 2
  2. 2
    Asked Demo of the app
    Times asked 3
  3. 3
    Explain celery and how you implemented
    Times asked 2
  4. 4
    Explain props in vue
    Times asked 3
  5. 5
    no code changes were asked
    Times asked 3
  1. 1
    Jwt token , validity and its expiry ?
    Times asked 2
  2. 2
    Is you application scalable ? If yes , How ?
    Times asked 2
Advice: Just know your code better , and relax . If you don't anything he will tell you and explain .
  1. 1
    chill proctor, went over library management project demo, explained vue component and backend route, showed backend jobs
    Times asked 2
  2. 2
    what is vue, why do we use vue
    Times asked 2
  3. 3
    what are the different lifecycle hooks in vue
    Times asked 2
  4. 4
    whats the advantages of using relational databases
    Times asked 2
  5. 5
    what is API
    Times asked 3
  6. 6
    all over in 20 mins (no coding changes asked)
    Times asked 2
  1. 1
    what are lifecycle hooks? explain a few of them
    Times asked 2
  2. 2
    explain celery w.r.t your code
    Times asked 2
  3. 3
    how are you doing RBAC?
    Times asked 2
  4. 4
    how are you doing authentication for a route, explain in code (wanted to see how the login_required decorator works)
    Times asked 1
  1. 1
    DEMO(FULL)
    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
    Asked me to show controllers and models
    Times asked 2
    Official solution

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

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

    Example

    class Lot(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        name = db.Column(db.String(80), nullable=False)
        spots = db.relationship('Spot', backref='lot', lazy=True)
  3. 3
    How many celery jobs do u have.
    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
    If 1 million patients are present in ur application. and u have to send midnight reminders in 15 mins how would u scale.
    Times asked 2
    Official solution

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

  5. 5
    What is decorators. why not just use a function instead.
    Times asked 2
    Official solution

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

    Example

    def login_required(fn):
        @wraps(fn)
        def wrapper(*a, **k):
            if 'user_id' not in session:
                return redirect(url_for('auth.login'))
            return fn(*a, **k)
        return wrapper
  6. 6
    Difference between jsonify and json.dumps.
    Times asked 2
    Official solution

    Simplejson.dumps Python object ko JSON string banata hai, jsonify Flask Response banata hai (header ke saath).

    json.dumps({'ok': True}) → '{"ok": true}' (sirf string)

    jsonify(ok=True) → HTTP response, Content-Type: application/json
    
    API route mein jsonify use karo:
    @app.route('/api/users')
    def users():
        return jsonify([{'id': u.id, 'name': u.name} for u in User.query.all()])

    json.dumps se return karoge to browser ise text samajh sakta hai, JSON nahi.

  7. 7
    Asked me to show components. what is Single File Component.
    Times asked 1
    Official solution

    SimpleSFC ek .vue file: template + script + style. Reusable scoped CSS.

    Pages route-level. Components andar. Vue 2 one root; Vue 3 fragments.

    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

    <template><div>{{ venue.name }}</div></template>
    <script>export default { props: ['venue'] }</script>
    <style scoped>.card{padding:8px}</style>

    Project example: VenueCard.vue props. views/Home.vue page.

  8. 8
    Steps to create a new route in frontend.
    Times asked 2
    Official solution

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

  9. 9
    Do you know about child routes and parent routes?
    Times asked 2
    Official solution

    SimpleRouter URL ko component se map karta hai. Google Maps for pages.

    routes array path+component. router-view jagah. router-link reload nahi.

    meta.auth + beforeEach guard. Dynamic /venues/:id.

    Nayi page: SFC + routes entry + link.

    Example

    const routes = [
      { path: '/', component: Home },
      { path: '/login', component: Login },
      { path: '/venues/:id', component: VenueDetail, meta: { auth: true } },
    ]

    Project example: routes.js Login, Register, UserHome, AdminHome, 404.

    Viva tipNayi page: component banao, routes array mein path, router-link se jao.

  10. 10
    What are websockets.
    Times asked 1
    Official solution

    SimpleWebSocket ek phone call hai (dono bolte rehte). HTTP postcard hai (ek request-response).

    Persistent two-way. Chat, live scores. MAD2 generally REST + kabhi poll.

    Webhook ≠ WebSocket. ws:// / wss://.

    HTTP postcard (request-response). WebSocket phone call (dono taraf live). SSE radio (server→client stream). Webhook unka server tumhe POST karta hai (payment).

    MAD2 mostly REST. Live dashboard = poll + Redis cache kaafi. Agar implement nahi kiya to design bolo, jhoot mat.

    Project example: Humne REST use kiya. Live dashboard ke liye poll/cache. WebSocket extra hota.

    Viva tipMAD2 mein mostly REST + polling. Webhook ≠ WebSocket.

  11. 11
    why have you used joinedload.
    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
    write query without using joinedload.
    Times asked 1
    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()
  13. 13
    Where should u use joinedload (N+1 query problem).
    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()
Advice: Very chill guy. Dont piss him off by bluffing.
  1. 1
    Demo of the whole application
    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
    How do you delete the cache? Show me
    Times asked 2
    Official solution

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

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

  3. 3
    Have you implemented Celery?
    Times asked 1
    Official solution

    SimpleCelery = background naukri. HTTP request ko 10 second email bhejne ke liye mat rokna.

    Distributed task queue: aap function ko abhi nahi, worker process mein later/retry/schedule pe chalaate ho.

    MAD2 typical jobs: daily reminder mail, monthly HTML report, user-triggered CSV export.

    Web request 200ms hona chahiye. 10,000 emails request thread mein = timeout. Worker alag CPU pe kaam kare.

    Redis broker chahiye. Beat alag process schedule ke liye.

    Example

    @celery.task
    def daily_reminder():
        for u in User.query.filter_by(active=True):
            send_mail(u.email, 'Book something today!')

    Project example: User Export click → 202 Accepted. Worker CSV + email. Daily 6pm Beat reminder.

    Viva tipWorker + Redis bina Beat ke user-triggered chalega. Scheduled jobs ke liye Beat bhi chahiye.

  4. 4
    What did you use Celery for?
    Times asked 2
    Official solution

    SimpleIsliye ki user wait na kare, retry mil jaaye, 6pm automatic ho jaaye.

    Slow work (mail, CSV, PDF) request se alag. Schedule crontab. Scale = aur workers.

    JS async/await alag cheez hai (browser event loop). Celery server-side process.

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

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

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

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

    Project example: Reminder 6pm, monthly 1st, export button. Teen alag tasks.py functions.

Advice: Make sure to explain the demo clearly and confidently. He is a very chill proctor. Refer to the previous responses — it was the same.
  1. 1
    LEVEL-2 VIVA
    Times asked 1
    Official solution

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

  2. 2
    show me the demo
    Times asked 2
    Official solution

    SimpleDemo script pehle se practice: 5–7 min, Admin + User roles, saare mandatory features.

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

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

  3. 3
    ask questions:
    Times asked 2
    Official solution

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

  4. 4
    what is relational database
    Times asked 2
    Official solution

    SimpleRelational DB tables + rows + columns, relations FK se. SQL se query. SQLite/Postgres examples.

    Example

    users(id, email)
    bookings(id, user_id FK → users.id)

    Viva tipVs NoSQL: fixed schema + joins strong; documents flexible but joins weak.

  5. 5
    what is no sql
    Times asked 2
    Official solution

    SimpleNoSQL = non-relational store (documents/key-value). Flexible schema, joins weak. MongoDB/Redis examples. MAD1 usually SQLite relational.

  6. 6
    what is primary key
    Times asked 2
    Official solution

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

    Example

    id = db.Column(db.Integer, primary_key=True)
Advice: if you get this proctor then you are lucky , he so calm , the viva goes around 20-25 minutes only
  1. 1
    Level-2
    Times asked 3
    Official solution

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

  2. 2
    Id card
    Times asked 8
    Official solution

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

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

  3. 3
    Which database are you using in this project
    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
    Tell me about Nosql databases
    Times asked 2
    Official solution

    SimpleNoSQL = non-relational store (documents/key-value). Flexible schema, joins weak. MongoDB/Redis examples. MAD1 usually SQLite relational.

  5. 5
    Database index
    Times asked 2
    Official solution

    SimpleIndex kitab ki index jaisi — search tez, poori table scan nahi.

    email unique=True already index. Composite: db.Index('ix_user_city_age', User.city, User.age)
    Zyada indexes writes slow. Search/filter columns pe lagao.

Advice: If you get this proctor you are very lucky, i think he is the best proctor, viva ended in 20-25 mins, no code changes, he is very patient, very easy viva, also refer to other responses of this proctor.
  1. 1
    - The examiner joined late.
    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()
  2. 2
    - Explained the entire app with all features, and this took 20 minutes.
    Times asked 2
    Official solution

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

  3. 3
    - What is Redis? Why is it faster?
    Times asked 1
    Official solution

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

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

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

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

    Example

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

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

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

  4. 4
    - What is hashing.?
    Times asked 2
    Official solution

    SimpleMAD1 mein common: Werkzeug generate_password_hash — default usually pbkdf2:sha256. Apna code dikhao.

    Example

    from werkzeug.security import generate_password_hash
    print(generate_password_hash('secret'))  # pbkdf2:sha256:...
  5. 5
    - What is indexing in databases?
    Times asked 1
    Official solution

    SimpleIndex kitab ki suchi — search tez, write thoda mehnga.

    B-tree typically. filter wale columns, FKs. Over-index mat.

    joinedload N+1 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

    db.Column(db.String(80), index=True)
    db.Index('ix_name_city', User.name, User.city)

    Project example: email index, venue.name search index.

  6. 6
    - What is memoization?
    Times asked 1
    Official solution

    SimpleMemoize = function(args) ka answer copy. Caching broader (HTTP, Redis, page).

    Fibonacci textbook. Flask @cache.memoize. cached whole view.

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

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

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

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

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

    Project example: get_user(id) memoize. venues list cached.

  7. 7
    - What is a primary key in a database?
    Times asked 1
    Official solution

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

    Example

    id = db.Column(db.Integer, primary_key=True)
Advice: No coding-related questions were asked of me , but I explained everything with confidence.
  1. 1
    which database have u used
    Times asked 1
    Official solution

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

    Example

    SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
  2. 2
    what is relational database
    Times asked 2
    Official solution

    SimpleRelational DB tables + rows + columns, relations FK se. SQL se query. SQLite/Postgres examples.

    Example

    users(id, email)
    bookings(id, user_id FK → users.id)

    Viva tipVs NoSQL: fixed schema + joins strong; documents flexible but joins weak.

  3. 3
    what is nosql
    Times asked 1
    Official solution

    SimpleNoSQL = non-relational store (documents/key-value). Flexible schema, joins weak. MongoDB/Redis examples. MAD1 usually SQLite relational.

  4. 4
    He joined 5 min late, yet the viva ending within 20 mins
    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()
  5. 5
    No coding questions asked
    Times asked 4
    Official solution

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

  1. 1
    exact same questions as mentioned in the other entries for this proctor
    Times asked 2
    Official solution

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

  2. 2
    very chill dude
    Times asked 2
    Official solution

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

  3. 3
    did not ask me to code anything at all
    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
    he joined 7 mins late, yet the viva was completed by the 25 min mark, meaning it only lasted 18 mins
    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()
Advice: just do the questions mentioned by others for level2_86 or l2_86
  1. 1
    Forgot to mention also saw how emails were getting sent through SMTP
    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.

  2. 2
    how I was exporting CSV in user part
    Times asked 2
    Official solution

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

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

  3. 3
    and how daily reminders and monthly reports were generated and in which format
    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
  1. 1
    Level-2 VIVA MAD 2 The Best of the best examiner I have worked with -Asked to show ID Card -Then proceeded with the demo part(make sure to show each and every small to big thing implemented in the app) -Asked to show cached API endpoints, cache file where I had implemented it and how I was invalidating it? -Then asked to show the batch jobs done using Celery and change that to 1 min for testing(initially I had some terminal issues so it wasn't working but then I asked him to restart the terminal and he said YES, and then it worked) -Also asked to show the Vue files which I had made and implemented in detail -Asked to show the JWT part and how I was storing in the storages Questions -
    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 caching?
    Times asked 23
    Official solution

    SimpleCache baar-baar DB/compute na karne ke liye result yaad rakhta hai.

    Browser cache, Flask cache, Redis. Example: dashboard counts 30 sec Redis mein.
    Cookies alag (client data). HTTP 304 Not Modified bhi cache related.
    MAD1 mein optional. Scale poochhe to pehle indexes + cache, phir extra servers.

  3. 3
    Have you hashed the password? (I did not do it but he asked related theory that why is hashing required and all. I answered partially correct so he then calmly explained me)
    Times asked 1
    Official solution

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

  4. 4
    Asked which database I used? and what type of database is it like RDBMS, No SQL or other? ( I had used sqlite - RDBMS and explained in detail) 4)Asked what is primary key and integrities and why are they required?
    Times asked 1
    Official solution

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

    Example

    SQLALCHEMY_DATABASE_URI = 'sqlite:///app.db'
  5. 5
    Minor code change to change crontab to 1 min and nothing else
    Times asked 2
    Official solution

    SimpleCron/crontab = schedule pe job. Celery Beat app-level cron (daily email). OS crontab alag.

    Example

    crontab(hour=18, minute=0)  # har din 6pm
Advice: Although I was given some other examiner but he was not available so lvl2_86 examiner joined at 12:30 and VIVA went on for 30 min. Checked all the features Very calm, polite, friendly and knowledgeable examiner Gives you time to think for the answer and also if any issues come up Just practice the questions in this sheet and that would be enough for all the VIVAs you are going to attend. Also said you have made very good project and your theory is also good. Wished All The Best at the end and cleared some of the queries I had
  1. 1
    Very good proctor
    Times asked 2
    Official solution

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

  2. 2
    Asked Demo of the app
    Times asked 3
    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
    Show models and explain
    Times asked 2
    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.

  4. 4
    why you are using fs_uniquifier
    Times asked 2
    Official solution

    SimpleUserMixin Flask-Login ko batata hai user object kaise treat karna hai (is_authenticated, get_id).

    class User(db.Model, UserMixin):
        id = db.Column(db.Integer, primary_key=True)

    current_user proxy logged-in user. Initialize: login_user(user) / user_loader callback.
    Flask-WTF: Python classes se forms, CSRF, validators. RegisterForm forms.py mein.
    fs_uniquifier Flask-Security mein token/session identity — email change pe sessions invalidate.
    enctype='multipart/form-data' file upload pe zaroori. request.files.get('resume').

  5. 5
    How RBAC implemented
    Times asked 2
    Official solution

    SimpleRBAC = Role-Based Access Control — permission role se (admin/staff/user), har user pe alag nahi.

    user.role = 'admin'
    if current_user.role != 'admin': abort(403)

    Same login page, role ke hisaab dashboard. Multiple roles: roles table Many-to-Many, ya comma field (behtar normalized table).
    Unapproved staff: is_approved flag, login pe check.
    Flask-Security/UserMixin is_authenticated, is_active, get_id dete hain.

  6. 6
    caching
    Times asked 2
    Official solution

    SimpleCache baar-baar DB/compute na karne ke liye result yaad rakhta hai.

    Browser cache, Flask cache, Redis. Example: dashboard counts 30 sec Redis mein.
    Cookies alag (client data). HTTP 304 Not Modified bhi cache related.
    MAD1 mein optional. Scale poochhe to pehle indexes + cache, phir extra servers.

  7. 7
    Explain props in vue
    Times asked 3
    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
    Different Lifecycle hooks in vue
    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.

  9. 9
    show job Scheduling report
    Times asked 2
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  10. 10
    no code changes were asked
    Times asked 3
    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'))
  1. 1
    What is caching ?
    Times asked 1
    Official solution

    SimpleCache baar-baar DB/compute na karne ke liye result yaad rakhta hai.

    Browser cache, Flask cache, Redis. Example: dashboard counts 30 sec Redis mein.
    Cookies alag (client data). HTTP 304 Not Modified bhi cache related.
    MAD1 mein optional. Scale poochhe to pehle indexes + cache, phir extra servers.

  2. 2
    Indexing in database ?
    Times asked 1
    Official solution

    SimpleIndex = column pe shortcut book — WHERE/JOIN tez. PK auto-indexed. Email/unique filters pe index socho.

    Example

    email = db.Column(db.String(120), unique=True, index=True)
  3. 3
    Jwt token , validity and its expiry ?
    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.

  4. 4
    Celery
    Times asked 9
    Official solution

    SimpleCelery = background naukri. HTTP request ko 10 second email bhejne ke liye mat rokna.

    Distributed task queue: aap function ko abhi nahi, worker process mein later/retry/schedule pe chalaate ho.

    MAD2 typical jobs: daily reminder mail, monthly HTML report, user-triggered CSV export.

    Web request 200ms hona chahiye. 10,000 emails request thread mein = timeout. Worker alag CPU pe kaam kare.

    Redis broker chahiye. Beat alag process schedule ke liye.

    Example

    @celery.task
    def daily_reminder():
        for u in User.query.filter_by(active=True):
            send_mail(u.email, 'Book something today!')

    Project example: User Export click → 202 Accepted. Worker CSV + email. Daily 6pm Beat reminder.

    Viva tipWorker + Redis bina Beat ke user-triggered chalega. Scheduled jobs ke liye Beat bhi chahiye.

  5. 5
    Redis
    Times asked 6
    Official solution

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

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

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

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

    Example

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

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

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

  6. 6
    Is you application scalable ? If yes , How ?
    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: Just know your code better , and relax . If you don't anything he will tell you and explain .
  1. 1
    chill proctor, went over library management project demo, explained vue component and backend route, showed backend jobs
    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
    what is vue, why do we use 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.

  3. 3
    what are the different lifecycle hooks in vue
    Times asked 2
    Official solution

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

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

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

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

    Example

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

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

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

  4. 4
    whats the advantages of using relational databases
    Times asked 2
    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.

  5. 5
    what is API
    Times asked 3
    Official solution

    SimpleAPI = interface jisse systems baat karein. Web API usually JSON return karti hai.

    Example

    @app.route('/api/lots')
    def api_lots():
        return jsonify([{'id': l.id, 'name': l.name} for l in Lot.query.all()])
  6. 6
    all over in 20 mins (no coding changes asked)
    Times asked 2
    Official solution

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

  1. 1
    what is redis and how did you implement it?
    Times asked 1
    Official solution

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

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

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

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

    Example

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

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

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

  2. 2
    what are lifecycle hooks? explain a few of them
    Times asked 2
    Official solution

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

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

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

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

    Example

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

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

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

  3. 3
    explain celery w.r.t your 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.

  4. 4
    how are you doing 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'))
  5. 5
    what are props in vue?
    Times asked 1
    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.

  6. 6
    show a component and explain fetch request and the lifecycle hook used
    Times asked 1
    Official solution

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

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

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

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

    Example

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

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

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

  7. 7
    diff between caching and memoization
    Times asked 1
    Official solution

    SimpleMemoize args-aware. cached view/URL. Prefixes differ.

    Same Redis. Different key recipe.

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

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

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

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

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

    Project example: Two decorators two files explain.

  8. 8
    show where you have implemented caching and why we need it
    Times asked 1
    Official solution

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

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

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

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

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

    Example

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

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

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

  1. 1
    Demonstrate your complete application.
    Times asked 7
    Official solution

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

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

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

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

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

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

  2. 2
    Show and explain your models/controllers.
    Times asked 1
    Official solution

    SimpleEach class PK/FK relationships why. Random line ready.

    serialize hide password.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Project example: models.py top to bottom 3 min.

  3. 3
    Show the Vue components you created.
    Times asked 1
    Official solution

    Simplesrc tree. Open 2 SFCs. props/emit if any. Show Vue components you created. Show all Vue components.

    Count.

    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: explorer.

  4. 4
    Show the cached API endpoints and explain how cache invalidation works.
    Times asked 1
    Official solution

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

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

    print after set sirf miss. Timeout chhota karke expiry.

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

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

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

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

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

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

  5. 5
    Show your Celery implementation and scheduled jobs.
    Times asked 1
    Official solution

    SimpleTask function, beat dict, delay() call, worker+beat terminals, MailHog/CSV.

    App context DB. Args serializable. How many jobs: reminder, monthly, export — gino honestly.

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

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

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

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

    Project example: tasks.py + config schedule + POST export.

  6. 6
    Show the job scheduling reports.
    Times asked 1
    Official solution

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

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

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

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

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

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

  7. 7
    Show how emails are sent using SMTP.
    Times asked 1
    Official solution

    SimpleMAIL config Message MailHog. Show how emails sent SMTP. Show Celery-generated emails. Where email sending logic.

    tasks.py + MailHog.

    Flask-Mail / SMTP se mail. Local MailHog fake server: SMTP 1025, UI 8025 — internet nahi, viva safe.

    Asli send Celery task mein, request thread mein nahi. Beat 6pm reminder, export ke baad CSV attach optional.

    MAIL_SERVER localhost demo. Gmail SMTP student account pe block common. Body mein user name personalization examiner dekhta hai.

    Project example: screenshot 8025.

  8. 8
    Show how CSV export is implemented.
    Times asked 1
    Official solution

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

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

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

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

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

    Example

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

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

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

  9. 9
    Show how JWT is stored in the browser.
    Times asked 1
    Official solution

    SimpleDevTools Application LS. Key name. Logout clears. How JWT stored browser.

    Show where token stored frontend.

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

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

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

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

    Project example: Application tab.

  10. 10
    Explain your API authentication flow in code.
    Times asked 1
    Official solution

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

    Register, login both roles, logout clears token.

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

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

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

    Example

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

    Project example: Two browsers student+admin.

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

  11. 11
    How have you implemented authentication?
    Times asked 1
    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.

  12. 12
    How is route protection (login_required / JWT authentication) implemented?
    Times asked 1
    Official solution

    SimplebeforeEach + @jwt_required dual layer. login_required / JWT.

    How route protection implemented.

    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: router.js + resources.py.

    Project example: router.js + resources.py.

  13. 13
    How have you implemented RBAC?
    Times asked 2
    Official solution

    SimpleRoles table, assignment, decorator, UI meta. Example admin vs user endpoint.

    Admin authenticated AND authorized. User authenticated not authorized admin.

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

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

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

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

    Project example: roles_required admin stats. User 403 Postman.

  14. 14
    Why is password hashing required?
    Times asked 1
    Official solution

    SimpleDB dump ≠ password leak (still reset). Ethics + course security.

    check hash on login. Slow hash+salt rainbow rokta.

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

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

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

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

    Project example: DB browser hashed passwords.

  15. 15
    Have you implemented password hashing?
    Times asked 1
    Official solution

    SimpleHaan generate_password_hash. Never plain. Show register.

    If missing, admit + how to add.

    Pehle 1-line definition, phir related MAD2 layer (Vue SFC / Flask route / models.py / tasks.py / Redis).

    4-line formula: input kahan se aaya, auth/validation kaunsa, DB ya cache ya Celery, kya return.

    Related mix mat karo — cache ≠ Celery, authentication ≠ authorization, v-if ≠ v-show, Beat ≠ Worker. Follow-up ke liye ek difference ready rakho.

    Project example: User.password field.

    Project example: User.password field.

  16. 16
    Why are you using fs_uniquifier?
    Times asked 2
    Official solution

    SimpleLogout all devices / password change. JWT blacklist alternative.

    If JWT only maybe unused — honest.

    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 Security used, column dikhao.

    Project example: If Security used, column dikhao.

  17. 17
    What are Vue lifecycle hooks? Explain the ones you used.
    Times asked 1
    Official solution

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

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

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

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

    Example

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

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

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

  18. 18
    What are Props in Vue?
    Times asked 5
    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).

  19. 19
    Show a Vue component and explain its fetch() request and lifecycle hook.
    Times asked 1
    Official solution

    SimpleOne component mounted fetch headers error. Line by line. Show a Vue component fetch and lifecycle.

    async await.

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

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

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

    Project example: Home.vue.

    Project example: Home.vue.

  20. 20
    What is a Single File Component (SFC)?
    Times asked 2
    Official solution

    SimpleSFC ek .vue file: template + script + style. Reusable scoped CSS.

    Pages route-level. Components andar. Vue 2 one root; Vue 3 fragments.

    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

    <template><div>{{ venue.name }}</div></template>
    <script>export default { props: ['venue'] }</script>
    <style scoped>.card{padding:8px}</style>

    Project example: VenueCard.vue props. views/Home.vue page.

  21. 21
    How do you create a new route in Vue?
    Times asked 1
    Official solution

    SimpleSFC, routes.js entry, router-link. How create new route Vue.

    Live common.

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

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

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

    Project example: Copy Dashboard → Foo.

    Project example: Copy Dashboard → Foo.

  22. 22
    What are Parent Routes and Child Routes?
    Times asked 1
    Official solution

    SimpleRouter URL ko component se map karta hai. Google Maps for pages.

    routes array path+component. router-view jagah. router-link reload nahi.

    meta.auth + beforeEach guard. Dynamic /venues/:id.

    Nayi page: SFC + routes entry + link.

    Example

    const routes = [
      { path: '/', component: Home },
      { path: '/login', component: Login },
      { path: '/venues/:id', component: VenueDetail, meta: { auth: true } },
    ]

    Project example: routes.js Login, Register, UserHome, AdminHome, 404.

    Viva tipNayi page: component banao, routes array mein path, router-link se jao.

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

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

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

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

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

    Example

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

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

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

  24. 24
    Why is Redis faster than a relational database?
    Times asked 1
    Official solution

    SimpleFast kyunki RAM + simple commands, joins nahi.

    Disk seek milliseconds, RAM microseconds. Redis single-threaded lekin har op chhoti.

    Compare: SQLite file lock writes pe. Redis in-memory SET. Persistence RDB/AOF extra, default viva mein RAM.

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

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

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

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

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

    Project example: Same JSON cache vs query.join — Network timing dikhao.

  25. 25
    How have you implemented Redis?
    Times asked 1
    Official solution

    Simpledb indexes cache vs broker, ping, which keys, why used.

    Physical RAM. Vue nahi. Hit miss. Celery alag.

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

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

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

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

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

    Project example: config URLs + decorator + celery broker.

  26. 26
    What is caching?
    Times asked 23
    Official solution

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

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

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

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

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

    Example

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

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

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

  27. 27
    Why do we need caching?
    Times asked 1
    Official solution

    SimpleCache isliye taaki 100 users same dashboard pe DB ko 100 baar na maror dein.

    Problem: repeated reads, slow page, extra load. Cache seconds ke liye snapshot deta hai.

    Nahi use karna: har second badalne wala live stock, user-private secret data bina soch ke (key mein user_id hona chahiye).

    Memoization caching ka subset hai (function args). HTTP 304 / browser cache alag layer.

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

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

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

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

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

    Project example: Shows list har user dekhta hai — perfect cache. Booking POST cache nahi — har baar write.

  28. 28
    Where have you implemented caching?
    Times asked 7
    Official solution

    SimpleGET lists/stats @cache.cached. Mutations pe delete. CACHE_TYPE Redis.

    Why each route: public repeated reads. User-private careful.

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

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

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

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

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

    Project example: File+line decorator. redis-cli get key optional.

  29. 29
    How do you invalidate/delete cache?
    Times asked 1
    Official solution

    SimpleDB badli to purani copy phenk do, warna user jhooth dekhega.

    Invalidation = cache key delete/update after create/update/delete.

    Options: (1) cache.delete('venues') targeted (2) timeout auto-expire (3) cache.clear() nuclear — baaki routes bhi miss ho jaayenge.

    Examiner: 'naya record insert kiya, cache purana' — write route mein delete dikhao, phir GET miss+hit demo.

    Example

    @app.route('/api/venues', methods=['POST'])
    def create_venue():
        db.session.add(v)
        db.session.commit()
        cache.delete('venues')
        return jsonify(msg='created'), 201

    Project example: POST /api/venues commit ke baad cache.delete. PUT/DELETE pe bhi same prefix.

    Viva tipTimeout se auto-expire bhi hota hai. Create/update/delete ke baad related keys hatao.

  30. 30
    Difference between Caching and Memoization.
    Times asked 2
    Official solution

    SimpleMemoize args-aware. cached view/URL. Prefixes differ.

    Same Redis. Different key recipe.

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

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

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

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

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

    Project example: Two decorators two files explain.

  31. 31
    What is Memoization?
    Times asked 2
    Official solution

    SimpleMemoize = function(args) ka answer copy. Caching broader (HTTP, Redis, page).

    Fibonacci textbook. Flask @cache.memoize. cached whole view.

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

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

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

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

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

    Project example: get_user(id) memoize. venues list cached.

  32. 32
    Explain Celery with respect to your project.
    Times asked 1
    Official solution

    SimpleTasks list, schedule, broker, trigger, verify MailHog/logs.

    Beat vs worker. User vs scheduled. App context.

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

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

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

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

    Project example: Three tasks. Commands README.

  33. 33
    How many Celery jobs have you implemented?
    Times asked 1
    Official solution

    SimpleGino jo implement: generally reminder, monthly, export. Beat schedule dikhao.

    Don't claim 5 if 2.

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

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

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

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

    Project example: Open beat dict count keys + extra delay() tasks.

  34. 34
    What did you use Celery for?
    Times asked 2
    Official solution

    SimpleIsliye ki user wait na kare, retry mil jaaye, 6pm automatic ho jaaye.

    Slow work (mail, CSV, PDF) request se alag. Schedule crontab. Scale = aur workers.

    JS async/await alag cheez hai (browser event loop). Celery server-side process.

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

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

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

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

    Project example: Reminder 6pm, monthly 1st, export button. Teen alag tasks.py functions.

  35. 35
    Which database have you used?
    Times asked 4
    Official solution

    SimpleSQLite file, zero setup, relational tables/FK. Redis NoSQL cache not primary.

    NoSQL examples Mongo, Redis-as-DB. MAD2 models relational.

    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: sqlite:///app.db. Redis 6379 alag.

  36. 36
    Is it a relational database or NoSQL database?
    Times asked 1
    Official solution

    SimpleSQLite/Postgres relational. Redis NoSQL used as cache not models.

    Don't say 'we used NoSQL' if only Redis cache.

    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: models.py tables = relational.

  37. 37
    What is a relational database?
    Times asked 2
    Official solution

    SimpleRDBMS tables SQL. SQLite/Postgres/MySQL. Database data, DBMS software.

    SQLite engine + file. DBMS vs DB difference favourite.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Project example: SQLite DBMS, app.db database file.

  38. 38
    What is a NoSQL database?
    Times asked 2
    Official solution

    SimpleNon-relational: Mongo docs, Redis kv, Cassandra. Flexible schema.

    MAD2 Redis cache. Primary models SQL.

    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: Not Mongo. Redis yes.

    Project example: Not Mongo. Redis yes.

  39. 39
    What is a Primary Key?
    Times asked 5
    Official solution

    SimplePrimary Key unique not null identity. Usually integer autoincrement.

    Candidate keys mein se chosen. Composite PK possible, course simple id.

    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: Har model id = db.Integer primary_key=True.

  40. 40
    Why are database integrity constraints required?
    Times asked 1
    Official solution

    SimpleDB last guard garbage data. Concurrent + bugs. Duplicate email, orphan bookings.

    Why integrity constraints required.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Project example: Demo duplicate register 400.

  41. 41
    What is database indexing?
    Times asked 1
    Official solution

    SimpleIndex kitab ki suchi — search tez, write thoda mehnga.

    B-tree typically. filter wale columns, FKs. Over-index mat.

    joinedload N+1 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

    db.Column(db.String(80), index=True)
    db.Index('ix_name_city', User.name, User.city)

    Project example: email index, venue.name search index.

  42. 42
    What is joinedload?
    Times asked 1
    Official solution

    SimpleN+1: 1 query users + 100 queries bookings. joinedload ek JOIN mein laao.

    Kab: list+children hamesha. Kab nahi: children kabhi kabhi — lazy.

    subqueryload alternative.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Example

    users = User.query.options(joinedload(User.bookings)).all()

    Project example: Admin users with bookings dashboard.

  43. 43
    Why did you use joinedload?
    Times asked 1
    Official solution

    SimplePerf list+children one SQL. EXPLAIN advanced. N+1 avoid.

    Why did you use joinedload.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Project example: If not used: would add on admin users list.

  44. 44
    Write the query without using joinedload.
    Times asked 1
    Official solution

    SimpleTwo queries or lazy N+1. Manual join(). Write without joinedload.

    Accept extra queries or .join().

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Project example: User.query.join(Booking)...

  45. 45
    In what situations should joinedload be used? (N+1 Query Problem)
    Times asked 1
    Official solution

    SimpleN+1: 1 query users + 100 queries bookings. joinedload ek JOIN mein laao.

    Kab: list+children hamesha. Kab nahi: children kabhi kabhi — lazy.

    subqueryload alternative.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Example

    users = User.query.options(joinedload(User.bookings)).all()

    Project example: Admin users with bookings dashboard.

  46. 46
    What is a decorator?
    Times asked 3
    Official solution

    SimpleDecorator wrap function @app.route @cache @celery.task @auth. Reusable cross-cut.

    Different from normal function: HOF wrap, miss easy if manual if. DRY order readable.

    Why use decorator: one place policy. @roles_required instantly.

    Flask Python micro web framework. Route decorator URL → function. MAD2 mein JSON API: request.get_json(), jsonify, JWT.

    WSGI: server (Werkzeug) app ko call. if __name__ == '__main__' sirf direct run. Factory create_app() test/celery ke liye.

    Blueprint/resources folders. @app.route vs MethodView. Debug=True viva local, prod nahi. CORS alag port Vue ke liye.

    Example

    def hello_world(fn):
        def wrapper(*a, **k):
            print('Hello World')
            return fn(*a, **k)
        return wrapper
    
    @hello_world
    def ping():
        return 'pong'

    Project example: Stack jwt then role. Explain trio route cached task.

  47. 47
    Why use a decorator instead of a normal function?
    Times asked 1
    Official solution

    SimpleDeclarative, order, reuse, less miss. vs normal function call.

    Why use decorator instead of normal function.

    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: Five admin routes one decorator.

  48. 48
    Difference between jsonify and json.dumps.
    Times asked 2
    Official solution

    Simplejsonify Flask ka JSON response + sahi Content-Type. dumps sirf string.

    marshal schema. serialize models. pickle APIs pe nahi.

    Flask Python micro web framework. Route decorator URL → function. MAD2 mein JSON API: request.get_json(), jsonify, JWT.

    WSGI: server (Werkzeug) app ko call. if __name__ == '__main__' sirf direct run. Factory create_app() test/celery ke liye.

    Blueprint/resources folders. @app.route vs MethodView. Debug=True viva local, prod nahi. CORS alag port Vue ke liye.

    Example

    return jsonify(users=[{'id': u.id, 'email': u.email} for u in User.query.all()])

    Project example: return jsonify(users=[u.serialize() for u in users])

  49. 49
    What are WebSockets?
    Times asked 1
    Official solution

    SimpleWebSocket ek phone call hai (dono bolte rehte). HTTP postcard hai (ek request-response).

    Persistent two-way. Chat, live scores. MAD2 generally REST + kabhi poll.

    Webhook ≠ WebSocket. ws:// / wss://.

    HTTP postcard (request-response). WebSocket phone call (dono taraf live). SSE radio (server→client stream). Webhook unka server tumhe POST karta hai (payment).

    MAD2 mostly REST. Live dashboard = poll + Redis cache kaafi. Agar implement nahi kiya to design bolo, jhoot mat.

    Project example: Humne REST use kiya. Live dashboard ke liye poll/cache. WebSocket extra hota.

    Viva tipMAD2 mein mostly REST + polling. Webhook ≠ WebSocket.

  50. 50
    What are Webhooks?
    Times asked 7
    Official solution

    SimpleWebhook = woh tumhe call karta hai. API = tum unhe call karte ho.

    Payment success pe Stripe tumhare /webhooks/payment pe POST. Tum poll nahi karte.

    API pull, webhook push. WebSocket dono taraf live connection. SSE server→client stream.

    MAD2 mostly REST APIs. Webhook theory + example kaafi. Verify signature production mein.

    Example

    @app.route('/webhooks/payment', methods=['POST'])
    def hook():
        event = request.json
        ...

    Project example: Agar implement nahi: 'course REST. Webhook design: POST /webhooks/booking-paid'.

    Viva tipAPI pull, webhook push. WebSocket dono taraf live. SSE server → client stream.

  51. 51
    If your application had 1 million users and all reminder emails had to be sent within 15 minutes, how would you scale the system?
    Times asked 1
    Official solution

    SimpleN workers chunk users bulk SMTP/API monitor queue. 1 million emails 15 min.

    Scale reminder blast.

    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: Celery concurrency + dedicated mailer. Not one loop sync.

  1. 1
    Demonstrate the complete application.
    Times asked 33
    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.

  2. 2
    Explain the Library Management project.
    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.

  3. 3
    Explain the backend routes.
    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
    Show backend jobs.
    Times asked 1
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  5. 5
    Show all models and explain them.
    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
    Why are you using fs_uniquifier?
    Times asked 2
    Official solution

    SimpleUserMixin Flask-Login ko batata hai user object kaise treat karna hai (is_authenticated, get_id).

    class User(db.Model, UserMixin):
        id = db.Column(db.Integer, primary_key=True)

    current_user proxy logged-in user. Initialize: login_user(user) / user_loader callback.
    Flask-WTF: Python classes se forms, CSRF, validators. RegisterForm forms.py mein.
    fs_uniquifier Flask-Security mein token/session identity — email change pe sessions invalidate.
    enctype='multipart/form-data' file upload pe zaroori. request.files.get('resume').

  7. 7
    How is RBAC (Role-Based Access Control) implemented?
    Times asked 1
    Official solution

    SimpleRBAC = Role-Based Access Control — permission role se (admin/staff/user), har user pe alag nahi.

    user.role = 'admin'
    if current_user.role != 'admin': abort(403)

    Same login page, role ke hisaab dashboard. Multiple roles: roles table Many-to-Many, ya comma field (behtar normalized table).
    Unapproved staff: is_approved flag, login pe check.
    Flask-Security/UserMixin is_authenticated, is_active, get_id dete hain.

  8. 8
    Why do we use Vue.js?
    Times asked 1
    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.

  9. 9
    Explain Vue Components.
    Times asked 1
    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.

  10. 10
    What are Props in Vue?
    Times asked 5
    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.

  11. 11
    Explain the different Vue Lifecycle Hooks.
    Times asked 1
    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.

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

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

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

    Example

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

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

  13. 13
    What are the advantages of Relational Databases?
    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
    What is Redis?
    Times asked 21
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  15. 15
    How did you implement Redis?
    Times asked 1
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  16. 16
    What is Celery?
    Times asked 19
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  17. 17
    How did you implement Celery?
    Times asked 2
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  18. 18
    What is Caching?
    Times asked 2
    Official solution

    SimpleCache baar-baar DB/compute na karne ke liye result yaad rakhta hai.

    Browser cache, Flask cache, Redis. Example: dashboard counts 30 sec Redis mein.
    Cookies alag (client data). HTTP 304 Not Modified bhi cache related.
    MAD1 mein optional. Scale poochhe to pehle indexes + cache, phir extra servers.

  19. 19
    How is Caching implemented in your project?
    Times asked 1
    Official solution

    SimpleCache baar-baar DB/compute na karne ke liye result yaad rakhta hai.

    Browser cache, Flask cache, Redis. Example: dashboard counts 30 sec Redis mein.
    Cookies alag (client data). HTTP 304 Not Modified bhi cache related.
    MAD1 mein optional. Scale poochhe to pehle indexes + cache, phir extra servers.

  20. 20
    Show the Job Scheduling Report.
    Times asked 1
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  1. 1
    Asked Demo of the app
    Times asked 3
    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.

  2. 2
    Show models and explain
    Times asked 2
    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.

  3. 3
    why you are using fs_uniquifier
    Times asked 2
    Official solution

    SimpleUserMixin Flask-Login ko batata hai user object kaise treat karna hai (is_authenticated, get_id).

    class User(db.Model, UserMixin):
        id = db.Column(db.Integer, primary_key=True)

    current_user proxy logged-in user. Initialize: login_user(user) / user_loader callback.
    Flask-WTF: Python classes se forms, CSRF, validators. RegisterForm forms.py mein.
    fs_uniquifier Flask-Security mein token/session identity — email change pe sessions invalidate.
    enctype='multipart/form-data' file upload pe zaroori. request.files.get('resume').

  4. 4
    How RBAC implemented
    Times asked 2
    Official solution

    SimpleRBAC = Role-Based Access Control — permission role se (admin/staff/user), har user pe alag nahi.

    user.role = 'admin'
    if current_user.role != 'admin': abort(403)

    Same login page, role ke hisaab dashboard. Multiple roles: roles table Many-to-Many, ya comma field (behtar normalized table).
    Unapproved staff: is_approved flag, login pe check.
    Flask-Security/UserMixin is_authenticated, is_active, get_id dete hain.

  5. 5
    Explain redis and how you implemented
    Times asked 1
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  6. 6
    Explain celery and how you implemented
    Times asked 2
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  7. 7
    caching
    Times asked 2
    Official solution

    SimpleCache baar-baar DB/compute na karne ke liye result yaad rakhta hai.

    Browser cache, Flask cache, Redis. Example: dashboard counts 30 sec Redis mein.
    Cookies alag (client data). HTTP 304 Not Modified bhi cache related.
    MAD1 mein optional. Scale poochhe to pehle indexes + cache, phir extra servers.

  8. 8
    Explain props in vue
    Times asked 3
    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.

  9. 9
    Different Lifecycle hooks in vue
    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.

  10. 10
    show job Scheduling report
    Times asked 2
    Official solution

    SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.

    User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
    Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
    Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
    Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.

  11. 11
    no code changes were asked
    Times asked 3
    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.