-
1
Demonstrate your application.Times asked 8Official solution
SimpleDemo script pehle se practice karo, 5-7 minute, saari roles.
Suggested flow
1) Register/login user 2) Admin login — CRUD 3) Approval/blacklist 4) Booking/apply 5) Search 6) Validation edge (slots 0, duplicate) 7) Logout
Bolte-bolte dikhao: 'Yahan overbooking rokta hoon'. Code tab kholna jab poochhein.
Crash ho to debug calmly: terminal error, typo, DB path.
Mandatory features skip mat karna — examiner list tick karta hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
2
Change a button in the navigation bar to the right.Times asked 1Official solution
Yeh live UI/CSS change hai. Examiner jo element bole uski CSS turant badlo.
Bootstrap class badlo (btn-primary → btn-success, bg-dark → bg-warning) ya inline style='color:red; background:#eee'.
Center: d-flex justify-content-center text-center. Navbar neeche: navbar fixed-bottom.Example
<button class='btn btn-success' style='background:#16a34a'>Book</button>Pehle browser inspect karke class dhundo, phir template mein change karke refresh.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
3
Change a heading (e.g., "List of Songs" → "Songs").Times asked 1Official solution
Yeh live UI/CSS change hai. Examiner jo element bole uski CSS turant badlo.
Bootstrap class badlo (btn-primary → btn-success, bg-dark → bg-warning) ya inline style='color:red; background:#eee'.
Center: d-flex justify-content-center text-center. Navbar neeche: navbar fixed-bottom.Example
<button class='btn btn-success' style='background:#16a34a'>Book</button>Pehle browser inspect karke class dhundo, phir template mein change karke refresh.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
4
Show your database models and explain the relationships (one-to-one, one-to-many, etc.).Times asked 1Official solution
SimpleRelationships tables ko jodti hain taaki related data object se mil jaaye.
One-to-Many: User → kai Posts. posts = relationship('Post', backref='author'). FK post.user_id.
One-to-One: User → Profile. uselist=False + unique FK. Profile.user_id unique.
Many-to-Many: Student ↔ Drive. Junction/secondary table (student_id, drive_id).Example 1-1:
class Profile(db.Model): user_id = db.Column(db.Integer, db.ForeignKey('user.id'), unique=True) user = db.relationship('User', back_populates='profile', uselist=False)1-M ko 1-1: child FK pe unique=True + uselist=False.
Parent-child: parent PK, child FK. Junction table extra columns bhi rakh sakti hai (applied_on).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 statusExample 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.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
5
What is Template Inheritance?Times asked 10Official solution
Simpleextends poora layout inherit karta hai, include chhota piece insert karta hai.
extends: child page base.html ka structure use karti hai, blocks override karti hai. Ek hi parent.
include: navbar.html / footer.html jahan chaho insert. Kai baar use ho sakta hai.base.html:
{% block content %}{% endblock %} home.html: {% extends 'base.html' %} {% block content %}<h1>Home</h1>{% endblock %} {% include 'navbar.html' %} → navbar har page peFayda: header/footer ek jagah, change once — saari pages update. MAD1 mein almost har project use karta hai.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
6
What are Vue lifecycle hooks?Times asked 11Official solution
SimpleVue.js frontend framework — reactive UI components. MAD2 mein common, MAD1 optional.
Component: reusable UI (Navbar.vue) + data + template.
Props: parent → child data. Child → parent: $emit('update', val).
Slots: parent child ke andar extra HTML daal sakta hai.
Lifecycle: created (data setup), mounted (DOM ready — API call), updated, unmounted.
v-model two-way bind. Vue Router SPA routes (routes.js). Vuex/Pinia global state; mutations sync change, actions async.
Standalone component: khud ke saath compile, parent register kam.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
7
What are Vue components?Times asked 2Official solution
SimpleVue.js frontend framework — reactive UI components. MAD2 mein common, MAD1 optional.
Component: reusable UI (Navbar.vue) + data + template.
Props: parent → child data. Child → parent: $emit('update', val).
Slots: parent child ke andar extra HTML daal sakta hai.
Lifecycle: created (data setup), mounted (DOM ready — API call), updated, unmounted.
v-model two-way bind. Vue Router SPA routes (routes.js). Vuex/Pinia global state; mutations sync change, actions async.
Standalone component: khud ke saath compile, parent register kam.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
8
What are Vuex mutations and actions?Times asked 1Official solution
SimpleVue.js frontend framework — reactive UI components. MAD2 mein common, MAD1 optional.
Component: reusable UI (Navbar.vue) + data + template.
Props: parent → child data. Child → parent: $emit('update', val).
Slots: parent child ke andar extra HTML daal sakta hai.
Lifecycle: created (data setup), mounted (DOM ready — API call), updated, unmounted.
v-model two-way bind. Vue Router SPA routes (routes.js). Vuex/Pinia global state; mutations sync change, actions async.
Standalone component: khud ke saath compile, parent register kam.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
9
What is CSRF?Times asked 5Official solution
SimpleCSRF = Cross-Site Request Forgery — logged-in user ke browser se attacker site hidden form submit karwati hai.
FixCSRF token hidden field, server verify. Flask-WTF: {{ form.hidden_tag() }}
SameSite cookies bhi help. GET pe destructive action mat rakho.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
10
What is CORS?Times asked 8Official solution
SimpleCORS browser rule hai ki kaunsa frontend kis API ko call kar sake. XSS attacker ka JS tumhare page pe chalaata hai.
CORS: API header Access-Control-Allow-Origin. Vue (localhost:8080) Flask (5000) ko call kare to CORS chahiye. Same Flask+Jinja site pe usually issue nahi.
XSS: <script> cookie chori. Fix: escape output (Jinja autoescape), user HTML mat render karo.
CSRF alag: attacker user ke browser se hidden request. Fix: CSRF token (Flask-WTF).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
11
What is the difference between Security and Privacy?Times asked 1Official solution
Difference question hai — 3 cheezein bolo: meaning, kab use, 1 example.
Pehle concept A ek line, phir B ek line, phir table-jaisa farq (input/output/side-effect).
Example hamesha MAD1 se: GET search page, POST register, PUT/PATCH API update, session vs cookie login.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
12
What is ON DELETE CASCADE?Times asked 3Official solution
SimpleCascade parent ke saath child pe automatic action (generally delete).
Company delete → uski drives bhi delete, warna orphan rows / FK error.
SQLAlchemy: db.relationship('Drive', cascade='all, delete-orphan', backref='company')
SQL: ForeignKey(..., ondelete='CASCADE')Cascade sirf delete nahi: save-update, merge, refresh-expire, expunge, delete-orphan.
Cascade Update: parent PK change to child FK update (rare, PK mat badlo).
Parent delete jab children active hon: constraint error, ya cascade se children gayab, ya pehle children handle karo — design choice examiner poochta hai.
CSS cascading alag topic hai (styles inherit/override).Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
13
How do you handle data type errors in SQLAlchemy?Times asked 1Official solution
SimpleSQLAlchemy Python ka sabse popular ORM hai. MAD1 mein Flask-SQLAlchemy wrapper use hota hai.
db = SQLAlchemy(app)
class Book(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(80), nullable=False) Operations: db.session.add(obj), .commit(), .delete(obj), Model.query.all(), .filter_by(), .get_or_404(id). db.Model ek class hai (function nahi). db object engine + session + metadata hold karta hai.SQLALCHEMY_TRACK_MODIFICATIONS=False extra signals band karta hai, performance warning hatati hai.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
14
What is Redis?Times asked 21Official solution
SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.
User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
15
What is Celery?Times asked 19Official solution
SimpleCelery background tasks (email, CSV, reports) async chalaata hai. Redis broker/queue + cache.
User 'Export' click → Celery task queue → Redis message → worker CSV banaata hai → user baad mein download.
Saath isliye: Celery ko broker chahiye, Redis tez in-memory. MAD2 topic zyada, MAD1 mein optional.
Priority: task queues/routing. Caching: Redis mein key-value, DB hits kam.
Pub/Sub: publisher channel pe message, subscribers sunte hain — Redis yeh bhi karta hai.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
16
Explain the Publish–Subscribe (Pub/Sub) pattern.Times asked 1Official solution
SimpleValidation galat data rok ti hai — frontend turant, backend must.
Frontend: required, min='18', maxlength='8', pattern='(?=.*[A-Z]).{8,}'
Backend example:pwd = request.form.get('password','') if len(pwd) < 8 or not re.search(r'[A-Z]', pwd) or not re.search(r'[0-9]', pwd): flash('Weak password')Haan, regex se password rules ho sakte hain.
Age 18-99, date >= today, slots <= 30 and > 0, confirm password == password, email '@' .
Duplicate username: User.query.filter_by(email=email).first() or unique=True catch IntegrityError.
Past date: if date < date.today(): reject. Negative slots: if slots < 0: reject; book pe available > 0 check.Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
17
What is the difference between Vertical Scaling and Horizontal Scaling?Times asked 1Official solution
SimpleVertical = same machine ko powerful banao. Horizontal = aur machines add karo.
Vertical (scale up): RAM/CPU badhao. Simple, lekin ek limit hai, downtime ho sakta hai, single point of failure.
Horizontal (scale out): 5 servers + load balancer. Sasta long-term, fault tolerant, lekin session/DB sharing sochna padta hai.Example10k users aaye to Flask app ke 4 copies chalao nginx peeche, DB alag machine pe.
Thousands of requests on one machine: caching (Redis), DB indexes, gunicorn workers, phir horizontal.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
-
18
How would you scale an application?Times asked 1Official solution
SimpleVertical = same machine ko powerful banao. Horizontal = aur machines add karo.
Vertical (scale up): RAM/CPU badhao. Simple, lekin ek limit hai, downtime ho sakta hai, single point of failure.
Horizontal (scale out): 5 servers + load balancer. Sasta long-term, fault tolerant, lekin session/DB sharing sochna padta hai.Example10k users aaye to Flask app ke 4 copies chalao nginx peeche, DB alag machine pe.
Thousands of requests on one machine: caching (Redis), DB indexes, gunicorn workers, phir horizontal.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet