Viva prep · Real questions · Student experiences Enroll in Bootcamp

Proctor workspace

Proctor Level3_25

Share your experience Add your viva experience here
152 Questions
2 Sets
0 Topics
33 Reviews
Tips for this examiner: focus on basic of the mad2

Student reviews

leaf MAD1

Shared viva questions from response sheet: the response right above this..; it is of viva level2

Questions remembered
  1. the response right above this..
  2. it is of viva level2
leaf MAD1

he is a chill proctor, he asks all the questions from the sheet, so revise that well and go.
from observation, he focuses on the backend part in the coding/code change questions, rather than asking to write the frontend code. in my case, not much code changes were asked.

i also noticed he was asking me the exact topics ive already said during the demo, so he REALLY has that set of questions he always tests from. so DONT FORGET to check the sheet.

Questions remembered
  1. asked to show the id card, and download the application from the portal
  2. give the demo (try to explain as much as possible. i did it for 15-20 min approx. if you have missed including any functionalities or if you think you could've made improvements anywhere, mention them. it shows that you've actually put effort into the project)
  3. give a brief overview of the overall code. (i went into the specifics and was explaining in too much detail, so he just interrupted right after the login route and started asking questions lol)
  4. what is ORM? where have you used it?
  5. have you used bootstrap or css?
  6. where is the metadata stored?
  7. move the "Don't have an account? Register now" line to the top-right position of the window below the navbar. *after changing* explain how you changed it.
  8. what is db.Model? what is SQLAlchemy() here?
  9. explain the book_trek() route from the code.
  10. MVC paradigm
  11. difference between client server and multi-server architecture? (the viva lasted for about 40 minutes)
Farhana MAD1

The proctor is very nice
Be relax and answer all the questions

Questions remembered
  1. -Show the ID Card
  2. -explain the project
  3. -then asked to change the code to change (Don't have an account? Register) to top right corner
  4. -Asked me to explain model.py
  5. -Explain the part in code where user books the trek
  6. -Explain the code of login
  7. -Asked about db whether it is a class or object
  8. -Relationships used,backref, back_populate
  9. -ORM
  10. -url_of vs redirect
  11. -MVC
  12. -GET vs POST
  13. -Did u use API? I said no, So no questions from there
  14. At last he said the project is good
  15. Study more about OOPS
  16. Try to add API
Shash MAD1

Calm & Listen to everything without interrupting.
Any line you think you don't know enough about..
Copy paste and read the explanation in brief.
Understand the flow of every route used .
For example..
Backend request data from Frontend..User Provides data.. Provided goes to this logic ..now route ask database for the data..
These lines process the data..
Return line render_template (display or push the data to frontend)

For Coding just know
1)Login Route
2) Input from One Page output on othet (Route+ template)
3) Display any particular data.. blacklisted user /completed trek (model.query.filter_by(<condition>).all())
4) Change in CSS

Questions remembered
  1. Viva went for 35 Minutes.
  2. 1)Show Your Id.
  3. 2)Demo for a sweet 10 minutes.
  4. 3) Asked me to Show Your Code (Explain an Overview).
  5. 4) Asked Where is Your Model.
  6. 5)Explain db.Model
  7. 6)backref back_populates.
  8. 7)Explain MVC Structure of your Code.
  9. 8)What is ORM.
  10. 9)What is the flow of your Login Page.
  11. 10)Flow of Booking.Explain Each line in the Code.
  12. 11)Are you doing Password Hashing.Explain by showing in your Code.
  13. 12)Did you use CSS Bootstrap. I Said No.
  14. 13)What is difference between Cell Spacing and Cell Padding.
  15. 14)Have you Created any API's?
  16. Only Coding/LIVE Question:
  17. 12)Change the Position of your 'Already a user? Login.' in register.html to the top-right below Admin.
Sheet response MAD1

Examiner come 18 minutes late.
All questions I was asked were from this sheet only.
Examiner was patient.
Know your code and should be able to explain it well.
Go through previous questions of this examiner from this sheet.
At the end, suggested me to work on apis and oop concepts.

Questions remembered
  1. Level 2 Viva
  2. Asked me to show id card and download the project from the viva portal.
  3. Give a demonstration of the app, including all features you have implemented.
  4. Explain the backend code.
  5. Stopped in between to ask questions.
  6. Theory Questions: - relationships, what all have you used and where? - MVC - what is ORM? where have you used it? - VCS vs GIT - back_ref vs back_populates - Client server vs distributed architecture. which one have you used? - have you used apis? I had not, so didn't ask any questions - what is @app.route() ? what does it do? - GET vs POST - explain the code about how the company can shortlist, select or reject student applications - some other questions based on my code
  7. Coding question: change the login link to top right of the screen Viva took about 40 minutes.
Hritik MAD1

Be confident in your code section and cover as much theory and technical jargons during code demo to build confident repo during the viva. Prepare for code changes and coding part, thou in my he didn't asked much, but all other examiners are asking it. Don't go point blank for coding part.

Questions remembered
  1. MAD 1 Level 2 Viva: Proctor: Level3_25
  2. Show ID Card
  3. Show Demo of the application
  4. Walk-through of the code along with workflow management of each functionality
  5. I did show the code with all the theory covered during the demo itself, the examiner has to interrupt my long demo with code review after 30 minutes to ask me questions, actually
  6. What is MVC Paradigm
  7. Asked about other architectural points utilised in this application
  8. What is ORM, why you used it? How it works?
  9. Gave feedback to study more OOPs concept and concluded the viva. It went for around 40 minutes and didn't ask any coding questions.
Yoo_Yoo_Anirban MAD1

He is a Chill guy, will not interrupt you while taking, Just Know Your Code Properly, whats working for what and how,

Cover as much Theory question as Possible, Know You CODE PROPERLY

if you dont know the definition for that specific question, try to explain why that use and if you have implemented that in you code show that and explain work flow of that..
and you are good to go...

also you can us eyour hand gestures to explain things like the padding and Spacing ..

Questions remembered
  1. he will ask you to show the Official PDF of you ID card,
  2. will have to show the Working of the application and all the core features and other (if you implemented any)
  3. Working of the Code, how the application is working, all the models, routes, relations ships (he may ask some question right here like "this part of you code where is working in your application) Try to Explain all the things you did here and how thats working by your self even before he askes. and also explain the HtMLs in one go
  4. Asks you about the relationships
  5. ORM 5) MVC 6) db = sqlalchemy(app) from here he can ask what is what like which one is Class, Object
  6. how the Authorization and the Authentication is Working in you code, have to explain that Like the How Login Route and Register Route working
  7. Change the Button Positions
  8. Cell padding vs Cell Spacing
  9. backref vs backpopulates
  10. Client server vs Distributed server (also include whats in you project as example)
  11. will ask you if you have impleminted any API or not (i said i did not use api)
  12. Difference between GIT and VCS
  13. have implemented Hashing or not,,,, how i have implemented hasing also the library name all cover all the theory question from this sheet of viva examiner lvl3_25 Feedback - He likes the Theme of my App, and good with my Viva.. told me to "Expand around the API's that will help" and implement the Summary Chart.. also to work around the OOPs concept more
Sheet response MAD1

go throught the previouly asked questions of these proctor and its quite enough

Questions remembered
  1. change the possition of the register button to top right corner
  2. explain data base table relationships, attributes , foreign and primary keys
  3. template inheritance,
  4. backref in model,
  5. Order of importance in CSS
  6. Difference between padding and cell spacing(asked the question similar to this , i can't rember)
  7. mvc
  8. explain charts u put in project
  9. and some other questions with he asked priviously
Shreyas Pandey MAD1

feedback
need to work on OOPS and API theoretical knowledge

Questions remembered
  1. sir came 10 minutes late
  2. asked me to show the demo
  3. simple ui changing of register button from login page bottom center to top right
  4. standard questions that he has asked previously mentioned in the viva responses sheet
  5. asked some questions on Blockchain technology too
vinshi MAD1

learn the theory questions by heart and learn about APIs

Questions remembered
  1. full app overview
  2. explain code
  3. changing the position to top right corner
  4. what is db.model
  5. explain a part of code where there is feature of updation
  6. MVC
  7. ORM
  8. difference between backref and backpopulate
  9. make an API endpoint if you have used it in get post(couldnt understand the question clearly
  10. POST,GET
  11. where is metadata used in html
  12. go through the summary section of its working dynamically or not
Samp MAD1

proctor is good last he gave feedback .....no need for tension

Questions remembered
  1. mad 1 level 2
  2. show me your id
  3. show checksum(i said , sir can i download the project from the portal)he said ok download it ...and don't need to do checksum...run your app
  4. show the demo of the project
  5. what have you used in your app overall?
  6. explain your model
  7. why is sqlalchemy?
  8. what is db.model?
  9. did you used reletionship in your model?
  10. different between backref and back_populate
  11. did you implemented api?
  12. show me the git and post api that you implementd and run it
  13. go to your controllers
  14. what @app.route is?
  15. what is mvc?
  16. you used summary charts explain the charts in your code
  17. what is git and vcs?..what is the difference?
  18. what is unstructured data and sturctured data?
  19. code change:
  20. change the new user? signup to top right corner under navbar
  21. where you changed your code show me and explain
  22. this is what i rememberd.....
Sheet response MAD1

Read questions from the sheet mostly similar even the code changes are similar.
Take all questions from the sheet for this proctor and copy them to notepad and write answers for all for viva prep . You will be able to do all questions asked by Proctor easily

Questions remembered
  1. Download your project and it thoroughly like presentation and show all functionality
  2. What is db.model
  3. Where you initialized db
  4. What is SQLALCHEMY , a class or a function
  5. Diff GIT and VCS
  6. Explain with code how you implemented timer function
  7. MVC Paradigm
  8. Change a button to top right of the page
  9. GET vs POST method explain in your code
  10. Have you used relations in model
  11. Have you used APIs
  12. url for and redirect difference
  13. Have you used charts explain with code how you did it
Sheet response MAD1

Shared viva questions from response sheet: Level3_25; show ID; Run the application

Questions remembered
  1. Level3_25
  2. show ID
  3. Run the application
  4. Shift the login button to the top right
  5. redirect vs Url_for
  6. MVC
  7. ORM
  8. db.model
  9. show database and explain it
  10. And how did I done the validation of the user,Then he asked he to go to the code part and asked me to explain that also
  11. Client server vs distributed architecture
  12. cell spacing vs cell padding
  13. what is backref vs backpopulates,relationship
  14. Explain time setting in code for quiz
  15. have u used Password hashing and what is that
Sheet response MAD1

Know your application's code properly.

And just go through the questions from this spreadsheet. I also did that. A proctor generally asks similar type of questions everytime that's how I got all the common questions that I prepared from this sheet.

Biggest Tip: If you haven't used a feature in your project, like in my case it was APIs, just say it politely and he most likely will not ask questions from there😅

Anyways at the end, he 's good proctor. Told me that my project was nice ☺️ and I should explore the APIs as well and more on OOP.

Questions remembered
  1. Asked to demonstrate the application first
  2. Then asked what is db.Model ?
  3. is sqlAlchemy a class or object? 4)what is backref?
  4. Did I use any relationship in the models and why? 6)what is ORM?
  5. Difference between git and VCS?
  6. What is MVC paradigm?
  7. what is the difference between cell-spacing and cell-padding? 10)What is client-server and distributed architecture?
  8. Did I use any API or not? My answer was no so he didn't ask anything from APIs
  9. Then he asked me to shift a text and a button from the bottom to top-right position and also need to explain how I did that
Anonymus MAD1

Prepare all questions from this google sheet,
it will certainly help you during Viva

Questions remembered
  1. Show Id card and perform CheckSum. 2.Demonstrate your application 3.Explain your code 4.What is db.Model
  2. Where you have initialized your database 6.Define ORM , SQlAlchemy , Template inheritance , Git vs VCS , Backpopulates 7.Why you have used backpopulates why not backref 8.asked to change the position of login button to top right 9.Does api return boolean values
  3. Explain a route
  4. Your summary chart is changing dynamically , if yes , then show it
Navirah Mohsin MAD1

Shared viva questions from response sheet: Code changes- changing of location of the login option to top right corner; Theory-; ORM

Questions remembered
  1. Code changes- changing of location of the login option to top right corner
  2. Theory-
  3. ORM
  4. MVC
  5. Git vs VCS
  6. Backref vs Back populate
  7. @app.route ?
  8. How did I validate users
  9. What is db.model
v MAD1

Chill Proctor, Since I had my viva at EOD (10-11pm) he didn't ask too much questions (didnt ask me to change features)

Questions remembered
  1. Full Demo of Code
  2. Client server vs Distributed Server
  3. How user Validated/Password security/ RBAC
  4. Get, Post Methods
  5. url for vs redirect
  6. Backpopulate vs Backref in Models
  7. db = Sqlalchemy() - db is class or function. in def User(db.Model) what is db
N/A MAD1

Level 2 Viva took around 30-40 minutes for me.

Please review the questions previously asked by this proctor, as he tends to ask similar ones. If you are still not satisfied, prepare all the questions in this sheet.

