Viva prep · Real questions · Student experiences Enroll in Bootcamp

Proctor workspace

Proctor Level3_49

Share your experience Add your viva experience here
144 Questions
2 Sets
0 Topics
4 Reviews
Tips for this examiner: Be ready to get roasted

Student reviews

Nah MAD1

Proctor is strict will help u a bit but not in during viva.He is chill but can ask deep driven question regarding each and every line of your code , method, anything answer honestly he is nice i think so

Questions remembered
  1. He asked me to show id card
  2. Then download project from submission
  3. Then asked me if that read me is ai generated
  4. Then asked me to tell him about my project
  5. And what is orm,what is MVC,api and rest api,http methods,what u used in project, login as admin,go back to code, explain first 10 line of code,go back to website create a trek ,now if the difficulty is easy create a trek with not less than 30 slot,then asked me to code in jinja for a list of book if book is dbms then render to authour name.then asked me where this del button is in code and where it will route to then asked me explain this code then asked me why is this green and then asked me about get404
  6. Then said your viva is over if u have some questions go ahead
  7. Then i asked him about these i discussed my flaws he told me how to code those things i was close in both he gently told me you have knowledge but have some problem.and wel talked about that code and said you knew but wasn't able to show properly.then i asked should i repeat or should i continue he told me if u have chance fo it again everything will be clear to you.
Suryaansh MAD1

Dont take the last slots or any late slots, proctor is overall chill probably a college student. Will explain if you get stuck somwhere. Follow whatever he asks and answer to the point.
If he asks if you have used gpt then be honest because he will catch it nevertheless

Questions remembered
  1. Explain the directory and the project structure ( explain MVC )
  2. explain models.py
  3. what is backref and difference between backref and backpopulate
  4. what is lazy loading and different parameters
  5. show the whole demo of the project
  6. change the shadow box in our project and change the offsets and the rgba color
  7. change the size and color of the container in your style css
  8. whats the precedence of classes when you write them together in 1 tag
  9. whats the code for keeping a check on 2 ad request , make it without changing the models.py file
  10. explain one of the controllers in detail and why is it used
  11. what is rest api and how is it used
  12. what are filters and how can you use them in your code
  13. what is referential integrity and explain different keys
  14. what is normalization
  15. explain template inheritance using example
  16. make change in the request and show
Sheet response MAD1

practice the theory well

Questions remembered
  1. -Demonstrate the application
  2. -Show the code
  3. -Minor adjustments to styling of the html page
  4. -What is authentication and authorisation
  5. -Explain about different types of testing
  6. -Template inheritance
  7. -Pros and cons of using sqlite3 database
  8. -Show the APIs
  9. -What is API? What is REST API
  10. -How would you have improved your project if you had more time
Sheet response MAD1

Be relaxed, they ask only standard questions mostly and some based on your responses and things you have shown in the code. So, understand your codebase.

