Shared viva questions from response sheet: the response right above this..; it is of viva level2
- the response right above this..
- it is of viva level2
Proctor workspace
Based on 33 student review(s) and 22 tip(s) for this examiner (grouped from similar proctor IDs).
Generally calm and student-friendly. Described as nice/helpful by students
Often probes theory concepts. Expects you to know and possibly modify your project code. May dig into database/models
• be completely clear on your code, and try to cover as much theory as you can, even on topics outside the syllabus • 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 • Focus on all the theory questions and make sure you have all implemented all the core functionalities. • Knoe your project well and also prepare from this sheet • Know your project well and prepare from this sheet, cover all the questions this examiner has asked previously, and you'll be fine. • 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 • 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. • 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. • Chill Proctor, Since I had my viva at EOD (10-11pm) he didn't ask too much questions (didnt ask me to change features) • Prepare all questions from this google sheet, it will certainly help you during Viva • 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. • 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 • proctor is good last he gave feedback .....no need for tension • learn the theory questions by heart and learn about APIs • feedback need to work on OOPS and API theoretical knowledge • go throught the previouly asked questions of these proctor and its quite enough • 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 .. • 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. • 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. • 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 • The proctor is very nice Be relax and answer all the questions • 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.
Shared viva questions from response sheet: the response right above this..; it is of viva level2
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.
The proctor is very nice
Be relax and answer all the questions
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
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.
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.
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 ..
go throught the previouly asked questions of these proctor and its quite enough
feedback
need to work on OOPS and API theoretical knowledge
learn the theory questions by heart and learn about APIs
proctor is good last he gave feedback .....no need for tension
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
Shared viva questions from response sheet: Level3_25; show ID; Run the application
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.
Prepare all questions from this google sheet,
it will certainly help you during Viva
Shared viva questions from response sheet: Code changes- changing of location of the login option to top right corner; Theory-; ORM
Chill Proctor, Since I had my viva at EOD (10-11pm) he didn't ask too much questions (didnt ask me to change features)
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.
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.
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
Know your project well and prepare from this sheet, cover all the questions this examiner has asked previously, and you'll be fine.
Knoe your project well and also prepare from this sheet
Focus on all the theory questions and make sure you have all implemented all the core functionalities.
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
be completely clear on your code, and try to cover as much theory as you can, even on topics outside the syllabus
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
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
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
Shared viva questions from response sheet: go through the main code and database; how did you implement databases; MVC
Shared viva questions from response sheet: What is MVC?; What is ORM?; What is the difference between client server and distributed server?
Shared viva questions from response sheet: 1.Explain code; 2.ORM; 3.MVC
Shared viva questions from response sheet: First asked to explain the code; Asked about:; decorators,
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
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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).
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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'), 403Project 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).
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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 + psycopg2Project example: config SQLALCHEMY_DATABASE_URI. db.create_all() ya migrate.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.pushProject example: See architecture essay.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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().
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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 nahiProject example: student login = authentication. Student admin dashboard nahi khol sakta = authorization.
Validation alag cheez hai (form sahi bhara hai ya nahi, jaise age 18+).
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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).
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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).
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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 wrapJinja: {% 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).
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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 wrapJinja: {% 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).
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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 peFayda: header/footer ek jagah, change once — saari pages update. MAD1 mein almost har project use karta hai.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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>
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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 }}
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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 }}
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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>
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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>
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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>
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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>
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet
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.
No replies yet
Open My solution to be the first to share yours.
Not submitted yet