Make sure you fully understand the code, including the syntax and how it works. The proctor is approachable and may offer assistance if you get stuck. If you are unsure about any topic, he will help you.

The changes in the code will be something you have already implemented or similar to your previous implementations. Therefore, ensure that you are completely clear on the logic behind your code.

Be patient and well-prepared. That’s all you need, along with a bit of luck.

Questions remembered
  1. Overview of the app.py file
  2. Overview of the models
  3. Relationships: Have any been used?
  4. What is backref?
  5. What is SQLAlchemy?
  6. What does db.Model refer to?
  7. What is the MVC architecture?
  8. What is client-server architecture and distributed architecture?
  9. What are cell spacing and cell padding?
  10. How does the customer login process work?
  11. Move the register button to the top right corner of the page.
  12. Why was a relationship used in the database model?
Rithvik TR MAD1

Go through all the questions that have been asked by 'level3_25' instructor. If you have more time, go through all the proctor questions too. And finally know your code well.

Questions remembered
  1. GO THROUGH ALL THR QUESTIONS IN THIS VIVA FOR THE INSTRUCTOR. 99% IS SAME -> I did the demo of the app for 35 mins. Explained each part and my reasoning.
  2. Backref VS Backpopulate
  3. Relationships
  4. Client Server VS Distributed
  5. Change position of register anchor link to top right
Harshit MAD1

If anyone would assign this proctored must have a look on the question he ask because 90 percent he follows the same pattern of asking question

Questions remembered
  1. Shown my I'd card
  2. Demo of my project
  3. shown my all dependencies which i used
  4. what is orm
  5. client server architecture vs distributed server
  6. redirect() vs url_for()
  7. git vs vcs
  8. where you applied validation in your project
  9. said to change login button to the top right corner
  10. said me to learn about oops
Atharv Khare MAD1

Know your project well and prepare from this sheet, cover all the questions this examiner has asked previously, and you'll be fine.

Questions remembered
  1. Demonstration :
  2. - Give a project Demo
  3. - Explain a route logic
  4. - Change the signup button location
  5. - Show the project structure
  6. - Show the config file
  7. - Why use CSS
  8. Project code related questions :
  9. Models.py
  10. - What is db.relationship
  11. - Explain your relationships and why you used them
  12. - what is db.model , a class or function
  13. - what is sqlalchemy , class or function
  14. - what is db here
  15. - explain the working of inheritance logic here
  16. - backref vs backpopulate , example
  17. Controllers
  18. - what is app.route and its use
  19. - can it return a boolean value
  20. - url_for vs redirect
  21. - what is app here
  22. - explain a endpoint
  23. - what is validation, have you used it
  24. - How are you handling login
  25. - What libraries have you used
  26. - Password hashing and verification
  27. Theory
  28. - Git vs VCS
  29. - Structured vs Unstructured DB
  30. - MVC
  31. - ORM and its use
  32. - GET vs POST
  33. - CS architecture vs Distributed
  34. - Why use CS
  35. - OOPS in python in detail
  36. APIS
  37. - Show API endpoints
  38. - Create a new endpoint and test it
  39. Told me to learn more about OOPs in Python for future
Vaishnavi MAD1

Knoe your project well and also prepare from this sheet

Questions remembered
  1. THEORY:
  2. Git vs vcs
  3. ⁠ client vs distributed architecture
  4. ⁠ MVC Paradigm
  5. ⁠logic for influencer negotiation
  6. ⁠logic for adding campaign
  7. ⁠ORM
  8. ⁠sqlalchemy is class or fn
  9. ⁠what is db.Model
  10. ⁠what is app.py, models.py , functions.py
  11. ⁠get vs post
  12. ⁠structured vs unstructured db CHANGES: ⁠asked me to shift the signup option to the rightmost corner of the page
IA MAD1

Focus on all the theory questions and make sure you have all implemented all the core functionalities.

Questions remembered
  1. Project demo
  2. Structured vs unstructured database
  3. Vsc vs git
  4. Url_for vs rendered_template
  5. What's db. model
  6. Explain detailed working of models
  7. Template inheritance
  8. Client server vs distributed architecture
  9. What is @app.route
  10. Backref vs backpopulate
  11. What's db.relationship
  12. What is MVC?
  13. How you login system works (logic)?
  14. Can html template handle boolean values
  15. How did u implement validation?
  16. What is ORM?
  17. Change position of submit button to the top left corner of the web page.
  18. Said I need to focus more on OOP's concepts.
Saransh Saini MAD1

Study about class inheritance and object oriented programming in python a bit
Study about different architectures
Know your code well they will ask you to change stuff
All the best

Questions remembered
  1. Went on for 55 mins
  2. Complete demo
  3. How is the data flow working (system architecture)
  4. Swap the position of two elements on the the nav bar
  5. What is MVC
  6. difference between client server model and distributed architecture
  7. What is the db.Model in the models you have created and why it is there
  8. Then from where is the db inheriting properties.
  9. Difference between cell spacing and padding
  10. Explain how the controller (main.py) file is sending and receiving apis
  11. What is ORM
  12. What is @app.route() and what is it's need
  13. Explain how my apis are working, (I opened postman and demonstrated all 4 http verbs) Overall the viva was moderate leveled, i managed to answer all instead of that distributed architecture one 🥲
param MAD1

be completely clear on your code, and try to cover as much theory as you can, even on topics outside the syllabus

Questions remembered
  1. - detailed working and logic of the program files
  2. - how to center text in html
  3. - what is MVC
  4. - what are client-server and distributed architectures
  5. - how does the CRUD functionality work
  6. - questions about the views and controllers, e.g. 'explain the login flow'
  7. - relationships in databases
J MAD1

Shared viva questions from response sheet: *He asked me to explain some of the things in the code in detail like how is the quantity updated in the cart , how to delete a product and add a new product .; *asked where metadata is in the html; *orm , rbac , cascading rules , inheritance

Questions remembered
  1. *He asked me to explain some of the things in the code in detail like how is the quantity updated in the cart , how to delete a product and add a new product .
  2. *asked where metadata is in the html
  3. *orm , rbac , cascading rules , inheritance
  4. * Difference between GIT and VCS
  5. Feedback - He said that I should use matplolib and all for summary graphs . Also can use API. I should also know exactly what I have done in the code but in the end he said keep up good the work also .
Bhavya Aditya MAD1

Shared viva questions from response sheet: App demo; Overview of the code; Explain the flow of the app - basically focus on the features of the app and the corresponding routes/functions in routes.py

