Viva prep · Real questions · Student experiences Enroll in Bootcamp

Proctor workspace

Proctor Level1_119

Share your experience Add your viva experience here
139 Questions
2 Sets
0 Topics
10 Reviews
Tips for this examiner: Always read-up everything on your implementation. Anything you have added/worked on should be known thoroughly because he will ask you to tweak it in some way.

Student reviews

Sheet response MAD1

Shared viva questions from response sheet: first checksum then run the app (no demo) and just after that a coding problem where he asked ##"(you have to create a form from scratch take user name as input and have a dropdown in the form itself where you have to show the option to select all the lots which are available in the database (updated dynamically)and a search button ,On seach you have to fetch the data of all the spots which are...

Questions remembered
  1. first checksum then run the app (no demo) and just after that a coding problem where he asked ##"(you have to create a form from scratch take user name as input and have a dropdown in the form itself where you have to show the option to select all the lots which are available in the database (updated dynamically)and a search button ,On seach you have to fetch the data of all the spots which are booked by that user on the selected lot)"## also asked for some models.py AND routes explaination Its not all but this is what i can remember
  2. What is usermixin and why use it in Db
  3. Explain your __init__ file (basically app setup)
  4. What is ORM
  5. Difference in cell pading and spacing
  6. What is VCs and can you give an example
  7. What will happen if your remove secret key ,which features will be effected on on app
  8. What is metadata used for in html
  9. Can flask return boolean
Sheet response MAD1

no need to worry just be thorough with the code you have written

Questions remembered
  1. -Download project from portal no checksum
  2. -Directly asked to create a template and a route to create a dropdown having options as lot names
  3. -Asked to show each file
  4. -As i used wrap function from functools asked where it is implemented in code and purpose of the function
  5. -Relation between flash msg and secret key
  6. -Template inheritance, cellpadding and cellspacing
  7. -Version control system
Sheet response MAD1

Examiner is chill.
Asked if I can see matplotlib documentation he allowed.
I also asked for MDN docs of HTML I knew it was too much but I was going wrong in the <select> tag (used list instead of <option> tag) as expected he didn't allow.
Overall he was polite and gave time for answering, didn't rush.
Viva got over in 30 mins

Questions remembered
  1. MAD1 Viva level 2
  2. ID, checksum
  3. As usual demo (stopped midway )
  4. Asked to explain models.py
  5. Code changes
  6. - Change colors in pie chart
  7. - New page with dropdown having all parking lots
  8. Theory
  9. - What is Version Control System , One example
  10. - What is metadata in http request
  11. - What is db.func.count (Its an aggregate function)
  12. - Why is secret key needed in a session
  13. - Priority order in CSS (the inline, internal, external priority thing)
  14. - Can a flask endpoint return a boolean
Anonymous MAD1

Make sure to thoroughly go through the models.py and app.py. Once hes convinced you thoroughly understand each and every word of these two files, he wont test you further by asking more theory questions. The proctor should just be convinced you have understood the backend ie the controller part and then he lets you leave early.

Questions remembered
  1. I began explaining the code models.py and app.py, the proctor never interrupted in between.
  2. I explained for 25-30 mins, then the proctor asked me whats UserMixin and followingly he told me to explain any 1 create route and login/logout route.
  3. He then gave the coding question to fetch date as given in the previous excel row for the same proctor.
Sheet response MAD1

For theory questions - be really thorough on every line you write in your application. As long as you know the purpose of it, you'll be good.

For practical - if you are asked to write both front and backend, take a moment to plan which template you are going to use for this. For instance, since he asked input text field, I just reused the login form html page (changed input type to password) for the input. And then made few changes and wrote the route. But I could have done that earlier and saved some time which I could have used for writing the backend code.

Questions remembered
  1. I was explaining my code in detail, he later mentioned that I had already answered many of the questions he had planned to ask in the Viva during my explanation. So he just asked me 1 coding question:
  2. - Add a page to your application which should have a textbox input field that takes the date as input and it should return the list of parking lots that have atleast been parked in once on that given date. The list should be unique (i.e. no repetitions, even if that parking lot had 2 parkings on that date, its name should appear only once) and the list should be arranged in alphabetical order of parking lot name. Basically create both front end and backend for this. He initially gave me 10 min to do it, I was not able to complete. He gave me 10 more min, I was almost done but could not finish. But I explained the code I had written so far and also told him what remaining code I would have written if I had time. He confirmed that it was correct.
Sam MAD1

Know your code well like what elements are used everything

Questions remembered
  1. My level 2 question:
  2. asked me the overview of the code like file structure and all
  3. What do u understand by import flask.sqlalchemy in database.py
  4. What is the use of secret key
  5. How are session stored
  6. Asked to sort the subjects
  7. Change the subject name to uppercase
  8. What is template inheritance
  9. What is included and extend
  10. How do we use put method And I think maybe more I don't remember clearly
Chinmoy MAD1

No normal guy

Questions remembered
  1. Same as earlier vivas
  2. New question asked between impude and extends in Jinja
  3. Asked me to sort
  4. Also asked me to change to upper case
Mohd Afsar MAD1

All the Best for Your Viva!

Make sure to thoroughly review your entire code and understand why you wrote every single line. The proctor will likely review your code in detail and ask random questions, so be prepared to handle any modifications or changes they might request.

Focus especially on your models, how you've defined them, and how you've implemented relationships. Pay extra attention to concepts like backref, lazy, and any custom logic you've used.

Just be confident! If there's any question you don't know the answer to, it's better to admit it honestly rather than trying to guess or over-explain unnecessarily.

And don’t worry too much—proctors usually try to wrap up the viva quickly. Best of luck, you've got this! 👍

Questions remembered
  1. Questions I Remember From My MAD-1 Viva-2:
  2. Provide an overview of your project structure. Explain where different folders and files are located in your directory.
  3. Run your application now.
  4. Show your models.py. Explain all the tables and models defined in it.
  5. What is Enum, and what does it do?
  6. What is backref in relationships? What is its purpose, and why did you use it?
  7. What does lazy=True mean in relationships? Why is it written?
  8. In the Admin model (or table), why did you use @staticmethod? What is its purpose, and where did you call this method?
  9. Show the login form you created, including both the frontend and backend logic.
  10. What is the name attribute in the input tag, and what does it do?
  11. What is the difference between the name and value attributes in an input tag?
  12. How are you storing sessions in the backend? (This led to an in-depth discussion as you implemented a different logic.)
  13. Show how you implemented the logout functionality and explain the logic behind it.
  14. Demonstrate your project on the web interface.
  15. On the Admin dashboard, show how you can sort all service requests alphabetically by the customer's name.
  16. In the frontend code, make a change such that the customer's address in the service request table appears in all capital letters.
  17. What is template inheritance?
  18. What is the difference between CSS spacing and CSS padding?
  19. Have you used any APIs in your project? What is a RESTful API?
Abishek M MAD1

Viva was over within 17 minutes. Seemed calm. If you dont know anything, just say right away cos u dont wanna waste his time or yours. Tell I dont know and he says its okay & moves onto another question. 8/10

Questions remembered
  1. Walkthrough (within 5 minutes)
  2. Modify ur code such that all services are in Capital Letters
  3. Modify ur code such that the price of the service is stored with decimals (after division by 1000)
  4. What is ORM?
  5. What is Restful API
  6. What is .a in ur CSS code?
  7. Difference between using # & . in CSS
  8. What happens if your HTML files are in a different folder instead of templates?
  9. What is template inheritance?
  10. Difference between redirect & render_template?
  11. What will you do to add a service ? (Show demo)
Anshul MAD1

Always read-up everything on your implementation. Anything you have added/worked on should be known thoroughly because he will ask you to tweak it in some way.

Questions remembered
  1. - Use of a virtual env
  2. - What is ORM and usage?
  3. - What is MVC arch? Follow up q: What are the other types of architectures.
  4. - What is template inheritance in Jinja?
  5. - Use of APIs?
  6. - Use of Javascript
  7. - Explain CORS (since I mentioned it)
  8. - For my summary page, he asked me to change code to swap the two graphs positions(easy)
  9. - For a customer making a booking, my approach was choosing a date, he asked me to change code so it always defaults to take todays' date - 1 day (have to use datetime library flask along with timedelta)
  10. - Use of ChartJS?
  11. - How does data get sent from backend to frontend?
  12. - Why is all html files defaulted to a 'templates' folder? If we change 'templates' to any other name, where in code do we change so it detects this folder for our html files?

Approved viva sets

  1. 1
    Demonstrate your application (if asked).
    Times asked 1
    Official solution

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

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

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

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

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

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

  2. 2
    Explain models.py and app.py.
    Times asked 1
    Official solution

    Simplemodels.py tables ki blueprint. Har class ek table, har Column ek field.

    PK id, FK dusri table, relationship dono taraf, serialize() JSON (password mat).
    app factory db.init. resources APIs use models.

    Examiner random line: type, nullable, unique, ondelete.

    Suggested flow1) Har table → class
    2) PK id
    3) FK
    4) relationship()
    5) serialize()

    Example

    class Booking(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
        user = db.relationship('User', back_populates='bookings')

    Project example: User, Role, Venue/Show/Booking (ya Drive/Application). Draw 1-M.

    Viva tipExaminer random line poochhe: column type, FK, constraint. Draw 1-M / M-M on paper mentally.

  3. 3
    Explain how Flask handles a request from arrival to response.
    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.

  4. 4
    How does Flask decide which function should handle a request? (WSGI)
    Times asked 1
    Official solution

    SimpleWSGI contract: server Flask ko call kare. Werkzeug routing URL→view.

    gunicorn WSGI prod. Flask dev server nahi prod. How Flask decides function: URL map + method.

    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.

    Project example: Dev flask run. Prod idea gunicorn wsgi:app.

  5. 5
    Explain the route where emails are sent (using Postman).
    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 how the admin is able to view uploaded resumes/files.
    Times asked 1
    Official solution

    Simpleuploads/ save. Admin authenticated GET send_from_directory. Public URL mat. How admin view resumes.

    Files not in DB blob usually.

    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: static/uploads + auth route.

  7. 7
    Explain the resources you used to build the project (courses, AI, documentation, etc.).
    Times asked 1
    Official solution

    SimpleLectures, Vue/Flask docs, SO, thoda AI. Copy samajh ke modify + example.

    Courses AI documentation.

    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: One docs page you used crontab.

    Project example: One docs page you used crontab.

  8. 8
    How much AI did you use while building the project?
    Times asked 1
    Official solution

    SimpleSach % + kahan + kaise verify + kya seekha. Report se contradict mat.

    Boilerplate vs business logic. Examiner process poochta. 'Sab ChatGPT' red flag.

    Verify: docs, run, edge case. Seekha: CORS, JWT exp, beat vs worker.

    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: Jo number form/PDF mein hai wahi. Example file jo AI se start kiya, khud debug kiya.

    Viva tipExaminer 'kya seekha / kaise check kiya' pe marks. 'Sab ChatGPT' red flag. Jo khud debug kiya woh story ready rakho.

  9. 9
    Change the graph/chart layout or position.
    Times asked 1
    Official solution

    SimpleCanvas parent col order / CSS grid-area. Change graph/chart layout position.

    Chart destroy recreate if needed.

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

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

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

    Project example: Admin dashboard template.

    Project example: Admin dashboard template.

  10. 10
    Apply filters in the Vue frontend.
    Times asked 1
    Official solution

    Simplecomputed filter list by query buttons. Apply filters Vue frontend.

    Or backend params.

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

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

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

    Project example: status tabs.

  11. 11
    Make changes to backend routes.
    Times asked 1
    Official solution

    SimpleNew/edit @app.route keep auth. Postman first then UI. Make changes backend routes.

    CORS.

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

    Project example: resources.py.

  12. 12
    Create an API that returns the number of reservations/bookings made in the last X days.
    Times asked 1
    Official solution

    Simplefilter created_at >= now-timedelta(days=x) count or list. API reservations last X days.

    x from args.

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

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

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

    Project example: admin stats.

    Project example: admin stats.

  13. 13
    Modify the frontend to display those reservations.
    Times asked 1
    Official solution

    SimpleAPI already Vue v-for missing — add table. Filter occupied.

    Modify frontend display those reservations.

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

    Project example: v-for reservations.

  14. 14
    Create a Celery task (e.g., addition of two numbers) and expose it through an API.
    Times asked 1
    Official solution

    Simple@celery.task add(a,b). Route delay return task_id. Worker must run.

    Live coding. app context if DB.

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

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

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

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

    Example

    @celery.task
    def add(a, b):
        return a + b
    # return jsonify(task_id=add.delay(2,3).id)

    Project example: New task ping or add. Postman.

  15. 15
    Build a Vue component that calls the API and displays the result.
    Times asked 1
    Official solution

    SimpleNew component fetch display button reload. Add Vue component fetches backend displays button fetch again. Build Vue component calls API displays.

    mounted + method.

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

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

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

    Project example: HelloFetch.vue.

  16. 16
    Create a Flask route that returns today's date + 5 days and a message.
    Times asked 1
    Official solution

    Simpleutcnow+timedelta(days=5) isoformat jsonify. Flask route today's date + 5 days message.

    datetime.

    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

    return jsonify(date=(datetime.utcnow()+timedelta(days=5)).isoformat(), msg='ok')

    Project example: GET /api/date.

  17. 17
    Build a Vue component with: Input field Submit button Fetch request Display API response.
    Times asked 1
    Official solution

    Simpleinput button fetch display response. Build Vue component input submit fetch display.

    @submit.prevent.

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

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

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

    Project example: Echo.vue.

  18. 18
    Create a Celery task that retrieves records from the last 5 days, expose it via an API, and return the task ID.
    Times asked 1
    Official solution

    Simple@celery.task add(a,b). Route delay return task_id. Worker must run.

    Live coding. app context if DB.

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

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

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

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

    Example

    @celery.task
    def add(a, b):
        return a + b
    # return jsonify(task_id=add.delay(2,3).id)

    Project example: New task ping or add. Postman.

  19. 19
    Build a parent-child Vue application using: v-for Props Conditional styling based on score.
    Times asked 1
    Official solution

    SimpleParent v-for, child props score, :style color if score>x. Build parent-child v-for props conditional styling score.

    key.

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

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

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

    Project example: StudentList + StudentCard.

  20. 20
    Build a Vue app with vue-router using dynamic routes (/users/:id) and handle invalid IDs gracefully.
    Times asked 1
    Official solution

    Simple/users/:id fetch user invalid not found. Build Vue app vue-router dynamic routes handle invalid IDs.

    guard or v-if.

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

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

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

    Project example: User.vue params.id.

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

  22. 22
    Which Vue version are you using (Vue 2 or 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).

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

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

  25. 25
    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).

  26. 26
    What are Computed Properties?
    Times asked 1
    Official solution

    SimpleComputed = lazy derived value. Ingredients na badlein to kitchen dobara nahi chalti.

    Methods har render pe. Computed cache + dependency.

    fullName, filteredList, isAdmin from role. Template {{ fullName }}.

    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

    computed: {
      fullName() { return this.first + ' ' + this.last }
    }

    Project example: filteredVenues computed from query string. Watcher nahi chahiye tha.

  27. 27
    What are Watchers?
    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'.

  28. 28
    Difference between Computed Properties and Watchers.
    Times asked 2
    Official solution

    SimpleComputed naya value return. Watcher side effect (API, log) jab value change.

    Search debounce, route param change → watch. Display filter → computed.

    Confusion examiner favourite.

    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: {
      query(newQ) { this.fetchSearch(newQ) }
    }

    Project example: q watch → fetchSearch. remainingSeats computed from capacity-booked.

  29. 29
    When can Vue lose reactivity?
    Times asked 1
    Official solution

    SimpleVue2 new property without Vue.set. Array index assign. Vue3 proxy better. Destructure ref without .value.

    When can Vue lose reactivity.

    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 this.items[0] = x Vue2. Vue3 OK-ish still prefer splice.

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

  31. 31
    Difference between v-bind and v-model.
    Times asked 2
    Official solution

    SimpleBind = ek tarfa poster lagana. Model = form jo typed text wapas data mein likhe.

    Display/image/disabled → v-bind. Input/textarea/select → v-model.
    Dono mix: <input v-bind:placeholder="hint" v-model="q">.

    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>{{ price }}</p>
    <img :src="url">
    <input v-model="price">

    Project example: Search box v-model q. Result images :src.

  32. 32
    : is shorthand for which Vue directive?
    Times asked 1
    Official solution

    Simple: is v-bind. @ is v-on. # is v-slot.

    Examiner :src. Don't say v-if.

    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 template colons.

    Project example: Open template colons.

  33. 33
    What are Slots in Vue?
    Times asked 2
    Official solution

    SimpleSlots = dabbe ke andar parent apna HTML daal de. Props data, slots markup.

    Default slot, named slots. App.vue router-view layout jaisa outlet.

    Agar nahi use kiya: 'layout router-view se kiya' valid.

    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

    <div class="card"><slot>Default</slot></div>
    <Card><p>Custom body</p></Card>

    Project example: Card.vue <slot>Default</slot>. Parent custom body.

  34. 34
    What are Navigation Guards in Vue Router?
    Times asked 1
    Official solution

    SimpleGuard darwaza: token nahi to login. Role nahi to 403 page.

    beforeEach. Frontend UX. Backend @jwt_required bina guard hack possible — dono layers.

    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

    router.beforeEach((to) => {
      if (to.meta.auth && !localStorage.getItem('token')) return '/login'
    })

    Project example: router.beforeEach token localStorage. Admin routes meta.role.

  35. 35
    What are Dynamic Routes in Vue Router?
    Times asked 1
    Official solution

    Simple/users/:id. $route.params.id. Invalid → 404 component/guard.

    Examiner live: handle NaN id.

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

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

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

    Example

    { path: '/users/:id', component: User }

    Project example: VenueDetail path. fetch /api/venues/${id}.

  36. 36
    How do you pass data from a grandparent component to a grandchild?
    Times asked 1
    Official solution

    SimpleBaat: props se neeche, emit se upar. Door ke rishte: store ya provide/inject.

    Grandparent→grandchild props drilling ugly. Vuex/Pinia ya provide('user').

    Did you use? List+card files naam lo.

    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

    provide('user', user)
    const user = inject('user')

    Project example: Dashboard v-for BookingCard. Card emit 'cancel'.

    Viva tip3+ level props drilling se better store. Navbar user info store se lo.

  37. 37
    How do you send data from a grandchild back to a grandparent?
    Times asked 1
    Official solution

    SimpleBaat: props se neeche, emit se upar. Door ke rishte: store ya provide/inject.

    Grandparent→grandchild props drilling ugly. Vuex/Pinia ya provide('user').

    Did you use? List+card files naam lo.

    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

    provide('user', user)
    const user = inject('user')

    Project example: Dashboard v-for BookingCard. Card emit 'cancel'.

    Viva tip3+ level props drilling se better store. Navbar user info store se lo.

  38. 38
    What is Vue Router?
    Times asked 3
    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.

  39. 39
    What are State, Mutations, and Actions (Vuex)?
    Times asked 1
    Official solution

    SimpleVuex/Pinia ghar ka notice board. Har room (component) same user/token dekhe.

    State data, mutations sync change, actions async API phir commit.

    Local data() sirf us component. Token/user global.

    Pinia Vue 3 official, kam boilerplate. Vuex older MAD2 still common.

    Example

    state: { user: null }
    mutations: { setUser(s, u) { s.user = u } }
    actions: { async login({ commit }, form) {
      const u = await api.login(form); commit('setUser', u)
    }}

    Project example: store user + token login action. Navbar getters isAdmin. Logout clear LS+state.

    Viva tipLocal/Session storage persist ke liye, reactive share ke liye store. Pinia Vue 3 official, Vuex older.

  40. 40
    What is the purpose of Actions?
    Times asked 2
    Official solution

    SimpleMutations sync diary entry. Actions async kaam phir diary.

    Direct state mutate action se Vuex 4 discouraged. Devtools time-travel mutations.

    Purpose of Actions: API, phir commit. Purpose of Mutations: state change one place.

    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: action fetchVenues → commit setVenues. Mutation sirf array replace.

  41. 41
    What is Pinia?
    Times asked 2
    Official solution

    SimplePinia naya store: mutations nahi, seedha state. Vue 3 recommended.

    defineStore. Vuex vs Pinia: naya project Pinia. Purana Vuex valid.

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

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

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

    Project example: stores/user.js. Agar Vuex hai to Pinia ka naam mat lo unless used.

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

  43. 43
    What is a Promise?
    Times asked 3
    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.

  44. 44
    What is Type Coercion?
    Times asked 1
    Official solution

    SimpleImplicit convert '5'+1='51'. Use === and Number().

    v-model.number helps.

    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 qty parseInt backend too.

    Project example: API qty parseInt backend too.

  45. 45
    What do call(), apply(), and bind() do?
    Times asked 1
    Official solution

    Simplecall(this, args) now. apply(this, [args]). bind later this lock.

    Rare MAD2. Know one-liner.

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

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

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

    Project example: If unused: theory only.

    Project example: If unused: theory only.

  46. 46
    Explain Flask-Security.
    Times asked 1
    Official solution

    SimpleFlask-Security-Too: login, roles, hash, token, UserDatastore. Mixins models pe.

    create_user, add_role, hash_password. JWT-extended alternative. Jo use kiya import dikhao.

    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

    user_datastore = SQLAlchemyUserDatastore(db, User, Role)
    security = Security(app, user_datastore)

    Project example: __init__ Security(app, user_datastore). User(UserMixin).

  47. 47
    What is UserDatastore?
    Times asked 2
    Official solution

    Simpledata() local diary. Store school notice board.

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

    state vs data: similar concept, scope alag.

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

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

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

    Example

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

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

  48. 48
    Explain RBAC implementation.
    Times asked 2
    Official solution

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

    Admin authenticated AND authorized. User authenticated not authorized admin.

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

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

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

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

    Project example: roles_required admin stats. User 403 Postman.

  49. 49
    What are RoleMixin and UserMixin?
    Times asked 1
    Official solution

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

    Methods milte. Models inherit.

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

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

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

    Project example: class User(db.Model, UserMixin).

  50. 50
    How is the authentication token generated?
    Times asked 2
    Official solution

    SimpleLogin success pe server secret se sign. create_access_token / security token.

    Show login route return. DevTools response JSON. jwt.io payload.

    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.

    Example

    token = create_access_token(identity=user.id, additional_claims={'role': user.role})

    Project example: auth.py login. Flask-JWT-Extended.

  51. 51
    Difference between fs_uniquifier and authentication tokens.
    Times asked 1
    Official solution

    Simplefs_uniquifier session invalidation field. JWT signed claims. Related not same.

    Don't say they are equal.

    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: Both in project or one. Clarify.

  52. 52
    What happens to the fs_uniquifier token after a password change?
    Times asked 1
    Official solution

    SimpleNew uniquifier old sessions die. JWT: exp or blacklist/jti.

    What happens after password change favourite.

    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 password demo old token 401 if implemented.

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

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

  55. 55
    Difference between @cache.cached and @cache.memoize.
    Times asked 1
    Official solution

    Simplecached poori view ko yaad rakhta hai, memoize function ke arguments ke hisaab se.

    @cache.cached URL / key_prefix (optional query_string) se key banata hai — list endpoints ke liye.
    @cache.memoize arguments se key banata hai — get_user(5) aur get_user(9) alag cache.

    Prefix clash se galat data mil sakta hai. Dono ka timeout same idea hai. Invalidation: delete_memoized(fn, args) vs cache.delete(prefix).

    Example

    @cache.cached(timeout=30, key_prefix='home')
    def home(): ...
    
    @cache.memoize(30)
    def get_user(user_id): ...  # alag key per user_id

    Project example: Venues list = cached. User-wise report function = memoize(user_id).

    Viva tipList endpoint: cached. Function with arguments: memoize. Prefix alag rakho warna clash.

  56. 56
    What is the benefit of caching?
    Times asked 1
    Official solution

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

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

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

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

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

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

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

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

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

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

  57. 57
    Redis acts as a message broker between which two entities?
    Times asked 1
    Official solution

    SimpleBroker = daakia. Flask chitthi (task) daalta hai, worker uthata hai.

    Point-to-point: ek task ek worker. Pub/sub broadcast alag.

    .delay() JSON serialize karke Redis list mein. Worker BLPOP, run, result backend pe status.

    Example

    export_csv.delay(user_id)   # Flask
    # Redis queue: celery task JSON
    # Worker: export_csv(user_id)

    Project example: POST /api/export → export_csv.delay → Redis → celery worker → MailHog.

    Viva tipPoint-to-point queue: ek task ek worker. Result backend alag DB pe task result store karta hai.

  58. 58
    What is the purpose of the Redis Result Backend?
    Times asked 1
    Official solution

    SimpleResult backend task ka report card hai: PENDING / SUCCESS / FAILURE + return value.

    Broker kaam bhejta hai, backend result rakhta hai. Redis dono ho sakta hai, alag DB better.

    Frontend poll: GET /api/tasks/<id> → AsyncResult.status. CSV ready hone pe download link.

    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

    result = export_csv.delay(1)
    return jsonify(task_id=result.id)
    # baad mein: AsyncResult(task_id).status

    Project example: Export button 202 + task_id. Spinner jab tak SUCCESS. Mail alag se.

  59. 59
    In which data structure does Redis store data?
    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.

  60. 60
    What is CORS?
    Times asked 7
    Official solution

    SimpleDifferent origin Vue vs Flask — browser CORS check. Server Allow-Origin.

    Failed = frontend error even if curl works. Examiner curl vs browser.

    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.

    Example

    from flask_cors import CORS
    CORS(app, resources={r'/api/*': {'origins': 'http://localhost:8080'}})

    Project example: Flask-CORS localhost:8080.

  61. 61
    What is CSRF?
    Times asked 3
    Official solution

    SimpleCSRF = dusri site tumhare cookie se request chalwa de jab tum logged in ho.

    Session+cookie auto-send → CSRF token chahiye.
    JWT Authorization header browser automatically dusri site se nahi lagata — kam risk (unless cookie JWT).

    SameSite cookies help.

    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: Token header APIs. Cookie session nahi to CSRF kam. Phir bhi CORS tight.

  62. 62
    What is SMTP?
    Times asked 3
    Official solution

    SimpleSMTP = email bhejne ka protocol, jaise HTTP web ka.

    Ports: 587 STARTTLS, 465 SMTPS, 25 server-server. Dev: MailHog 1025.

    Flask-Mail wrap. Sync send slow — Celery task se bhejo.

    Fayda: universal. Nuksaan: spam, deliverability (SPF/DKIM), no guarantee like API.

    Example

    app.config['MAIL_SERVER'] = 'localhost'
    app.config['MAIL_PORT'] = 1025
    mail.send(Message('Hi', recipients=['a@b.com'], body='Hello'))

    Project example: MAIL_SERVER=localhost MAIL_PORT=1025. Production later SendGrid/SES.

    Viva tipFayda: universal. Nuksaan: deliverability, spam, sync send slow — isliye Celery + MailHog in dev.

  63. 63
    How are charts rendered in your application? (e.g., Chart.js)
    Times asked 1
    Official solution

    SimpleAPI summary → Chart.js canvas mounted. Colors array.

    Booking karke update — cache invalidate stats.

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

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

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

    Project example: GET /api/admin/summary. new Chart(ctx, ...).

  64. 64
    Modify the Chart.js graph to use only two colors.
    Times asked 1
    Official solution

    Simpledatasets[0].backgroundColor = 2 colors only. Extra hatao.

    Chart.js. After change refresh / destroy recreate.

    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

    backgroundColor: ['#36a2eb', '#ff6384']

    Project example: AdminSummary chart options.

  65. 65
    Explain the project routes and backend changes.
    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.

  66. 66
    Explain frontend API filters.
    Times asked 1
    Official solution

    Simplecomputed filteredList or backend query params. Don't only UI if security.

    Apply filters Vue frontend live.

    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 filter buttons.

    Project example: status filter buttons.

  67. 67
    Explain project-specific JavaScript concepts introduced in your code.
    Times asked 1
    Official solution

    Simplemap/filter/async you wrote. Open that file. Project-specific JS concepts.

    Don't claim unused.

    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: grep .map.

    Project example: grep .map.

  1. 1
    Give an overview of the project structure (folders and files).
    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
    Run the application.
    Times asked 8
    Official solution

    SimpleExaminer submitted ZIP chahta hai, local extra changes nahi.

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

  3. 3
    Perform all CRUD operations as Admin.
    Times asked 2
    Official solution

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

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

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

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

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

  5. 5
    Explain app.py / __init__.py (application setup).
    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.

  6. 6
    Explain a specific route from your project.
    Times asked 1
    Official solution

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

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

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

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

  7. 7
    Explain one Create route.
    Times asked 1
    Official solution

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

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

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

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

  8. 8
    Explain the Login and Logout routes.
    Times asked 1
    Official solution

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

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

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

  9. 9
    Show the login form (frontend and backend).
    Times asked 1
    Official solution

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

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

  10. 10
    Show all Jinja templates/files.
    Times asked 1
    Official solution

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

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

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

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

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

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

  11. 11
    Swap the positions of two graphs on the summary page.
    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'))
  12. 12
    Change booking date to default to today - 1 day using datetime and timedelta.
    Times asked 1
    Official solution

    Simpledatetime date/time, timedelta farq (1 day pehle).

    from datetime import datetime, timedelta, date
    default = date.today() - timedelta(days=1)
    Booking date past na ho: if d < date.today(): flash('Past date nahi')

    UTC: datetime.utcnow default= ke liye.

  13. 13
    Convert all service names to uppercase.
    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 }}.

  14. 14
    Display customer addresses in uppercase.
    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 }}.

  15. 15
    Store/display service prices with decimal values (after division by 1000).
    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'))
  16. 16
    Sort service requests alphabetically by customer name.
    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 }}.

  17. 17
    Sort subjects alphabetically.
    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 }}.

  18. 18
    Change pie chart colors.
    Times asked 1
    Official solution

    SimpleChart.js frontend library. Backend counts bhejta hai, JS graph banata hai.

    stats = {'booked': 10, 'cancelled': 2}

    render_template('summary.html', stats=stats)
    new Chart(ctx, {type:'bar', data:{labels:[...], datasets:[{data:[...]}]}})

    Dynamic: har load pe query. Pie vs bar: Chart type change. Colors: backgroundColor array.
    Swap graphs: HTML do canvas ki jagah badlo.

  19. 19
    Create a dropdown containing all parking lots.
    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 }}
  20. 20
    Create a page with: Date input. Display unique parking lots used on that date. Results sorted alphabetically.
    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 }}
  21. 21
    Create a form with: Username input. Dynamically populated parking lot dropdown. Search button. Display all spots booked by that user for the selected parking lot.
    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.

  22. 22
    Why do we use a Virtual Environment?
    Times asked 1
    Official solution

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

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

  23. 23
    What is ORM? Why is it used?
    Times asked 2
    Official solution

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

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

    Example model

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

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

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

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

  24. 24
    What ORM have you used?
    Times asked 1
    Official solution

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

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

    Example model

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

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

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

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

  25. 25
    What is MVC Architecture?
    Times asked 2
    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.

  26. 26
    What other software architectures do you know?
    Times asked 1
    Official solution

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

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

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

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

  27. 27
    What is app = Flask(__name__)? Why is __name__ used?
    Times asked 1
    Official solution

    Simpleapp = Flask(__name__) app banata hai; if __name__ == '__main__' tabhi server start jab file directly run ho.

    app = Flask(__name__)
    if __name__ == '__main__':
        app.run(debug=True, port=5000)

    __name__ module ka naam. Direct run pe '__main__', import pe filename. Import karoge to server auto-start nahi — tests/blueprints ke liye zaroori.
    debug=True: auto-reload + debugger. Production mein band rakho (security).
    Port: app.run(port=8000) ya flask run --port 8000. Default 5000. Haan, change ho sakta hai.

  28. 28
    What is app.config["SECRET_KEY"]? Why is it needed?
    Times asked 1
    Official solution

    SimpleSECRET_KEY Flask ka secret jisse session cookies sign/encrypt hoti hain.

    app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'dev-key')

    Iske bina session/flash unreliable ya insecure. Key leak = attacker session forge kar sakta hai.
    Hardcode mat karo production mein — .env / environment variable. Flash messages bhi session use karti hain, isliye SECRET_KEY se related hain.
    Hataane pe session kaam nahi / warning. Change karne pe purane sessions invalid.

  29. 29
    What happens if the Secret Key is removed?
    Times asked 1
    Official solution

    SimpleSECRET_KEY Flask ka secret jisse session cookies sign/encrypt hoti hain.

    app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'dev-key')

    Iske bina session/flash unreliable ya insecure. Key leak = attacker session forge kar sakta hai.
    Hardcode mat karo production mein — .env / environment variable. Flash messages bhi session use karti hain, isliye SECRET_KEY se related hain.
    Hataane pe session kaam nahi / warning. Change karne pe purane sessions invalid.

  30. 30
    What is app.app_context().push()? Why is it used?
    Times asked 2
    Official solution

    SimpleApplication context app-level data (config, db), Request context ek HTTP request (request, session).

    Request ke andar Flask khud context push karta hai. Scripts/shell mein db query ke liye:

    with app.app_context():
        User.query.all()

    app.app_context().push() same, lekin with better (cleanup).
    current_app proxy current Flask app ki taraf. Factory pattern mein import app cycle avoid.
    Request context ke bahar request.form error dega.

  31. 31
    How are sessions stored?
    Times asked 1
    Official solution

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

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

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

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

  32. 32
    How does backend send data to the frontend?
    Times asked 1
    Official solution

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

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

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

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

  33. 33
    Can a Flask endpoint return a Boolean?
    Times asked 1
    Official solution

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

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

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

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

  34. 34
    Explain flask_sqlalchemy import.
    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.

  35. 35
    Explain @staticmethod and where you used it.
    Times asked 1
    Official solution

    SimpleOOP = objects + classes. Inheritance child parent ke fields/methods reuse karta hai.

    class User(db.Model): ...
    class Admin(User): ...  # model inheritance (joiner ya single table)

    Models inherit db.Model se taaki query/columns milen.

    @staticmethod: self nahi, utility. isinstance(obj, User) type check.

    MAD1 models classes hain, routes functions — mix of OOP + procedural.

  36. 36
    Explain UserMixin and why it is used.
    Times asked 2
    Official solution

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

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

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

  37. 37
    What is the datatype returned by .query.filter_by(...)?
    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 }}.

  38. 38
    Which database are you using?
    Times asked 3
    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://...

  39. 39
    What is Cascade?
    Times asked 4
    Official solution

    SimpleCascade parent ke saath child pe automatic action (generally delete).

    Company delete → uski drives bhi delete, warna orphan rows / FK error.
    SQLAlchemy: db.relationship('Drive', cascade='all, delete-orphan', backref='company')
    SQL: ForeignKey(..., ondelete='CASCADE')

    Cascade sirf delete nahi: save-update, merge, refresh-expire, expunge, delete-orphan.
    Cascade Update: parent PK change to child FK update (rare, PK mat badlo).
    Parent delete jab children active hon: constraint error, ya cascade se children gayab, ya pehle children handle karo — design choice examiner poochta hai.
    CSS cascading alag topic hai (styles inherit/override).

  40. 40
    Can Cascade be used only for Delete?
    Times asked 1
    Official solution

    SimpleCascade parent ke saath child pe automatic action (generally delete).

    Company delete → uski drives bhi delete, warna orphan rows / FK error.
    SQLAlchemy: db.relationship('Drive', cascade='all, delete-orphan', backref='company')
    SQL: ForeignKey(..., ondelete='CASCADE')

    Cascade sirf delete nahi: save-update, merge, refresh-expire, expunge, delete-orphan.
    Cascade Update: parent PK change to child FK update (rare, PK mat badlo).
    Parent delete jab children active hon: constraint error, ya cascade se children gayab, ya pehle children handle karo — design choice examiner poochta hai.
    CSS cascading alag topic hai (styles inherit/override).

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

  42. 42
    What does lazy=True mean?
    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).

  43. 43
    What is Enum?
    Times asked 1
    Official solution

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

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

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

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

  44. 44
    Is your database normalized?
    Times asked 3
    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.

  45. 45
    Explain different Normal Forms.
    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.

  46. 46
    What is db.func.count()?
    Times asked 1
    Official solution

    Simpledb Flask-SQLAlchemy ka object hai. Models db.Model se inherit karti hain, tables db.create_all() se banti hain.

    db = SQLAlchemy()
    db.init_app(app) # factory pattern

    with app.app_context():
        db.create_all()
    
    db.Model SQLAlchemy declarative base (class). Columns se table schema.

    db properties engine/session/metadata se aati hain, Flask app config (SQLALCHEMY_DATABASE_URI) se bind.
    Admin user: create_all sirf tables; admin seed alag function mein (if not User.query.filter_by(role='admin').first(): ...).
    Live schema change: Flask-Migrate/Alembic. create_all nayi tables add kare, existing columns alter nahi karta generally.

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

  48. 48
    What is a RESTful API?
    Times asked 4
    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.

  49. 49
    Have you used any APIs?
    Times asked 2
    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.

  50. 50
    How do you use the PUT method?
    Times asked 1
    Official solution

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

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

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

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

  51. 51
    Explain CORS.
    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.

  52. 52
    Why did you use Jinja?
    Times asked 2
    Official solution

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

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

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

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

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

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

  53. 53
    What is Template Inheritance?
    Times asked 10
    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.

  54. 54
    Difference between {% include %} and {% extends %}.
    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.

  55. 55
    Why are HTML files kept inside the templates folder?
    Times asked 1
    Official solution

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

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

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

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

  56. 56
    What changes are required if the folder name is changed?
    Times asked 1
    Official solution

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

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

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

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

  57. 57
    Difference between id (#) and class (.) selectors.
    Times asked 1
    Official solution

    Simple# ID selector hai (ek unique element), . class selector hai (kai elements).

    #login-btn { color: red; } → id='login-btn'
    .btn { padding: 8px; } → class='btn'

    ID page mein unique hona chahiye. Class reuse hoti hai — saare buttons .btn.
    CSS specificity: ID > class > element. Isliye # wala style . wale ko haarata hai.

    HTML: id JavaScript/getElementById ke liye, class styling groups ke liye.

  58. 58
    What does .class mean in CSS?
    Times asked 1
    Official solution

    Simple# ID selector hai (ek unique element), . class selector hai (kai elements).

    #login-btn { color: red; } → id='login-btn'
    .btn { padding: 8px; } → class='btn'

    ID page mein unique hona chahiye. Class reuse hoti hai — saare buttons .btn.
    CSS specificity: ID > class > element. Isliye # wala style . wale ko haarata hai.

    HTML: id JavaScript/getElementById ke liye, class styling groups ke liye.

  59. 59
    Difference between CSS spacing and padding.
    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.

  60. 60
    Difference between cellpadding and cellspacing.
    Times asked 1
    Official solution

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

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

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

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

  61. 61
    Priority order of Inline, Internal, and External CSS.
    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.

  62. 62
    What is the name attribute in an HTML input?
    Times asked 1
    Official solution

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

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

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

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

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

  63. 63
    Difference between name and value attributes.
    Times asked 1
    Official solution

    Difference question hai — 3 cheezein bolo: meaning, kab use, 1 example.

    Pehle concept A ek line, phir B ek line, phir table-jaisa farq (input/output/side-effect).
    Example hamesha MAD1 se: GET search page, POST register, PUT/PATCH API update, session vs cookie login.

  64. 64
    Explain GET vs POST using an anchor tag.
    Times asked 1
    Official solution

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

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

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

    Example

    # page dikhana

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

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

  65. 65
    What is Version Control System? Give an example.
    Times asked 1
    Official solution

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

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

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

  66. 66
    What is HTTP Metadata?
    Times asked 1
    Official solution

    Simple mix of small concepts examiners poochte hain:

    Enum: fixed choices (status = pending/approved). Python Enum ya DB Enum column.
    Lambda: one-line anonymous function. key=lambda x: x.name sort ke liye.
    datetime: dates/times. timedelta(days=1) yesterday. default=datetime.utcnow.
    os.getenv('SECRET_KEY') environment se config, hardcode nahi. .env alternative: actual OS env, config.py, vault.
    HTML metadata: <meta charset>, <meta name='viewport'> — page ke baare mein, body content nahi.
    HTTP metadata: headers (Content-Type, Set-Cookie).
    Request payload: body data (JSON/form).
    Namespace: naam collide na hon (Blueprint name, Python packages).
    Plugins: extra packages (Flask-Login). Package vs module: package folder with __init__, module ek .py file.

  67. 67
    What is Metadata in HTML?
    Times asked 1
    Official solution

    Simple mix of small concepts examiners poochte hain:

    Enum: fixed choices (status = pending/approved). Python Enum ya DB Enum column.
    Lambda: one-line anonymous function. key=lambda x: x.name sort ke liye.
    datetime: dates/times. timedelta(days=1) yesterday. default=datetime.utcnow.
    os.getenv('SECRET_KEY') environment se config, hardcode nahi. .env alternative: actual OS env, config.py, vault.
    HTML metadata: <meta charset>, <meta name='viewport'> — page ke baare mein, body content nahi.
    HTTP metadata: headers (Content-Type, Set-Cookie).
    Request payload: body data (JSON/form).
    Namespace: naam collide na hon (Blueprint name, Python packages).
    Plugins: extra packages (Flask-Login). Package vs module: package folder with __init__, module ek .py file.

  68. 68
    Difference between redirect() and render_template().
    Times asked 2
    Official solution

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

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

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

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

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

  69. 69
    Have you used Chart.js? Why?
    Times asked 1
    Official solution

    SimpleChart.js frontend library. Backend counts bhejta hai, JS graph banata hai.

    stats = {'booked': 10, 'cancelled': 2}

    render_template('summary.html', stats=stats)
    new Chart(ctx, {type:'bar', data:{labels:[...], datasets:[{data:[...]}]}})

    Dynamic: har load pe query. Pie vs bar: Chart type change. Colors: backgroundColor array.
    Swap graphs: HTML do canvas ki jagah badlo.

  70. 70
    What is the purpose of JavaScript in your project?
    Times asked 1
    Official solution

    SimpleJavaScript browser pe chalta hai — click, validation, Chart.js, Bootstrap modal.

    Frameworks: Vue, React, Angular. MAD1 mein vanilla JS / Bootstrap JS kaafi.
    Modal: popup overlay. Bootstrap: data-bs-toggle='modal' data-bs-target='#id'.
    Flash hide: setTimeout se alert remove. Form submit confirm: onsubmit='return confirm(...)'.
    Agar project mein JS kam hai to sach bolo, theory example do.

  71. 71
    What is the purpose of functools.wraps and where is it used?
    Times asked 1
    Official solution

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

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

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

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

  72. 72
    Relationship between Flash messages and Secret Key.
    Times asked 1
    Official solution

    SimpleSECRET_KEY Flask ka secret jisse session cookies sign/encrypt hoti hain.

    app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'dev-key')

    Iske bina session/flash unreliable ya insecure. Key leak = attacker session forge kar sakta hai.
    Hardcode mat karo production mein — .env / environment variable. Flash messages bhi session use karti hain, isliye SECRET_KEY se related hain.
    Hataane pe session kaam nahi / warning. Change karne pe purane sessions invalid.

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