Questions remembered
  1. - Explain project directory structure and architecture
  2. - Show project demo
  3. - What's DOM?
  4. - Css types and precedence - external, internal and inline
  5. - What's rest api and any alternatives? (graphql)
  6. - based on previous question advantages if used graphql
  7. - Sqlite pros and cons over alternatives
  8. - Lazy loading in Sqlalchemy (I have used it that's why he asked)
  9. - Is my database schema normalized and how?
  10. - explain normalization
  11. - implement feature to only allow one ad request for an influencer in a campaign
  12. - center a text and div on a page
  13. - anything you wanted to implement but you couldn't while submitting (I answered filters and search)
  14. - based on previous question, how would you implement that first using js only and secondly using flask api endpoints.

Approved viva sets

  1. 1
    Explain the important keywords/features used in your application.
    Times asked 1
    Official solution

    SimpleJWT RBAC cache celery v-model router guards — har ek location. Important keywords/features.

    Don't list unused.

    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: 6 keywords 6 files.

    Project example: 6 keywords 6 files.

  2. 2
    Explain your project folder and file structure.
    Times asked 1
    Official solution

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

    Don't read every file. 6 roles.

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

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

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

    Project example: tree command or VSCode explorer.

  3. 3
    Explain your database schema and table relationships.
    Times asked 2
    Official solution

    SimpleTables + lines (FK) + 1-M / M-M. Draw mentally, phir models.py.

    Har class: PK, important columns, relationships. Why normalized (no duplicate venue name in every show as only string without FK).

    Indexes search columns. Unique email. Cascade policy bookings pe.

    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-Role M-M. User-Booking 1-M. Venue-Show 1-M. Show-Booking 1-M.

  4. 4
    Explain your Search API and its implementation.
    Times asked 1
    Official solution

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

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

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

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

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

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

  5. 5
    Explain the Admin dashboard statistics API.
    Times asked 1
    Official solution

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

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

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

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

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

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

  6. 6
    Explain where and how Redis is implemented.
    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.

  7. 7
    Explain where caching is implemented.
    Times asked 2
    Official solution

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

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

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

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

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

    Example

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

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

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

  8. 8
    Explain improvements from MAD1 to MAD2.
    Times asked 1
    Official solution

    SimpleMAD1 Jinja MPA sessions. MAD2 Vue SPA REST JWT Redis Celery. Same domain CRUD, architecture jump.

    Improvements: SPA, cache, jobs, JWT. Still add tests/cancel.

    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: Reuse models idea, rewrite UI APIs jobs.

  9. 9
    Explain your project architecture.
    Times asked 2
    Official solution

    SimpleClient-server SPA + background workers. Boxes: Vue | HTTP JSON | Flask | SQLite | Redis | Celery.

    Not microservices. Layered REST. Cache aur queue extra.

    Scale story alag: gunicorn, Postgres, more workers.

    MAD2 architecture: Vue SPA (client) → HTTP JSON → Flask API (server) → SQLAlchemy DB. Side path: Flask → Redis broker → Celery worker → MailHog/CSV.

    Client-server alag ports. State: Vue memory + LS token. Persistent: SQLite. Cache: Redis. MVC-ish: models.py, API views, Vue templates.

    Scale: more workers, Postgres, cache, not 'bigger SQLite file'.

    Suggested flowBrowser Vue → HTTP JSON → Flask → SQLAlchemy → DB
    Extra: Redis cache; Celery via Redis

    Project example: Draw 6 boxes viva mein. Point to folders.

  10. 10
    Hide/show a button conditionally using v-if.
    Times asked 1
    Official solution

    Simplev-if / else-if / else. v-else next sibling immediately.

    Write if-else Vue. Hide login v-if.

    Directives Vue ke special attributes hain — HTML ko superpower: v-if/v-show, v-for, v-bind (:), v-on (@), v-model.

    v-if DOM se hataata/jodta. v-show sirf CSS display. Rare/permission: v-if. Bar-bar toggle: v-show. v-model two-way form. v-bind one-way JS→attribute.

    :key v-for pe zaroori warna Vue galat reuse. v-html XSS. Secret UI ke liye sirf v-if kaafi nahi — API 403 bhi.

    MAD1 Jinja server HTML. MAD2 yeh directives browser mein reactive.

    Example

    <p v-if="status === 'ok'">Done</p>
    <p v-else-if="status === 'wait'">Loading</p>
    <p v-else>Error</p>

    Project example: status messages.

  11. 11
    Show a welcome message below the search bar when searching for a specific keyword.
    Times asked 1
    Official solution

    Simplev-if q==='secret' welcome else results. Welcome below search specific keyword.

    Live.

    MAD2 architecture: Vue SPA (client) → HTTP JSON → Flask API (server) → SQLAlchemy DB. Side path: Flask → Redis broker → Celery worker → MailHog/CSV.

    Client-server alag ports. State: Vue memory + LS token. Persistent: SQLite. Cache: Redis. MVC-ish: models.py, API views, Vue templates.

    Scale: more workers, Postgres, cache, not 'bigger SQLite file'.

    Project example: Search.vue.

    Project example: Search.vue.

  12. 12
    Prevent company registration based on a backend condition.
    Times asked 1
    Official solution

    Simpleif not meets(rule) 400. Example domain. Prevent company registration condition.

    Backend.

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

    Project example: register_company.

  13. 13
    Prevent blacklisting users whose usernames satisfy a specific condition (logic problem).
    Times asked 1
    Official solution

    SimpleSkip blacklist if username matches pattern — logic puzzle if not cond: flag.

    Prevent blacklisting users whose usernames satisfy condition.

    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: Write if carefully, test two names.

  14. 14
    Change a button color.
    Times asked 1
    Official solution

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

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

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

    Example

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

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

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

  15. 15
    Limit the maximum number of slots/seats while creating a record.
    Times asked 1
    Official solution

    Simpleif price < min or > max 400. Input :max. Limit product price range. Limit max slots/seats creating record.

    Both.

    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: create form + route.

    Project example: create form + route.

  16. 16
    Display backend validation errors in the browser/Developer Console.
    Times asked 1
    Official solution

    Simpleres.ok false → JSON message state/toast. try/catch network.

    Don't ignore 400. Show 'Already booked'.

    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

    if (!res.ok) {
      const e = await res.json()
      this.error = e.message
    }

    Project example: book() method if (!res.ok) this.error = ...

  17. 17
    What is Vue.js?
    Times asked 5
    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.

  18. 18
    What is a reactive framework?
    Times asked 1
    Official solution

    SimpleReactive: data change → UI auto. Vue/React. jQuery manual.

    Why Vue. Lose reactivity Vue2 new field. Vue3 proxy better.

    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: Change data, list updates.

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

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

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

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

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

    Example

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

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

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

  20. 20
    What are Vue directives?
    Times asked 6
    Official solution

    SimpleDirectives Vue ke special attributes — HTML ko superpower.

    v-if/else/show, v-for, v-bind (:), v-on (@), v-model, v-html (XSS), v-cloak, v-slot.

    :src = v-bind:src. @click = v-on:click.

    Custom directives bhi (v-focus) — course basics kaafi.

    Example

    <p v-if="ok">Yes</p>
    <li v-for="u in users" :key="u.id">{{ u.name }}</li>
    <input v-model="email">
    <img :src="url">

    Project example: List v-for :key. Form v-model. Admin v-if. Image :src.

    Viva tip: src ke liye v-bind:src ka shorthand. @click = v-on:click.

  21. 21
    Difference between v-if and v-show.
    Times asked 10
    Official solution

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

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

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

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

    Example

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

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

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

  22. 22
    What is v-cloak?
    Times asked 1
    Official solution

    Simplev-cloak compile se pehle {{ }} hide. CSS [v-cloak]{display:none}.

    CDN flash of mustache.

    Directives Vue ke special attributes hain — HTML ko superpower: v-if/v-show, v-for, v-bind (:), v-on (@), v-model.

    v-if DOM se hataata/jodta. v-show sirf CSS display. Rare/permission: v-if. Bar-bar toggle: v-show. v-model two-way form. v-bind one-way JS→attribute.

    :key v-for pe zaroori warna Vue galat reuse. v-html XSS. Secret UI ke liye sirf v-if kaafi nahi — API 403 bhi.

    MAD1 Jinja server HTML. MAD2 yeh directives browser mein reactive.

    Project example: index.html v-cloak if CDN.

  23. 23
    What are Vue lifecycle hooks?
    Times asked 11
    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.

  24. 24
    Which lifecycle hooks did you use?
    Times asked 1
    Official solution

    Simplemounted/onMounted data load. beforeUnmount cleanup. created if used. List 2 + why.

    Which lifecycle hooks did you use.

    Lifecycle = component ki zindagi: created (instance, DOM nahi) → mounted/onMounted (DOM ready — fetch, Chart.js yahi) → updated → unmounted (clearInterval).

    Dashboard API created mein isliye nahi ki $el/canvas missing ho sakta. Composition API: onMounted(() => {}) setup ke andar. Options: mounted() method. Mix mat.

    Examiner 'konsa hook use kiya' — related .vue kholo, line padh ke bolo.

    Project example: Open files grep mounted.

  25. 25
    Explain watch() and where you used it.
    Times asked 1
    Official solution

    Simplewatch = 'jab yeh badle tab yeh karo'. Computed nahi, kyunki return value nahi, kaam hai.

    deep: true objects. immediate: true first run. Composition watch().

    Search, $route.params.id load user.

    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

    watch(() => route.params.id, (id) => loadUser(id))

    Project example: watch query debounce 300ms search API. Nahi use to 'computed kaafi'.

  26. 26
    What are Props?
    Times asked 4
    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).

  27. 27
    What is emit?
    Times asked 1
    Official solution

    Simpleemit = child parent ko chillata hai: 'delete 5'. Props down, events up.

    this.$emit('delete', id). Parent @delete="removeRow".

    Grandchild: chain emit ya Vuex/provide.

    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

    this.$emit('delete', id)
    // parent: <Child @delete="removeRow" />

    Project example: BookingRow emit cancel → parent list se hata + API DELETE.

  28. 28
    What is Axios?
    Times asked 2
    Official solution

    SimpleAxios HTTP library: JSON auto, interceptors, timeout. fetch built-in alternative.

    Na use kiya: 'fetch native, extra lib nahi' valid.
    Use kiya: interceptor mein token. Why didn't: deps kam.

    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

    axios.get('/api/venues', { headers: { Authorization: 'Bearer ' + token } })

    Project example: axios.defaults.headers.common.Authorization. baseURL :5000.

    Viva tipNa use kiya to bolo: fetch native hai, extra lib nahi. Use kiya to interceptor mein token set karna dikhao.

  29. 29
    Why didn't you use Axios?
    Times asked 1
    Official solution

    Simplefetch native, fewer deps. Valid.

    If axios used, opposite: interceptors.

    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: api.js fetch wrapper.

    Project example: api.js fetch wrapper.

  30. 30
    What is Vue Router's # (hash mode) in the URL? Where is it configured?
    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.

  31. 31
    What is the difference between Vue 2 and Vue 3?
    Times asked 1
    Official solution

    SimpleVue 3 naya engine: Composition API, fragments, better TS, tree-shaking. Vue 2 Options + filters.

    mounted vs onMounted. Filters Vue 3 mein hata — computed/methods.

    Version package.json / Vue.version se dikhao. Jo use kiya uske hooks bolo.

    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: package.json vue ^3.x. setup() + onMounted fetch.

    Viva tipVersion package.json / Vue.version se dikhao. MAD2 dono allowed usually — jo use kiya uske hooks bolo (mounted vs onMounted).

  32. 32
    What is Node.js?
    Times asked 1
    Official solution

    SimpleNode JS runtime bahar browser. Vite/CLI ko chahiye. CDN-only app browser se chal sakti.

    node_modules venv mein nahi.

    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: node -v. npm run serve.

  33. 33
    What is Node?
    Times asked 1
    Official solution

    SimpleNode JS runtime bahar browser. Vite/CLI ko chahiye. CDN-only app browser se chal sakti.

    node_modules venv mein nahi.

    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: node -v. npm run serve.

  34. 34
    What is npm?
    Times asked 2
    Official solution

    Simplenpm Node package manager. package.json scripts/deps. node_modules folder.

    Not inside venv. Python pip alag. lockfile versions.

    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: npm install. scripts dev/build.

    Viva tipnode_modules venv ke andar nahi — project root pe. Python venv alag, npm alag.

  35. 35
    Why do we need Node.js?
    Times asked 1
    Official solution

    SimpleToolchain: Vite, npm packages. Runtime Vue ka browser. Prod static dist only possible.

    CDN path Node skip. CLI path Node zaroori.

    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: Which you used.

  36. 36
    Can your application be built using plain JavaScript instead of Vue?
    Times asked 1
    Official solution

    SimpleHaan possible innerHTML manual DOM. Vue saves time. Course wants Vue.

    Can built using plain JS instead of Vue? Possible not practical spec.

    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: We used Vue required.

  37. 37
    How does JavaScript work?
    Times asked 2
    Official solution

    SimpleEngine parse, event loop, Web APIs fetch. Vue compile template render fn.

    Single-threaded + queue. Reactivity on top.

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

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

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

    Project example: Don't go too OS-level unless asked.

  38. 38
    What are asynchronous functions?
    Times asked 1
    Official solution

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

    JS async ≠ Celery async jobs. Context se bolo.

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

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

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

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

    Project example: Login sync hash check fast. Email Celery async. Vue fetch async.

  39. 39
    What are Promises?
    Times asked 1
    Official solution

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

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

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

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

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

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

    Example

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

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

  40. 40
    Relationship between Promises and async/await.
    Times asked 1
    Official solution

    Simpleawait promise. async always returns promise. Same states.

    Relationship promises and 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: fetch is promise, await in mounted.

    Project example: fetch is promise, await in mounted.

  41. 41
    What are anonymous functions?
    Times asked 1
    Official solution

    SimpleAnonymous ka naam nahi. Arrow aksar. const foo = () => {} naam infer.

    function foo() named. Is every arrow anon? Usually yes.

    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: v-for callbacks arrows.

  42. 42
    Is every arrow function anonymous?
    Times asked 1
    Official solution

    SimpleAksar haan. Assigned const named. function declaration named.

    Why arrows in routes: lazy () => import(), lexical this.

    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: router lazy import arrows.

    Project example: router lazy import arrows.

  43. 43
    What are named exports?
    Times asked 1
    Official solution

    Simpleexport default ek. named { foo }. SFC default component.

    index.js import App from. routes named maybe.

    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: HelloWorld.vue default export.

    Project example: HelloWorld.vue default export.

  44. 44
    What is a default export?
    Times asked 1
    Official solution

    Simpleexport default ek. named { foo }. SFC default component.

    index.js import App from. routes named maybe.

    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: HelloWorld.vue default export.

    Project example: HelloWorld.vue default export.

  45. 45
    Create a list of five integers in JavaScript.
    Times asked 1
    Official solution

    Simpleconst arr=[1,2,3,4,5] ya Array.from. Create list five integers JS.

    console.log.

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

    Project example: Notepad.

  46. 46
    Use a higher-order function to multiply every element by 70.
    Times asked 1
    Official solution

    Simple[1,2,3].map(x => x * 70). Use HOF multiply every element 70.

    map not for loop if they want HOF.

    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: console.log.

    Project example: console.log.

  47. 47
    How do you execute a standalone JavaScript file?
    Times asked 1
    Official solution

    Simplenode file.js ya browser console / online editor (jsfiddle). DOM APIs node mein nahi.

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

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

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

    Project example: Related .vue method: filter/map ya async fetch.

  48. 48
    What is create_app() and what are its benefits?
    Times asked 1
    Official solution

    SimpleFactory: test/prod configs, circular imports kam, celery/cache bind. Multiple instances.

    What is create_app benefits. Flask(__name__) locate templates. Don't remove casually.

    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 create_app():
        app = Flask(__name__)
        db.init_app(app)
        cache.init_app(app)
        return app

    Project example: def create_app(): app=Flask; db.init; return app

  49. 49
    Why are underscores (_) used in Python?
    Times asked 1
    Official solution

    SimpleConvention _internal __dunder protocol. Not security.

    Why underscores used.

    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: _parse_row helper.

    Project example: _parse_row helper.

  50. 50
    What does jsonify() do?
    Times asked 1
    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])

  51. 51
    What makes an API RESTful?
    Times asked 1
    Official solution

    SimpleNouns URLs, verbs, JSON, stateless, codes.

    What makes an API RESTful.

    HTTP verbs + status REST ki zabaan. GET read, POST create, PUT replace, PATCH partial, DELETE remove. GET typically no body.

    Status: 200 OK, 201 created, 202 accepted (Celery task), 400 bad input, 401 no/bad token, 403 role nahi, 404 missing, 409 conflict (double book), 500 server.

    AJAX/fetch page reload nahi. SPA poori isi pe. Postman se bina Vue ke API prove karo — examiner pasand.

    Project example: Not /getVenue.

    Project example: Not /getVenue.

  52. 52
    What are the REST design principles?
    Times asked 1
    Official solution

    SimpleStateless resource URLs uniform interface verbs JSON HATEOAS optional.

    REST design principles. What makes API RESTful.

    HTTP verbs + status REST ki zabaan. GET read, POST create, PUT replace, PATCH partial, DELETE remove. GET typically no body.

    Status: 200 OK, 201 created, 202 accepted (Celery task), 400 bad input, 401 no/bad token, 403 role nahi, 404 missing, 409 conflict (double book), 500 server.

    AJAX/fetch page reload nahi. SPA poori isi pe. Postman se bina Vue ke API prove karo — examiner pasand.

    Project example: Our /venues/1 verbs.

  53. 53
    Are HTTP methods part of REST or HTTP itself?
    Times asked 1
    Official solution

    SimpleMethods belong HTTP. REST uses as convention. GET exists without REST.

    Are HTTP methods part of REST or HTTP itself? HTTP.

    HTTP verbs + status REST ki zabaan. GET read, POST create, PUT replace, PATCH partial, DELETE remove. GET typically no body.

    Status: 200 OK, 201 created, 202 accepted (Celery task), 400 bad input, 401 no/bad token, 403 role nahi, 404 missing, 409 conflict (double book), 500 server.

    AJAX/fetch page reload nahi. SPA poori isi pe. Postman se bina Vue ke API prove karo — examiner pasand.

    Project example: Browser GET HTML also HTTP.

  54. 54
    Which HTTP methods should contain a request body?
    Times asked 1
    Official solution

    SimplePOST PUT PATCH. GET/HEAD no. DELETE optional body.

    Which HTTP methods should contain request body.

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

    Project example: Postman.

  55. 55
    Difference between HTTP and HTTPS.
    Times asked 6
    Official solution

    SimpleHTTP postcard (koi padh le). HTTPS envelope (TLS lock).

    Same headers, encrypted channel. MITM se password/token bachao. Local viva HTTP OK.

    HTTP/1.1 version keep-alive. TCP neeche, TLS security layer, SMTP mail alag.

    Browser + API ke beech extra darwaze: CORS origin allow, HTTPS encrypt transit, CSRF cookie-auto-send attack, XSS HTML inject, SQL injection raw query.

    MAD2 SPA: Vue :8080 Flask :5000 → Flask-CORS. JWT localStorage XSS se chori ho sakta — v-html user input pe avoid. Password Network tab localhost pe dikhega; prod HTTPS, response mein password echo nahi.

    401 unauthenticated, 403 unauthorized, 400 validation. Hash one-way — SHA decrypt nahi hota. Secret key .env, GitHub pe nahi.

    Project example: Dev localhost http. Production https:// + cert.

    Viva tipProtocols: HTTP/HTTPS app, TCP transport, TLS security, SMTP mail. HTTP/1.1 version — persistent connections.

  56. 56
    What does HTTP/1.1 mean?
    Times asked 1
    Official solution

    SimpleHTTP/1.1 version request line. Host header keep-alive. 2/3 multiplexing later.

    What does HTTP/1.1 mean.

    HTTP verbs + status REST ki zabaan. GET read, POST create, PUT replace, PATCH partial, DELETE remove. GET typically no body.

    Status: 200 OK, 201 created, 202 accepted (Celery task), 400 bad input, 401 no/bad token, 403 role nahi, 404 missing, 409 conflict (double book), 500 server.

    AJAX/fetch page reload nahi. SPA poori isi pe. Postman se bina Vue ke API prove karo — examiner pasand.

    Project example: Network headers HTTP/1.1.

  57. 57
    Explain TLS.
    Times asked 1
    Official solution

    SimpleTLS handshake encrypt. HTTPS = HTTP over TLS. Certificates.

    Explain TLS.

    Browser + API ke beech extra darwaze: CORS origin allow, HTTPS encrypt transit, CSRF cookie-auto-send attack, XSS HTML inject, SQL injection raw query.

    MAD2 SPA: Vue :8080 Flask :5000 → Flask-CORS. JWT localStorage XSS se chori ho sakta — v-html user input pe avoid. Password Network tab localhost pe dikhega; prod HTTPS, response mein password echo nahi.

    401 unauthenticated, 403 unauthorized, 400 validation. Hash one-way — SHA decrypt nahi hota. Secret key .env, GitHub pe nahi.

    Project example: https padlock prod.

  58. 58
    Explain TCP.
    Times asked 1
    Official solution

    SimpleTCP reliable ordered bytes. HTTP usually TCP. UDP nahi HTTP.

    Explain TCP.

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

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

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

    Project example: Don't go packet-level unless asked.

    Project example: Don't go packet-level unless asked.

  59. 59
    What communication protocol is used between Vue and Flask?
    Times asked 1
    Official solution

    SimpleVue↔Flask HTTP/HTTPS JSON. TCP below. Auth Bearer. CORS.

    What communication protocol Vue and Flask. What protocols know HTTP HTTPS TCP TLS SMTP.

    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: REST JSON not gRPC.

  60. 60
    How can you access a server without using a browser?
    Times asked 1
    Official solution

    Simplecurl Postman httpie Thunder. Same HTTP.

    How access server without browser.

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

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

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

    Example

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

    Project example: curl demo.

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

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

  63. 63
    Difference between a Database and a Database Management System (DBMS).
    Times asked 1
    Official solution

    SimpleDatabase data. DBMS software (SQLite engine, Postgres) jo manage karta hai.

    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 User/Booking relationships. filter_by unique email.

  64. 64
    Which DBMS and database are you using?
    Times asked 1
    Official solution

    SimpleSQLite engine + file. Redis extra cache. Postgres if migrated.

    Which DBMS and database.

    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: URI string.

  65. 65
    Why is SQLite suitable for your application?
    Times asked 1
    Official solution

    SimpleZero config, one file submit, course size. Not heavy concurrent writes.

    Why suitable. Scale later Postgres.

    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: app.db instance folder.

  66. 66
    What enables SQL databases to scale efficiently?
    Times asked 1
    Official solution

    SimpleIndexes EXPLAIN pool replicas partition cache hot queries. What enables SQL scale.

    Not just bigger disk.

    MAD2 architecture: Vue SPA (client) → HTTP JSON → Flask API (server) → SQLAlchemy DB. Side path: Flask → Redis broker → Celery worker → MailHog/CSV.

    Client-server alag ports. State: Vue memory + LS token. Persistent: SQLite. Cache: Redis. MVC-ish: models.py, API views, Vue templates.

    Scale: more workers, Postgres, cache, not 'bigger SQLite file'.

    Project example: email index search.

    Project example: email index search.

  67. 67
    What is ORM?
    Times asked 39
    Official solution

    SimpleORM = translator. Python object bolo, woh SQL mein baat kare.

    Object Relational Mapper. Class User ↔ table user. Raw SQL kam.

    SQLAlchemy MAD1/MAD2. Fayde: portable SQLite→Postgres, relationships, parameterized queries (injection kam).
    Nuksaan: N+1, hidden SQL, complex reports pe raw better.

    Direct sqlite3 se SQLAlchemy isliye: models, switch DB, safer queries.

    Example

    class User(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        email = db.Column(db.String(128), unique=True)
    User.query.filter_by(email='a@b.com').first()

    Project example: models.py db.Model. resources User.query.filter_by. Koi f-string SQL nahi.

    Viva tipFayde: safe-ish, portable (SQLite→Postgres). Nuksaan: complex queries, N+1, leaky abstractions. Direct SQLite se SQLAlchemy isliye: models + injection protection + switch DB.

  68. 68
    Advantages of ORM.
    Times asked 5
    Official solution

    SimpleProductivity portability relationships. Disadv hidden SQL N+1 magic.

    Advantages of ORM. Disadvantages separate.

    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: Both sides ready.

  69. 69
    Disadvantages of ORM.
    Times asked 2
    Official solution

    SimpleComplex reports raw better. Perf surprise. Learning ORM.

    Disadvantages of ORM.

    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: N+1 example loop u.bookings.

  70. 70
    What are ENUMs?
    Times asked 1
    Official solution

    SimpleENUM allowed values set. App-level choices bhi. Status pending/approved.

    What are ENUMs.

    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: status string with check or Enum.

    Project example: status string with check or Enum.

  71. 71
    What is __tablename__? Is it mandatory?
    Times asked 1
    Official solution

    Simple__tablename__ explicit. Hatao class→user auto. Explicit rename/legacy better.

    Is it mandatory? No. Why use: control name reserved stable migrations. Remove → autogenerate maybe change.

    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

    class User(db.Model):
        __tablename__ = 'users'

    Project example: class User __tablename__='users'.

  72. 72
    How do you restrict password length at the database level?
    Times asked 1
    Official solution

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

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

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

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

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

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

  73. 73
    How would you migrate from SQLite to another database?
    Times asked 1
    Official solution

    SimpleURI badlo, types BOOLEAN, migrations, dump/load. Models almost same.

    SQLite to Postgres. Production gunicorn+hosted Redis.

    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

    SQLALCHEMY_DATABASE_URI = 'postgresql://user:pass@localhost/mad2'

    Project example: SQLALCHEMY_DATABASE_URI postgresql://...

    Viva tipProduction: Postgres + gunicorn + Redis hosted. SQLite file locking 10k users pe nahi.

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

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

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

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

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

    Example

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

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

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

  75. 75
    How does Session authentication work?
    Times asked 1
    Official solution

    SimpleSet-Cookie session id server dict user_id. Next request cookie. Logout destroy. How Session authentication works.

    MAD1 style. MAD2 if not used say JWT instead.

    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: If JWT, contrast.

  76. 76
    Pros and cons of JWT.
    Times asked 1
    Official solution

    Simple

    Faydestateless, mobile. Nuksaan: revoke hard, size, XSS LS, payload visible.

    Balance with httpOnly + short exp.

    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: We accepted LS risk for course simplicity.

  77. 77
    What is a Rainbow Table attack?
    Times asked 1
    Official solution

    SimplePrecomputed hash→password tables. Unique salt per user se useless. Slow hash.

    Why hashing + salt viva combo.

    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: Werkzeug salts included in hash string.

  78. 78
    What hashing algorithm was used in MAD1?
    Times asked 1
    Official solution

    SimpleMAD1 commonly Werkzeug generate_password_hash pbkdf2:sha256. Show YOUR code.

    Don't guess bcrypt if not.

    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: Open hash string prefix.

    Project example: Open hash string prefix.

  79. 79
    What is SHA-256?
    Times asked 1
    Official solution

    SimpleSHA-256 hash 256-bit. Passwords: pbkdf2/bcrypt not raw SHA. Decrypt nahi.

    Verify hash(input)==stored.

    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: Werkzeug pbkdf2:sha256 typical MAD1/MAD2.

  80. 80
    Can SHA-256 be decrypted?
    Times asked 1
    Official solution

    SimpleSHA-256 one-way, decrypt nahi. Brute/rainbow only. Salt+slow.

    Can SHA be decrypted? No.

    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: Don't say encrypt passwords.

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

  82. 82
    What is Celery?
    Times asked 17
    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.

  83. 83
    Difference between Celery Worker and Celery Beat.
    Times asked 2
    Official solution

    SimpleBeat clock hai, Worker haath hai. Clock kaam nahi karti, haath nahi sochte kab.

    Worker: @celery.task execute. Beat: crontab padhke due time pe queue mein daal.
    Sirf worker = scheduled nahi. Sirf beat = queue bhar jaaye, koi run nahi.

    Dono ke saath redis-server. Logs mein 'Sending due task' Beat, 'Task succeeded' Worker.

    Example

    celery -A app.celery worker -l info
    celery -A app.celery beat -l info

    Project example: daily_reminder Beat 18:00. Worker MailHog. Export worker-only (button).

    Viva tipSirf worker = scheduled jobs nahi chalenge. Sirf beat = queue bhar jaaye, koi run nahi karega.

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

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

  86. 86
    Do cached values always need to be stored in Redis database index 1?
    Times asked 1
    Official solution

    Simpledata() local diary. Store school notice board.

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

    state vs data: similar concept, scope alag.

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

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

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

    Example

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

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

  87. 87
    What is in-memory storage?
    Times asked 1
    Official solution

    SimpleIn-memory = RAM. Tez, volatile. Process band to data gayab (unless dump).

    Redis, Memcached, Python dict. Dict multi-worker gunicorn mein share nahi hota — isliye Redis.

    DB persistent disk. Cache in-memory theek, bookings nahi.

    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: Cache Redis RAM. Users table SQLite file.

  88. 88
    How do Flask, Celery, Redis, and Vite interact?
    Times asked 1
    Official solution

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

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

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

    Example

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

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

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

  89. 89
    Where is Redis physically storing its data?
    Times asked 1
    Official solution

    SimpleData Redis process ki RAM mein rehta hai, laptop ke browser mein nahi.

    Optional RDB/AOF files disk pe dump. Viva default: memory. Server-side.

    redis-cli ping, INFO memory. Browser Application tab alag cheez (JWT).

    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: Flask machine pe redis-server. Vue sirf API call — Redis client nahi.

  90. 90
    What is position: absolute in CSS?
    Times asked 1
    Official solution

    Simpleabsolute nearest positioned parent. Navbar bottom fixed bottom 0. What is position absolute.

    relative absolute fixed sticky.

    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: Live navbar move.

  91. 91
    What do the four RGBA values represent?
    Times asked 1
    Official solution

    SimpleR G B 0–255, A 0–1 transparency. Four RGBA values.

    What do four RGBA represent.

    Look: Bootstrap utility classes (margin m-3, flex, grid) ya khud CSS. Responsive = media query / Bootstrap breakpoints se mobile.

    Vue scoped style leak nahi. :class binding. Examiner colour/button live change maange to DevTools nahi, source class dikhao.

    CSS ≠ Bootstrap. Bootstrap CSS+JS framework. Inline style last resort.

    Project example: background: rgba(0,0,0,0.5).

    Project example: background: rgba(0,0,0,0.5).

  92. 92
    What is Client-Server Architecture?
    Times asked 1
    Official solution

    SimpleClient Vue maangta, server Flask dete. Request-response.

    Distributed extra nodes. Protocol HTTP JSON.

    MAD2 architecture: Vue SPA (client) → HTTP JSON → Flask API (server) → SQLAlchemy DB. Side path: Flask → Redis broker → Celery worker → MailHog/CSV.

    Client-server alag ports. State: Vue memory + LS token. Persistent: SQLite. Cache: Redis. MVC-ish: models.py, API views, Vue templates.

    Scale: more workers, Postgres, cache, not 'bigger SQLite file'.

    Project example: Browser client. flask run server.

    Project example: Browser client. flask run server.

  93. 93
    What protocols do you know? (HTTP, HTTPS, TCP, TLS, SMTP, etc.)
    Times asked 1
    Official solution

    SimpleHTTP postcard (koi padh le). HTTPS envelope (TLS lock).

    Same headers, encrypted channel. MITM se password/token bachao. Local viva HTTP OK.

    HTTP/1.1 version keep-alive. TCP neeche, TLS security layer, SMTP mail alag.

    Browser + API ke beech extra darwaze: CORS origin allow, HTTPS encrypt transit, CSRF cookie-auto-send attack, XSS HTML inject, SQL injection raw query.

    MAD2 SPA: Vue :8080 Flask :5000 → Flask-CORS. JWT localStorage XSS se chori ho sakta — v-html user input pe avoid. Password Network tab localhost pe dikhega; prod HTTPS, response mein password echo nahi.

    401 unauthenticated, 403 unauthorized, 400 validation. Hash one-way — SHA decrypt nahi hota. Secret key .env, GitHub pe nahi.

    Project example: Dev localhost http. Production https:// + cert.

    Viva tipProtocols: HTTP/HTTPS app, TCP transport, TLS security, SMTP mail. HTTP/1.1 version — persistent connections.

  94. 94
    Why do we use a virtual environment (venv)?
    Times asked 1
    Official solution

    Simplevenv isolated Python packages. system Python safe. requirements.txt freeze.

    Need virtual environment. Node not inside it.

    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: .venv pip install -r.

  95. 95
    Are Node modules installed inside the virtual environment?
    Times asked 1
    Official solution

    SimpleNahi. pip venv Python. npm node_modules project root. Alag ecosystems.

    Examiner trap yes/no. Confident no.

    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: ls .venv vs ls node_modules.

    Project example: ls .venv vs ls node_modules.

  96. 96
    Where are Node modules stored?
    Times asked 1
    Official solution

    Simplenpm install se project/node_modules. venv Python ka.

    package-lock delete to resolve drift. Commit lockfile.

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

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

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

    Project example: Don't zip node_modules usually — npm install.

  97. 97
    What is Vite?
    Times asked 1
    Official solution

    SimpleVite fast dev server (ESM) + production Rollup build.

    npm run dev HMR. build → dist. Flask static serve dist. Dev bina build OK.

    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: vite.config.js. ports 5173.

    Viva tipDev server haan. Production: dist/ static files Flask serve karta hai. npm run build ke bina npm run dev zaroori nahi.

  98. 98
    Does Vite act as a development server?
    Times asked 1
    Official solution

    SimpleHaan, npm run dev development server + HMR. Prod nginx/flask dist.

    Not the same as flask run.

    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: Two URLs :5173 UI :5000 API.

  99. 99
    What else does Vite provide?
    Times asked 1
    Official solution

    SimpleHMR plugin Vue env import.meta.env optimize deps preview. What else does Vite provide.

    besides dev server.

    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: vite.config plugins.

  100. 100
    Do you need to run npm run build before npm run dev?
    Times asked 1
    Official solution

    SimpleDev ke liye build zaroori nahi. Prod/static: npm run build.

    Order: npm install, npm run dev. Build before dev nahi.

    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: README scripts.

    Project example: README scripts.

  101. 101
    What happens if package-lock.json is deleted?
    Times asked 1
    Official solution

    SimpleLockfile exact versions. Delete → next install bump. Builds differ.

    Commit package-lock.json.

    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: git status lockfile.

    Project example: git status lockfile.

  102. 102
    Can you regenerate the dist folder after deleting it?
    Times asked 1
    Official solution

    Simpledist production bundle. Delete → npm run build regenerate. Dev mode dist optional.

    Examiner delete dist. CLI yes. CDN maybe no dist.

    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: npm run build && flask serve.

  1. 1
    Explain the project directory structure.
    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.

  2. 2
    Explain the project architecture (MVC).
    Times asked 1
    Official solution

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

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

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

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

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

  4. 4
    Explain the codebase.
    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.

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

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

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

    Example skeleton

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

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

  6. 6
    Explain one controller/route in detail and why it is used.
    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.

  7. 7
    Show the APIs in your project.
    Times asked 1
    Official solution

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

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

  8. 8
    Explain how requests are handled in your 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.

  9. 9
    If you had more time, what improvements would you make?
    Times asked 2
    Official solution

    Simple2-3 honest improvements + 1 security + 1 UX.

    Example

    password hashing/CSRF tighter, Redis cache, tests, pagination, email verify, rate limit login, better mobile CSS.

    Challenges: relationships/cascade, concurrent booking, Jinja inheritance.
    Rate: 7-8/10 with reason — 10/10 arrogant, 3/10 confidence khatam.
    Security extra: HTTPS, hashed passwords, CSRF, SQL injection (ORM), login attempts, file type check.

  10. 10
    Advantages and disadvantages of SQLite.
    Times asked 2
    Official solution

    SimpleSQLite file-based chhota DB, MySQL/Postgres server-based production DB.

    SQLite fayde: zero setup, ek .db file, MAD1/dev ke liye perfect, portable.

    Nuksaanconcurrent writes kam, user/password nahi, network access nahi, production scale nahi.

    MySQL: users, permissions, concurrent, replica. App factory mein URI change karke switch: sqlite:///app.db → mysql://...

  11. 11
    What is lazy loading in SQLAlchemy?
    Times asked 1
    Official solution

    SimpleSQLAlchemy Python ka sabse popular ORM hai. MAD1 mein Flask-SQLAlchemy wrapper use hota hai.

    db = SQLAlchemy(app)

    class Book(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        title = db.Column(db.String(80), nullable=False)
    
    Operations: db.session.add(obj), .commit(), .delete(obj), Model.query.all(), .filter_by(), .get_or_404(id).
    db.Model ek class hai (function nahi). db object engine + session + metadata hold karta hai.

    SQLALCHEMY_TRACK_MODIFICATIONS=False extra signals band karta hai, performance warning hatati hai.

  12. 12
    Explain lazy loading parameters/options.
    Times asked 1
    Official solution

    Simplelazy loading related objects tab load karta hai jab attribute access karte ho, pehle nahi.

    user = User.query.get(1)  # posts query nahi

    user.posts # ab query

    lazy=True / 'select' default. lazy='joined' eager join. lazy='dynamic' query object.
    uselist=False One-to-One (single object, list nahi). Hataoge to list mil sakti hai.
    Frontend lazy loading images alag cheez hai (viewport mein aaye tab load).

  13. 13
    Is your database normalized? Explain.
    Times asked 1
    Official solution

    SimpleNormalization data ko split karke redundancy aur update-anomalies kam karti hai.

    1NF: atomic values, repeating groups nahi (comma-separated skills mat rakho).
    2NF: 1NF + non-key columns poori PK pe depend (composite keys pe).
    3NF: 2NF + non-key columns ek doosre pe depend na hon (city→state alag table).

    Examplehar booking mein user ka poora address copy vs user_id se User table.

    MAD1 project generally 3NF ke kareeb. Higher NF (BCNF) theoretically, practical apps denormalize speed ke liye (cached counts).
    Leaderboard: alag table better agar history/rank chahiye; sirf count hai to query se bhi ho sakta hai.

  14. 14
    What is normalization?
    Times asked 2
    Official solution

    SimpleNormalization data ko split karke redundancy aur update-anomalies kam karti hai.

    1NF: atomic values, repeating groups nahi (comma-separated skills mat rakho).
    2NF: 1NF + non-key columns poori PK pe depend (composite keys pe).
    3NF: 2NF + non-key columns ek doosre pe depend na hon (city→state alag table).

    Examplehar booking mein user ka poora address copy vs user_id se User table.

    MAD1 project generally 3NF ke kareeb. Higher NF (BCNF) theoretically, practical apps denormalize speed ke liye (cached counts).
    Leaderboard: alag table better agar history/rank chahiye; sirf count hai to query se bhi ho sakta hai.

  15. 15
    What is referential integrity?
    Times asked 1
    Official solution

    SimpleConstraints rules hain jo galat data rok te hain. Referential integrity FK valid parent ko point kare.

    PK, FK, UNIQUE, NOT NULL, CHECK (age >= 18). ORM Column flags yahi map karte hain.
    SQL = language tables se baat. Database organized data store.
    SQL View: saved query, table jaisi dikhti hai, data copy nahi.
    Cluster: kai DB servers together (HA/scale) — MAD1 SQLite single file.
    Entity mapping: class User → table user, attributes → columns.

  16. 16
    Explain different database keys (Primary, Foreign, Candidate, etc.).
    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.

  17. 17
    What is backref?
    Times asked 10
    Official solution

    Simplebackref relationship ki reverse side automatically bana deta hai.

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

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

  18. 18
    Difference between backref and back_populates.
    Times asked 10
    Official solution

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

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

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

    Example

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

    Yahan Post.author automatically mil jaata hai.

    Explicit version:

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

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

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

  20. 20
    What is a REST API?
    Times asked 1
    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.

  21. 21
    Are there alternatives to REST? (e.g., GraphQL)
    Times asked 1
    Official solution

    SimpleREST multiple URLs/resources, GraphQL ek endpoint se exactly jo fields chahiye woh maango.

    REST: GET /users/1, GET /users/1/posts — extra/under fetching ho sakti hai.
    GraphQL: { user(id:1) { name posts { title } } } — ek call.
    MAD1 REST/HTTP routes use karta hai; GraphQL extra complexity.

  22. 22
    What are the advantages of GraphQL over REST?
    Times asked 1
    Official solution

    SimpleREST multiple URLs/resources, GraphQL ek endpoint se exactly jo fields chahiye woh maango.

    REST: GET /users/1, GET /users/1/posts — extra/under fetching ho sakti hai.
    GraphQL: { user(id:1) { name posts { title } } } — ek call.
    MAD1 REST/HTTP routes use karta hai; GraphQL extra complexity.

  23. 23
    How would you implement search/filter using JavaScript only?
    Times asked 1
    Official solution

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

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

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

  24. 24
    How would you implement the same feature using Flask API endpoints?
    Times asked 1
    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.

  25. 25
    What is the DOM?
    Times asked 3
    Official solution

    SimpleDOM = Document Object Model — HTML ka tree jo browser memory mein banata hai. JS isi ko change karta hai.

    document.getElementById('btn').style.color = 'red'
    Jinja server pe HTML banata hai, phir browser DOM parse karta hai. Vue DOM ko reactive update karta hai.

  26. 26
    Types of CSS (Inline, Internal, External).
    Times asked 3
    Official solution

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

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

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

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

  27. 27
    CSS precedence/specificity.
    Times asked 1
    Official solution

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

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

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

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

  28. 28
    What happens when multiple CSS classes are applied to the same element?
    Times asked 1
    Official solution

    Yeh live UI/CSS change hai. Examiner jo element bole uski CSS turant badlo.

    Bootstrap class badlo (btn-primary → btn-success, bg-dark → bg-warning) ya inline style='color:red; background:#eee'.
    Center: d-flex justify-content-center text-center. Navbar neeche: navbar fixed-bottom.

    Example

    <button class='btn btn-success' style='background:#16a34a'>Book</button>

    Pehle browser inspect karke class dhundo, phir template mein change karke refresh.

  29. 29
    Explain template inheritance with an example.
    Times asked 1
    Official solution

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

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

    base.html:

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

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

  30. 30
    Center a text element on the page.
    Times asked 1
    Official solution

    Simpleexaminer UI tweak maangta hai — CSS class ya inline, instantly dikhao.

    Button color: <button class='btn btn-success'> ya style='background:#22c55e;color:#fff'
    Navbar: navbar-dark bg-success / style='background:yellow' / fixed-bottom se neeche.
    Center: .wrap { display:flex; justify-content:center; align-items:center; min-height:100vh; }
    text-align:center heading ke liye. Bootstrap: d-flex justify-content-center, mx-auto, text-center.
    Hover: .btn:hover { opacity:0.8; transform:scale(1.02); }
    Half width: class='col-6' ya width:50%. Row→column: flex-direction:column / col-12 stack.
    Login card: card shadow p-4 mx-auto (max-width:400px).
    Table header green: th { background:green; color:white; } Bold column: td:nth-child(2){font-weight:bold}
    Box shadow: box-shadow: 4px 4px 12px rgba(0,0,0,.3);
    Background image: body { background: url('/static/bg.jpg') center/cover; }
    Reset button: <button type='reset'>Clear</button>
    Move button: ms-auto / position / flex order.
    Jinja dashboard heading: <h1>{{ user.name }}'s Dashboard</h1>

  31. 31
    Center a <div> on the page.
    Times asked 1
    Official solution

    Simpleexaminer UI tweak maangta hai — CSS class ya inline, instantly dikhao.

    Button color: <button class='btn btn-success'> ya style='background:#22c55e;color:#fff'
    Navbar: navbar-dark bg-success / style='background:yellow' / fixed-bottom se neeche.
    Center: .wrap { display:flex; justify-content:center; align-items:center; min-height:100vh; }
    text-align:center heading ke liye. Bootstrap: d-flex justify-content-center, mx-auto, text-center.
    Hover: .btn:hover { opacity:0.8; transform:scale(1.02); }
    Half width: class='col-6' ya width:50%. Row→column: flex-direction:column / col-12 stack.
    Login card: card shadow p-4 mx-auto (max-width:400px).
    Table header green: th { background:green; color:white; } Bold column: td:nth-child(2){font-weight:bold}
    Box shadow: box-shadow: 4px 4px 12px rgba(0,0,0,.3);
    Background image: body { background: url('/static/bg.jpg') center/cover; }
    Reset button: <button type='reset'>Clear</button>
    Move button: ms-auto / position / flex order.
    Jinja dashboard heading: <h1>{{ user.name }}'s Dashboard</h1>

  32. 32
    Change the shadow of a box (offsets, blur, RGBA color).
    Times asked 1
    Official solution

    Simpleexaminer UI tweak maangta hai — CSS class ya inline, instantly dikhao.

    Button color: <button class='btn btn-success'> ya style='background:#22c55e;color:#fff'
    Navbar: navbar-dark bg-success / style='background:yellow' / fixed-bottom se neeche.
    Center: .wrap { display:flex; justify-content:center; align-items:center; min-height:100vh; }
    text-align:center heading ke liye. Bootstrap: d-flex justify-content-center, mx-auto, text-center.
    Hover: .btn:hover { opacity:0.8; transform:scale(1.02); }
    Half width: class='col-6' ya width:50%. Row→column: flex-direction:column / col-12 stack.
    Login card: card shadow p-4 mx-auto (max-width:400px).
    Table header green: th { background:green; color:white; } Bold column: td:nth-child(2){font-weight:bold}
    Box shadow: box-shadow: 4px 4px 12px rgba(0,0,0,.3);
    Background image: body { background: url('/static/bg.jpg') center/cover; }
    Reset button: <button type='reset'>Clear</button>
    Move button: ms-auto / position / flex order.
    Jinja dashboard heading: <h1>{{ user.name }}'s Dashboard</h1>

  33. 33
    Change the size of a container.
    Times asked 1
    Official solution

    Simpleexaminer UI tweak maangta hai — CSS class ya inline, instantly dikhao.

    Button color: <button class='btn btn-success'> ya style='background:#22c55e;color:#fff'
    Navbar: navbar-dark bg-success / style='background:yellow' / fixed-bottom se neeche.
    Center: .wrap { display:flex; justify-content:center; align-items:center; min-height:100vh; }
    text-align:center heading ke liye. Bootstrap: d-flex justify-content-center, mx-auto, text-center.
    Hover: .btn:hover { opacity:0.8; transform:scale(1.02); }
    Half width: class='col-6' ya width:50%. Row→column: flex-direction:column / col-12 stack.
    Login card: card shadow p-4 mx-auto (max-width:400px).
    Table header green: th { background:green; color:white; } Bold column: td:nth-child(2){font-weight:bold}
    Box shadow: box-shadow: 4px 4px 12px rgba(0,0,0,.3);
    Background image: body { background: url('/static/bg.jpg') center/cover; }
    Reset button: <button type='reset'>Clear</button>
    Move button: ms-auto / position / flex order.
    Jinja dashboard heading: <h1>{{ user.name }}'s Dashboard</h1>

  34. 34
    Change the color of a container.
    Times asked 1
    Official solution

    Simpleexaminer UI tweak maangta hai — CSS class ya inline, instantly dikhao.

    Button color: <button class='btn btn-success'> ya style='background:#22c55e;color:#fff'
    Navbar: navbar-dark bg-success / style='background:yellow' / fixed-bottom se neeche.
    Center: .wrap { display:flex; justify-content:center; align-items:center; min-height:100vh; }
    text-align:center heading ke liye. Bootstrap: d-flex justify-content-center, mx-auto, text-center.
    Hover: .btn:hover { opacity:0.8; transform:scale(1.02); }
    Half width: class='col-6' ya width:50%. Row→column: flex-direction:column / col-12 stack.
    Login card: card shadow p-4 mx-auto (max-width:400px).
    Table header green: th { background:green; color:white; } Bold column: td:nth-child(2){font-weight:bold}
    Box shadow: box-shadow: 4px 4px 12px rgba(0,0,0,.3);
    Background image: body { background: url('/static/bg.jpg') center/cover; }
    Reset button: <button type='reset'>Clear</button>
    Move button: ms-auto / position / flex order.
    Jinja dashboard heading: <h1>{{ user.name }}'s Dashboard</h1>

  35. 35
    Make minor HTML/CSS styling adjustments.
    Times asked 1
    Official solution

    Yeh live UI/CSS change hai. Examiner jo element bole uski CSS turant badlo.

    Bootstrap class badlo (btn-primary → btn-success, bg-dark → bg-warning) ya inline style='color:red; background:#eee'.
    Center: d-flex justify-content-center text-center. Navbar neeche: navbar fixed-bottom.

    Example

    <button class='btn btn-success' style='background:#16a34a'>Book</button>

    Pehle browser inspect karke class dhundo, phir template mein change karke refresh.

  36. 36
    What is authentication?What is authorization?
    Times asked 1
    Official solution

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

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

    Example (Flask):
    # Authentication

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

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

  37. 37
    Explain different types of testing.
    Times asked 1
    Official solution

    SimpleTesting code sahi hai verify. Unit = chhote functions, Integration = route+DB, System = poora flow.

    Pytest: test_*.py, assert. Markers: @pytest.mark.slow skip/select. Keywords: pytest -k login.
    Unit testing se regression kam, viva ke alawa CI mein fayda. Manual: demo scenarios (overbook, blacklist).

  38. 38
    Explain filters and how they work in your project.
    Times asked 1
    Official solution

    Yeh list filter/sort/display task hai. Query badlo, template same rakh sakte ho.

    rows = Model.query.filter_by(status='approved').order_by(Model.name.asc()).all()

    Jinja: {% for r in rows %}<tr><td>{{ r.name|upper }}</td></tr>{% endfor %}

    {{ rows|length }} count dikhane ke liye.

    Alphabet sort: order_by(Model.name). Status filter: filter_by(status='pending').
    Assigned staff column: relationship se {{ booking.staff.name }}.

  39. 39
    How would you add a new filter?
    Times asked 1
    Official solution

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

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

    Example naya field 'city':

    user.city = db.Column(db.String(50))
    user.city = request.form.get('city')
    <input name='city'>  ...  {{ user.city }}
  40. 40
    Implement a feature to allow only one ad request per influencer in a campaign.
    Times asked 1
    Official solution

    Yeh live coding / notepad task hai. Chhota, correct Flask snippet likho.

    from flask import Flask, render_template, request, redirect, url_for
    @app.route('/do', methods=['GET','POST'])
    def do():
        if request.method == 'POST':
            # request.form.get('field') ya request.args.get('q')
            # db.session.add(...); commit
            return redirect(url_for('dashboard'))
        items = Model.query.all()
        return render_template('page.html', items=items)

    Jinja: {% for x in items %}<li>{{ x.name }}</li>{% endfor %}
    ID URL: @app.route('/item/<int:id>')

  41. 41
    Implement a check to prevent multiple ad requests without modifying models.py.
    Times asked 1
    Official solution

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

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

    Example skeleton

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

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

  42. 42
    Modify the request handling logic and explain the changes.
    Times asked 1
    Official solution

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

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

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

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

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

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