Questions remembered
  1. App demo
  2. Overview of the code
  3. Explain the flow of the app - basically focus on the features of the app and the corresponding routes/functions in routes.py
  4. In model.py he asked have you used inheritence anywhere, and have you defined any relationships
  5. Backref
  6. Backref vs backpopulate
  7. Explain how you are editing a product
  8. MVC
  9. ORM
  10. Client server vs distributed architecture
Aditi juneja MAD1

Shared viva questions from response sheet: Walk through your project then some questions related to things I have usedRBA{Make API calls for the API you have created; Why LoginManager()?; How are you hashing the passwords

Questions remembered
  1. Walk through your project then some questions related to things I have usedRBA{Make API calls for the API you have created
  2. Why LoginManager()?
  3. How are you hashing the passwords
  4. Inheritance
  5. DB related questions}
  6. Backref
  7. Distributed and client server
  8. ORM : adv and disadv. , where have you used it in your project
  9. Define MVC
  10. Define RBAC
  11. Difference between authentication and authorisation
  12. What is version control
  13. Types of tests, and define them
  14. Why have you used sqlite?
  15. And a few more ques that I don't remember...
J SAIKALYAN RAO MAD1

Shared viva questions from response sheet: go through the main code and database; how did you implement databases; MVC

Questions remembered
  1. go through the main code and database
  2. how did you implement databases
  3. MVC
  4. ORM
  5. GIT SND VCS
  6. APIs
  7. backref vs backpopulate
  8. some questions about the code
  9. distributed vs client-server
  10. did u use inheritance
  11. order of importance in css
Nishkarsh MAD1

Shared viva questions from response sheet: What is MVC?; What is ORM?; What is the difference between client server and distributed server?

Questions remembered
  1. What is MVC?
  2. What is ORM?
  3. What is the difference between client server and distributed server?
  4. Explain the models?
  5. What is inheritance of model?
  6. What is RBAC
Animesh Sharma MAD1

Shared viva questions from response sheet: 1.Explain code; 2.ORM; 3.MVC

Questions remembered
  1. 1.Explain code
  2. 2.ORM
  3. 3.MVC
  4. 4.Structured -Unstructured Database
  5. 5.RBAC
  6. 6.Back-ref
  7. 7.Back-populate
  8. 8.Cascading rules
  9. 9.define Relationship in DB
  10. 10.explain product edit -remove code
  11. 11.client and distributed Server
AM MAD1

Shared viva questions from response sheet: First asked to explain the code; Asked about:; decorators,

Questions remembered
  1. First asked to explain the code
  2. Asked about:
  3. decorators,
  4. orm,
  5. api,
  6. rest,
  7. GET, POST, PUT methods,
  8. rbac,
  9. What is model in db.model,
  10. logic in code for add product,
  11. HTTP,
  12. template inheritance,
  13. backref in model,
  14. Order of importance in CSS
  15. Difference between padding and cell spacing
  16. MVC-paradigm
  17. Suggested to build sales chart using Matplotlib, add more css and styling
  18. A good proctor
Sai Amrutha MAD1

Shared viva questions from response sheet: Change login button postion to top right corner; Define orm,decorator, mvc; In db=sqlalchemy() is sqlalchemy() class or function? Ans is class

Questions remembered
  1. Change login button postion to top right corner
  2. Define orm,decorator, mvc
  3. In db=sqlalchemy() is sqlalchemy() class or function? Ans is class
  4. Explain code for summary bar graph

Approved viva sets

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

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

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

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

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

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

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

  2. 2
    Explain your project code/workflow.
    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.

  3. 3
    Explain models.py.
    Times asked 21
    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.

  4. 4
    Explain the overall application architecture.
    Times asked 1
    Official solution

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

    Not microservices. Layered REST. Cache aur queue extra.

    Scale story alag: gunicorn, Postgres, more workers.

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

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

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

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

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

  5. 5
    Explain how a booking/application request flows through the system.
    Times asked 1
    Official solution

    SimpleSelect → qty → POST {id,qty} → auth seats duplicate → commit → 201 → UI ticket.

    API route flow new booking.

    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: book endpoint + Vue.

    Project example: book endpoint + Vue.

  6. 6
    Explain the login flow.
    Times asked 2
    Official solution

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

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

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

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

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

    Example

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

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

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

  7. 7
    Explain the eligibility logic implemented in your project.
    Times asked 1
    Official solution

    SimpleRules backend CGPA dept date. FE disable still 400. Explain eligibility.

    How add another validation thought process.

    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: apply drive checks.

    Project example: apply drive checks.

  8. 8
    Demonstrate backend jobs (Celery tasks).
    Times asked 1
    Official solution

    SimpleLive jobs: Redis, worker, beat, crontab abhi, logs + email/CSV.

    Scheduled vs user-triggered dono dikhao. Missing feature honestly.

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

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

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

    Suggested flow1) redis
    2) worker
    3) beat
    4) crontab now
    5) logs + MailHog

    Example

    CELERY_BEAT_SCHEDULE = {
      'daily-reminder': {
        'task': 'jobs.daily_reminder',
        'schedule': crontab(hour=18, minute=0),
      },
    }

    Project example: Change schedule current time. MailHog. Export button 202.

  9. 9
    Check API endpoints using Postman/Thunder Client.
    Times asked 1
    Official solution

    SimpleMethod URL Headers Authorization JSON body. 200/401 bina Vue — backend prove.

    Login copy token. Collection. Thunder Client same.

    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: Show 3 requests. Examiner loves this.

  10. 10
    Show whether cookies are created in the browser.
    Times asked 1
    Official solution

    SimpleApplication Cookies. JWT LS ho to cookies empty — dono jagah dikhao. Whether cookies created.

    Show browser cookies.

    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: If session cookie name. If not explain JWT.

  11. 11
    Move a button (e.g., Register/Signup) to the top-right corner.
    Times asked 1
    Official solution

    SimpleNavbar d-flex; ms-auto on signup. Bootstrap right push.

    Move button vs CSS only.

    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: Navbar.vue link order + ms-auto.

    Project example: Navbar.vue link order + ms-auto.

  12. 12
    Change the button color.
    Times asked 3
    Official solution

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

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

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

    Example

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

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

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

  13. 13
    Display all users' data.
    Times asked 1
    Official solution

    SimpleAdmin GET /api/users no passwords. Table v-for. Modify display all users.

    RBAC admin.

    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: serialize without hash.

    Project example: serialize without hash.

  14. 14
    Fix a monthly report/Celery task.
    Times asked 1
    Official solution

    Simplecrontab day, timezone, beat not running, empty query, logs.

    Schedule now to demo. Restart beat.

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

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

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

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

    Project example: Fix schedule + worker log error read.

  15. 15
    Write simple GET and POST API endpoints.
    Times asked 1
    Official solution

    SimpleGET list POST create 201. Write simple GET and POST API endpoints.

    Auth optional unless said.

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

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

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

    Project example: venues pattern.

  16. 16
    Move a <div> to another location and modify its formatting.
    Times asked 1
    Official solution

    SimpleCut HTML paste new parent adjust margin. Move a div another location modify formatting.

    Don't break script.

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

    Project example: template.

  17. 17
    What are GET and POST requests?
    Times asked 1
    Official solution

    SimpleGET retrieve idempotent. POST submit/create. Search GET login POST.

    What are GET and POST.

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

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

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

    Project example: List GET create POST.

  18. 18
    Where did you initialize the db object?
    Times asked 1
    Official solution

    Simpledb = SQLAlchemy() module, db.init_app factory. Import models to register.

    Where initialized db object.

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

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

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

    Project example: create_app.

    Project example: create_app.

  19. 19
    What is db.Model?
    Times asked 2
    Official solution

    Simpledb = SQLAlchemy instance. db.Model base — inherit mapping. db engine/session/metadata alag.

    Explain db vs model.py. Where init db object.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Project example: db = SQLAlchemy(); db.init_app(app); class X(db.Model).

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

    SimpleCelery instance, broker URL, @celery.task, worker command, Beat schedule.

    DB use karte waqt with app.app_context():. .delay() JSON-serializable args.

    Examiner files: celery.py / tasks.py / config beat dict / README commands.

    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 = Celery(__name__, broker='redis://localhost:6379/0')
    @celery.task
    def ping():
        return 'ok'

    Project example: jobs.py daily_reminder, monthly_report, export_csv. config.py broker.

  21. 21
    Explain the code of your backend tasks.
    Times asked 1
    Official solution

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

    Beat vs worker. User vs scheduled. App context.

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

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

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

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

    Project example: Three tasks. Commands README.

  22. 22
    How are Redis, Celery, and the backend integrated?
    Times asked 1
    Official solution

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

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

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

    Example

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

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

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

  23. 23
    Explain the data flow for a user-triggered Celery task.
    Times asked 1
    Official solution

    SimpleButton POST .delay() 202. Poll status. Beat nahi, worker haan.

    Export vs daily reminder difference.

    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: Export CSV button. Network 202.

    Project example: Export CSV button. Network 202.

  24. 24
    What is Role-Based Access Control (RBAC)?
    Times asked 1
    Official solution

    SimpleRBAC = role ka badge. Admin badge se delete, user badge se sirf book.

    Role-Based Access Control. Har user pe alag permission list nahi — roles.

    Models: User M-M Role association. Decorators @roles_required. Vue v-if + router meta.

    Frontend hide UX. Backend 403 real security.

    Example

    if current_user.roles[0].name != 'admin':
        return jsonify(msg='Forbidden'), 403

    Project example: roles_users table. admin stats API roles_required. User booking POST user role.

    Viva tipCode mein roles_required, Vue meta.role, models User↔Role many-to-many (roles_users table).

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

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

    Admin authenticated AND authorized. User authenticated not authorized admin.

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

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

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

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

    Project example: roles_required admin stats. User 403 Postman.

  26. 26
    How is user authentication performed?
    Times asked 1
    Official solution

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

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

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

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

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

    Example

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

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

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

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

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

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

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

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

    Example

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

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

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

  28. 28
    What is SQLAlchemy?
    Times asked 8
    Official solution

    SimpleSQLAlchemy toolkit + ORM. Flask-SQLAlchemy wrapper db.

    URI sqlite:///app.db. Postgres postgresql://. Dialects MySQL MSSQL.

    Session add/commit/rollback. IntegrityError catch.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Example

    app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db'
    # migrate: URI postgres://user:pass@host/db  + psycopg2

    Project example: config SQLALCHEMY_DATABASE_URI. db.create_all() ya migrate.

  29. 29
    What is a Foreign Key?
    Times asked 3
    Official solution

    SimpleForeign Key dusri table ki PK ki ungli pakadna. Relationship ka backbone.

    user_id → user.id. Referential integrity. Unique extra ho sakta 1-1 ke liye.

    Sirf UNIQUE se relationship nahi banti.

    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

    user_id = db.Column(db.Integer, db.ForeignKey('user.id', ondelete='CASCADE'))

    Project example: booking.user_id, show.venue_id. models.py dikhao.

  30. 30
    What are relationships in SQLAlchemy?
    Times asked 1
    Official solution

    Simple1-1 uselist=False. 1-M list. M-M association table roles_users.

    back_populates both sides. Draw viva.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Example

    roles_users = db.Table('roles_users',
        db.Column('user_id', db.Integer, db.ForeignKey('user.id')),
        db.Column('role_id', db.Integer, db.ForeignKey('role.id')),
    )
    class User(db.Model):
        roles = db.relationship('Role', secondary=roles_users, backref='users')

    Project example: User-Booking 1-M. User-Role M-M.

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

    Simplebackref jaadu se reverse attribute. back_populates dono taraf likho — clear.

    backref='author' Post.author auto. New code back_populates preferred.

    Examiner difference almost guaranteed.

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

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

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

    Bookings source of truth DB, Redis cache copy.

    Example

    posts = db.relationship('Post', backref='author')
    # vs
    posts = db.relationship('Post', back_populates='author')
    Post.author = relationship('User', back_populates='posts')

    Project example: User.bookings / Booking.user dono explicit back_populates.

  32. 32
    What is MVC?
    Times asked 8
    Official solution

    SimpleModel-View-Controller separation of concerns.

    Map folders. Vue is V. Flask routes C. models M.

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

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

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

    Example

    Vue Booking.vue → POST /api/book → Booking model → jsonify → this.bookings.push

    Project example: See architecture essay.

  33. 33
    What other architectural patterns have you used?
    Times asked 1
    Official solution

    SimpleLayered API/service/model, REST, pub-sub Redis, workers. Not microservices yet.

    What other architectural patterns. Backbone REST+router+models.

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

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

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

    Project example: MVC-ish + queue.

  34. 34
    Difference between Client-Server Architecture and Distributed Architecture.
    Times asked 1
    Official solution

    SimpleDistributed kai hosts: API, DB, Redis, workers. Client-server 2-tier simple.

    MAD2 chhota distributed (processes). Not full microservices.

    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: 5 processes localhost = mini distributed.

  35. 35
    What is Git?
    Times asked 3
    Official solution

    SimpleGit VCS tool. VCS concept. GitHub hosting. SCM another name.

    commit branch merge. Examiner history. Git ≠ GitHub.

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

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

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

    Project example: git log. collaborators. README.

  36. 36
    What is Version Control System (VCS)?
    Times asked 2
    Official solution

    SimpleGit VCS tool. VCS concept. GitHub hosting. SCM another name.

    commit branch merge. Examiner history. Git ≠ GitHub.

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

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

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

    Project example: git log. collaborators. README.

  37. 37
    Difference between Git and Version Control System.
    Times asked 1
    Official solution

    SimpleVCS category, Git implementation, GitHub remote+PR.

    Difference Git vs VCS vs GitHub three words.

    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: Local git, origin GitHub.

    Project example: Local git, origin GitHub.

  38. 38
    Have you used CSS or Bootstrap?
    Times asked 1
    Official solution

    SimpleBootstrap and/or CSS mix. One example class. Have you used CSS or Bootstrap.

    What styling framework.

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

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

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

    Project example: btn-primary + custom.css.

    Project example: btn-primary + custom.css.

  39. 39
    Why did you design the frontend this way?
    Times asked 1
    Official solution

    SimpleRole dashboards reuse navbar charts admin. UX reasons. Why designed frontend this way.

    Not random files.

    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 vs User layouts.

    Project example: Admin vs User layouts.

  40. 40
    Explain Parent–Child component communication with an example.
    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.

  41. 41
    Why are all dashboards using onMounted()?
    Times asked 1
    Official solution

    SimpleNeed DOM/API after insert. Pattern dashboards. Why all dashboards onMounted.

    created too early $refs.

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

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

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

    Project example: Admin+User dashboards.

  42. 42
    Difference between URL redirection and URL rewriting/navigation.
    Times asked 1
    Official solution

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

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

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

    Nayi page: SFC + routes entry + link.

    Example

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

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

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

  1. 1
    Show your ID card.
    Times asked 22
    Official solution

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

    Pehle se ID haath mein rakho. Glare mat aane do. Examiner screenshot/verify karta hai. Iske baad GitHub + project run.

  2. 2
    Give a complete demo of your application.
    Times asked 2
    Official solution

    SimpleDemo script pehle se practice karo, 5-7 minute, saari roles.

    Suggested flow

    1) Register/login user 2) Admin login — CRUD 3) Approval/blacklist 4) Booking/apply 5) Search 6) Validation edge (slots 0, duplicate) 7) Logout
    Bolte-bolte dikhao: 'Yahan overbooking rokta hoon'. Code tab kholna jab poochhein.
    Crash ho to debug calmly: terminal error, typo, DB path.
    Mandatory features skip mat karna — examiner list tick karta hai.

  3. 3
    Explain the complete project workflow.
    Times asked 2
    Official solution

    SimpleDemo script pehle se practice karo, 5-7 minute, saari roles.

    Suggested flow

    1) Register/login user 2) Admin login — CRUD 3) Approval/blacklist 4) Booking/apply 5) Search 6) Validation edge (slots 0, duplicate) 7) Logout
    Bolte-bolte dikhao: 'Yahan overbooking rokta hoon'. Code tab kholna jab poochhein.
    Crash ho to debug calmly: terminal error, typo, DB path.
    Mandatory features skip mat karna — examiner list tick karta hai.

  4. 4
    Explain the project structure.
    Times asked 2
    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.

  5. 5
    Explain the configuration file.
    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.

  6. 6
    Explain all dependencies/libraries used.
    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.

  7. 7
    Explain the database design.
    Times asked 2
    Official solution

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

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

    Example skeleton

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

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

  8. 8
    Explain all models.
    Times asked 2
    Official solution

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

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

    Example skeleton

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

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

  9. 9
    Explain all routes/controllers.
    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.

  10. 10
    Explain the HTML templates.
    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.

  11. 11
    Explain a specific feature's code and logic.
    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.

  12. 12
    Explain the login flow.
    Times asked 2
    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.

  13. 13
    Explain CRUD implementation.
    Times asked 1
    Official solution

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

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

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

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

  14. 14
    Explain system architecture/data flow.
    Times asked 1
    Official solution

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

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

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

  15. 15
    Explain authentication and authorization.
    Times asked 1
    Official solution

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

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

    Example (Flask):
    # Authentication

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

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

  16. 16
    Explain password hashing and verification.
    Times asked 1
    Official solution

    SimplePassword DB mein plain text mat rakho — hash store karo jo reverse nahi hota.

    from werkzeug.security import generate_password_hash, check_password_hash
    user.password = generate_password_hash(request.form['password'])
    check_password_hash(user.password, form_password)

    Hashing ≠ encryption. Leak pe bhi original password nahi milta (easy passwords rainbow table se — isliye salt + strong hash).
    Column String(200) kyunki hash lamba hota hai. unique=True password pe mat lagao.

  17. 17
    Explain user validation.
    Times asked 1
    Official solution

    SimpleValidation galat data rok ti hai — frontend turant, backend must.

    Frontend: required, min='18', maxlength='8', pattern='(?=.*[A-Z]).{8,}'
    Backend example:

    pwd = request.form.get('password','')
    if len(pwd) < 8 or not re.search(r'[A-Z]', pwd) or not re.search(r'[0-9]', pwd):
        flash('Weak password')

    Haan, regex se password rules ho sakte hain.
    Age 18-99, date >= today, slots <= 30 and > 0, confirm password == password, email '@' .
    Duplicate username: User.query.filter_by(email=email).first() or unique=True catch IntegrityError.
    Past date: if date < date.today(): reject. Negative slots: if slots < 0: reject; book pe available > 0 check.

  18. 18
    Explain how relationships are implemented.
    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.

  19. 19
    Explain a dynamic summary/chart implementation.
    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.

  20. 20
    Explain timer functionality (if implemented).
    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.

  21. 21
    What is MVC?
    Times asked 8
    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.

  22. 22
    Explain Model, View and Controller in your project.
    Times asked 1
    Official solution

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

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

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

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

  23. 23
    What is @app.route()?
    Times asked 1
    Official solution

    Simple@app.route URL ko Python function se jodta hai. @ wala cheez decorator hai.

    @app.route('/hello/<name>', methods=['GET'])
    def hello(name):
        return f'Hello {name}'

    Decorator function ko wrap karke extra behaviour deta hai (route register, login_required).
    Endpoint generally function name. Path /hello/Ram.
    <int:id> type converter — sirf integer. Bina converter string. ID chahiye to int safer.
    methods=['POST'] only POST. Default GET.
    functools.wraps custom decorator mein original function name/docs preserve karta hai.

  24. 24
    What is an endpoint?
    Times asked 1
    Official solution

    Simple@app.route URL ko Python function se jodta hai. @ wala cheez decorator hai.

    @app.route('/hello/<name>', methods=['GET'])
    def hello(name):
        return f'Hello {name}'

    Decorator function ko wrap karke extra behaviour deta hai (route register, login_required).
    Endpoint generally function name. Path /hello/Ram.
    <int:id> type converter — sirf integer. Bina converter string. ID chahiye to int safer.
    methods=['POST'] only POST. Default GET.
    functools.wraps custom decorator mein original function name/docs preserve karta hai.

  25. 25
    What is url_for()?
    Times asked 4
    Official solution

    Simpleurl_for Flask function/endpoint name se URL generate karta hai, hardcode path nahi.

    url_for('home') → '/'
    url_for('edit_user', id=5) → '/user/5/edit'
    Templates: href="{{ url_for('login') }}"

    Parameter: endpoint ka naam (function name), plus route variables.
    Galat naam: BuildError. Route rename karo to url_for automatic naya path dega — yahi fayda hai.

  26. 26
    Difference between url_for() and redirect().
    Times asked 2
    Official solution

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

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

    Example

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

    url_for ko function ka naam chahiye, URL path nahi.

  27. 27
    What is render_template()?
    Times asked 3
    Official solution

    Simplerender_template HTML file ko Jinja se process karke browser ko bhejta hai. Backend data ko frontend se jodta hai.

    return render_template('dashboard.html', user=user, treks=treks)

    File templates/dashboard.html honi chahiye.
    Keyword arguments template mein variables ban jaate hain: {{ user.name }}.
    Route kuch return na kare to Flask error. Boolean return typical HTML view ke liye nahi — string/Response chahiye.

  28. 28
    Difference between url_for() and render_template().
    Times asked 1
    Official solution

    Simpleurl_for URL nikalta hai, render_template HTML page return karta hai. Dono alag kaam.

    url_for('login') → '/login'
    render_template('login.html') → login page ka HTML
    
    Templates mein link ke liye: <a href="{{ url_for('dashboard') }}">Dashboard</a>
    Route mein page dikhane ke liye: return render_template('dashboard.html', user=user)

    url_for endpoint/function name leta hai, render_template HTML file name leta hai.

  29. 29
    What is app.py?
    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.

  30. 30
    What is models.py?
    Times asked 1
    Official solution

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

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

    Example skeleton

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

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

  31. 31
    What is functions.py?
    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
    What is ORM?
    Times asked 39
    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.

  33. 33
    Why do we use ORM?
    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.

  34. 34
    What is SQLAlchemy?
    Times asked 8
    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
    Is SQLAlchemy a class or a function? (Answer: Class)
    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.

  36. 36
    What is db = SQLAlchemy()?
    Times asked 1
    Official solution

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

    db = SQLAlchemy(app)

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

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

  37. 37
    What is db?
    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.

  38. 38
    Is db.Model a class or function?
    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.

  39. 39
    What is db.Model?
    Times asked 2
    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.

  40. 40
    Why do models inherit from db.Model?
    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.

  41. 41
    Where is the database initialized?
    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.

  42. 42
    From where does db inherit its properties?
    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.

  43. 43
    Explain db.relationship().
    Times asked 1
    Official solution

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

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

    Example 1-1:

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

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

  44. 44
    Why did you use relationships?
    Times asked 1
    Official solution

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

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

    Example 1-1:

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

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

  45. 45
    Explain your database relationships.
    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.

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

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

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

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

    Example

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

    Yahan Post.author automatically mil jaata hai.

    Explicit version:

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

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

  47. 47
    Why use back_populates instead of backref?
    Times asked 1
    Official solution

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

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

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

    Example

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

    Yahan Post.author automatically mil jaata hai.

    Explicit version:

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

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

  48. 48
    Explain inheritance in models.
    Times asked 1
    Official solution

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

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

    Example skeleton

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

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

  49. 49
    What is model inheritance?
    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.

  50. 50
    Structured vs Unstructured Database.
    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.

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

  52. 52
    What is REST?
    Times asked 3
    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.

  53. 53
    Explain HTTP.GET vs POST.
    Times asked 1
    Official solution

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

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

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

    Example

    # page dikhana

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

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

  54. 54
    Explain PUT.Explain all HTTP verbs you used.
    Times asked 1
    Official solution

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

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

    POSTcreate/submit. Form, login.

    PUTpoora replace/update. Idempotent.

    PATCHpartial update.

    DELETEhataana.

    HEAD: sirf headers. OPTIONS: CORS preflight.

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

  55. 55
    Explain API endpoints.
    Times asked 1
    Official solution

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

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

    Example

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

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

  56. 56
    Create a new API endpoint.
    Times asked 1
    Official solution

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

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

    Example

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

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

  57. 57
    Test API endpoints using Postman.
    Times asked 1
    Official solution

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

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

    Example

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

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

  58. 58
    How are APIs working in your project?
    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.

  59. 59
    Does an API return Boolean values?
    Times asked 1
    Official solution

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

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

    Example

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

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

  60. 60
    Explain login logic.
    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.

  61. 61
    Explain registration logic.
    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.

  62. 62
    How is authentication implemented?
    Times asked 1
    Official solution

    SimpleAuthentication session se, Authorization role/ownership check se.

    def admin_required(f):
        @wraps(f)
        def wrap(*a,**k):
            if session.get('role') != 'admin':
                abort(403)
            return f(*a,**k)
        return wrap

    Jinja: {% if session['role']=='admin' %}<a href='/admin'>Admin</a>{% endif %}
    Yeh hide hai, security nahi — route pe check zaroori. Admin authenticated bhi hai (logged in) aur authorized bhi (role).

  63. 63
    How is authorization implemented?
    Times asked 1
    Official solution

    SimpleAuthentication session se, Authorization role/ownership check se.

    def admin_required(f):
        @wraps(f)
        def wrap(*a,**k):
            if session.get('role') != 'admin':
                abort(403)
            return f(*a,**k)
        return wrap

    Jinja: {% if session['role']=='admin' %}<a href='/admin'>Admin</a>{% endif %}
    Yeh hide hai, security nahi — route pe check zaroori. Admin authenticated bhi hai (logged in) aur authorized bhi (role).

  64. 64
    What is RBAC?Explain RBAC implementation.
    Times asked 1
    Official solution

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

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

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

  65. 65
    Explain validation.Where have you implemented validation?
    Times asked 1
    Official solution

    SimpleValidation galat data rok ti hai — frontend turant, backend must.

    Frontend: required, min='18', maxlength='8', pattern='(?=.*[A-Z]).{8,}'
    Backend example:

    pwd = request.form.get('password','')
    if len(pwd) < 8 or not re.search(r'[A-Z]', pwd) or not re.search(r'[0-9]', pwd):
        flash('Weak password')

    Haan, regex se password rules ho sakte hain.
    Age 18-99, date >= today, slots <= 30 and > 0, confirm password == password, email '@' .
    Duplicate username: User.query.filter_by(email=email).first() or unique=True catch IntegrityError.
    Past date: if date < date.today(): reject. Negative slots: if slots < 0: reject; book pe available > 0 check.

  66. 66
    Password hashing.Which hashing library did you use?
    Times asked 1
    Official solution

    SimplePassword DB mein plain text mat rakho — hash store karo jo reverse nahi hota.

    from werkzeug.security import generate_password_hash, check_password_hash
    user.password = generate_password_hash(request.form['password'])
    check_password_hash(user.password, form_password)

    Hashing ≠ encryption. Leak pe bhi original password nahi milta (easy passwords rainbow table se — isliye salt + strong hash).
    Column String(200) kyunki hash lamba hota hai. unique=True password pe mat lagao.

  67. 67
    Git vs VCS.
    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.

  68. 68
    Client-Server Architecture vs Distributed Architecture.
    Times asked 1
    Official solution

    Simple2-tier = client seedha database se baat karta hai. 3-tier = beech mein application server hota hai.

    2-tier: UI + DB. Jaise desktop app directly SQLite. Simple, lekin security/scaling kam.
    3-tier: Presentation (browser) → Application (Flask) → Data (SQLite/MySQL). MAD1 project yahi hai.

    Examplebrowser HTML dikhata hai, Flask business logic (booking, auth), DB data store.

    Fayda: DB expose nahi, logic central, scale alag-alag tiers pe kar sakte ho.

  69. 69
    Why is your project Client-Server?
    Times asked 1
    Official solution

    SimpleClient maangta hai, Server jawab deta hai.

    Client: browser (Chrome). HTML/CSS/JS run, request bhejta hai.
    Server: Flask app. Route handle, DB query, response.
    Request-response: GET /dashboard → Flask HTML return → browser render.
    MAD1 project client-server hai kyunki browser aur Flask alag processes hain, HTTP se baat karte hain. Distributed tab kehlata jab kai servers/services alag machines pe hon.

  70. 70
    Difference between Client-Server and Distributed Systems.
    Times asked 1
    Official solution

    SimpleClient maangta hai, Server jawab deta hai.

    Client: browser (Chrome). HTML/CSS/JS run, request bhejta hai.
    Server: Flask app. Route handle, DB query, response.
    Request-response: GET /dashboard → Flask HTML return → browser render.
    MAD1 project client-server hai kyunki browser aur Flask alag processes hain, HTTP se baat karte hain. Distributed tab kehlata jab kai servers/services alag machines pe hon.

  71. 71
    Template Inheritance.
    Times asked 1
    Official solution

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

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

    base.html:

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

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

  72. 72
    Order of CSS specificity/priority.
    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.

  73. 73
    Difference between Cell Padding and Cell Spacing.
    Times asked 3
    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.

  74. 74
    Difference between Padding and Cell Spacing.
    Times asked 1
    Official solution

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

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

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

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

  75. 75
    How do you center text in HTML?
    Times asked 1
    Official solution

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

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

  76. 76
    Why use CSS?
    Times asked 1
    Official solution

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

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

  77. 77
    Can HTML templates handle Boolean values?
    Times asked 1
    Official solution

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

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

    POSTcreate/submit. Form, login.

    PUTpoora replace/update. Idempotent.

    PATCHpartial update.

    DELETEhataana.

    HEAD: sirf headers. OPTIONS: CORS preflight.

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

  78. 78
    Where is metadata used in HTML?
    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.

  79. 79
    Explain OOP concepts used in your project.
    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.

  80. 80
    Explain classes and inheritance in Python.
    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.

  81. 81
    Explain objects in your project.
    Times asked 1
    Official solution

    Examiner code pe ungli rakh ke poochta hai — panic mat karo, 4-line formula bolo.

    1) Yeh file/line kya role hai (model / route / template / config)?
    2) Input kahan se aata hai (form, URL <id>, session, JSON)?
    3) DB pe kya query/write?
    4) Output kya (render_template / redirect / jsonify)?

    Example

    @app.route('/book/<int:id>', methods=['POST']) — logged-in user session se, trek id URL se, Booking add, slots--, redirect history.

    Unknown line: imports (request, url_for, flash), decorators, if checks, commit — har keyword ka reason ready rakho.

  82. 82
    Explain Add Product logic.
    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 }}
  83. 83
    Explain Add Campaign logic.
    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 }}
  84. 84
    Explain Influencer Negotiation logic.
    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.

  85. 85
    Explain Update/Edit feature logic.
    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.

  86. 86
    Explain any route's logic.
    Times asked 1
    Official solution

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

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

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

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

  87. 87
    Explain controller-to-model workflow.
    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.

  88. 88
    Explain summary graph/bar chart code.
    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.

  89. 89
    Is your summary graph dynamic? Explain.
    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.

  90. 90
    Explain quiz timer implementation.
    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.

  91. 91
    Move the Login button to the top-right corner.
    Times asked 1
    Official solution

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

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

  92. 92
    Move the Signup/Register button to the top-right corner.
    Times asked 1
    Official solution

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

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

  93. 93
    Move the Submit button to the top-left corner.
    Times asked 1
    Official solution

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

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

  94. 94
    Swap two navbar elements.
    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.

  95. 95
    Center text using HTML/CSS.
    Times asked 1
    Official solution

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

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

  96. 96
    Explain every change while making it.
    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.

  97. 97
    Explain project code file by file.
    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.

  98. 98
    Explain one feature directly from the code.
    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.

  99. 99
    Show database tables.
    Times asked 1
    Official solution

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

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

    Example skeleton

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

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

  100. 100
    Show API endpoints (if any).
    Times asked 1
    Official solution

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

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

    Example

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

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

  101. 101
    Show charts implementation.
    Times asked 1
    Official solution

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

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

  102. 102
    Show project structure.
    Times asked 1
    Official solution

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

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

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

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

  103. 103
    Show database initialization.
    Times asked 1
    Official solution

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

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

    Example skeleton

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

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

  104. 104
    Explain why specific libraries were used.
    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.

  105. 105
    Explain how each feature connects together.
    Times asked 6
    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.

  106. 106
    Explain how each feature connects together.
    Times asked 6
    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.

  107. 107
    Explain how each feature connects together.
    Times asked 6
    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.

  108. 108
    Explain how each feature connects together.
    Times asked 6
    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.

  109. 109
    Explain how each feature connects together.
    Times asked 6
    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.

  110. 110
    Explain how each feature connects together.
    Times asked 6
    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.

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