Generally calm and student-friendly. Described as nice/helpful by students
Questioning style
Often probes theory concepts. Expects you to know and possibly modify your project code
Preparation tips
• She is helpful and also give feedback
• Pretty helpful proctor, will guide you if you're get stuck. If you mess up your practical, be prepared to answer theory well.
• just be confident and know your basics for routes and jinja syntax
• Know how to present your code and how to write the codes like queries , route and all
• be confident , she is very sweet and helpful
• She is very kind, just know the basics and you will be fine
• The proctor was very kind and helpful throughout the session.
Prepare your basics very well (especially Flask concepts, routes, models, and HTTP methods)
Be confident and calm during the viva
Practice writing small code snippets
• A very supportive proctor. I Enjoyed the viva completely and got very good remarks. Learn basic routing and html. Learn every bit of your code as they can ask from any part of the code. Be confident, learn basic theory and you will be fine.
• Shes a very nice person. Quite helpful. Saw that I'm nervous and assured me there is nothing to be nervous about. Also talked about future plans and placement and guided me on how i could leverage the projects in placements.
• She asked more questions but all of them were basic questions mostly once I wasn't able to answer repeatedly, I would say he thorough in your basics in jinja and what some of the keywords mean.Very chill gives you time and even helps you find the answer so don't give up until the end and always try your best to answer.
At the end she'll even ask about your career goals and what you should work on . So overall best examiner
• I don't about this AI percentage and all but be thorough with frontend also ,and logic and everything .
• Know your code, especially the models and backend thoroughly. She is really supportive, I fumbled lot of times but she helped me a lot. Gave me confidence as I was getting nervous. At the end even gave me a feedback and said to have self belief and confidence on myself, when I have done my work properly. Had a very inspiring conversation talking to her.
• She is very calm and supportive. If you are not able to answer then she will provide hints and help you. Just go through her previous questions and 90% questions will be the same
• mam is too supportive and wherever you feel struck dont lie or jargon tell straight related to what u know related to that and then she would help by providing hints and then u need to explain then
• She is calm not loud and guide you at the end of your viva...She made me wear my ear buds because of echo
• Just be calm & chill & give your best!! , Best Of Luck 😊👍
• If you have not studied your project well, or you are looking for a proctor who asks fewer questions, then you are in trouble.
If you have basic good understanding of MAD-1 theory and how it is applied in your project then she is one of the best proctors you can ever get.
She is very interactive, points out your mistakes, and even guides you if you go wrong while writing code. Overall she has a very good vibe, you might want to interact more with her.
If you don’t know something, do not try to act oversmart. Just admit that you don’t know. If you ask her the question back, she may explain it to you.
Be confident, clear, and respectful while answering.
You should have a strong understanding of app.py and models.py
Be prepared to write routes along with HTML forms or tables.
You should know basic frontend concepts. No need to go too deep into Bootstrap elements.
Go through all the questions mentioned about her in this sheet, 80–90% of them are likely to repeat.
• I think i might be missing 1 or 2 questions just know your code well and have basic knowledge of topics she is very nice she gave some hints during the coding question and asked me to drink water if i was feeling nervous
Maam is chill if you are having issues writing code then she will also hint somethings. for coding questions just ask what files you are allowed to look at for help for me i asked if i could look at my models file and she said yeah sure just dont look at other files
• Amazing proctor, extremely kind. Know your written work (code and theory concepts) well.
• at the end she was like that's all from my side i will evaluate based on your performance u give mostly right answers but the coding ques is 75% right only i was like 🥺
then she said why u seem so stressed i said i was bit nervous she said why u get confused and at last she said that's all if u have any ques ask u will se result once all the level 2 gets completed and wish me luck for my future
overall very sweet proctor i enjoy giving viva .
• She will give hints , I was blank and nervous so i messed up in some parts...overall it was good
• she is really sweet and help u throughout. be confident and do your best !
Tips for this examiner: She is helpful and also give feedback
Student reviews
Sheet responseMAD1
she is really sweet and help u throughout. be confident and do your best !
Questions remembered
- wht is "action' in html
- explain models and their relationship
- get and post
- coding ques similar to wht she's asking in the response sheet
- explain login and register route
and more around app.py only
HarshaaMAD1
She will give hints , I was blank and nervous so i messed up in some parts...overall it was good
Questions remembered
Id
Features and about the folders
Asked to create a viva.txt
Then in that I was asked to code like there exists a user table and we get input from user and add that record in the table and print user added successfully
Jinja a list was given and from that the numbers greater than 3 has to be printed
Some questions from the app.py why this line and all
Sheet responseMAD1
Shared viva questions from response sheet: Create a route which takes staff id at endpoint, defination staff_login, render template to user.html, which show Staff name at first page, it shows Staff id, trek name, Trek id; Just prepare this and every line it ,, why this why thiss you write here every single line of this code.; And little theory DOM
Questions remembered
Create a route which takes staff id at endpoint, defination staff_login, render template to user.html, which show Staff name at first page, it shows Staff id, trek name, Trek id
Just prepare this and every line it ,, why this why thiss you write here every single line of this code.
And little theory DOM
Get, Post
What happens if we submit a form with Get
What is debug=True
She ask a lot of little things
Very basics theory.
Datatype of this variable
like this
shivani jainMAD1
at the end she was like that's all from my side i will evaluate based on your performance u give mostly right answers but the coding ques is 75% right only i was like 🥺 then she said why u seem so stressed i said i was bit nervous she said why u get confused and at last she said that's all if u have any ques ask u will se result once all the level 2 gets completed and wish me luck for my future overall very sweet proctor i enjoy giving viva .
Questions remembered
mad 1 level 2 proctor:131
viva starts at 4:24 she came late
and then she asks for id
download from portal or run checksum i choose to download from portal
then she said okay you have already given demo twice once in video and in level1
we will start the main part i said okay sure sure
then she asks me to make viva.txt and write a code
create a route which takes id of user from url as a part of endpoint ,
with defination name user_login(), which renders user.html which displays
name of the user and all the trek id and trek name related to that in the form of table
then she said are u sure i was like😨uhmmm hmm she help a little bit to correct the code
the she asks okay tell me the folder and files structure in brief
then some back to back ques
backref
nullable
app.context
port
name=main
flask
why track modifications false
debug
tr td th
uselist
and 2 3 more
then she was like okay move through your controllers i will stop u and ques u
then she asks like 8 to 10 ques from that
current_app
render template
redicect
url for
which method
why int id
session
which session
which request
if get then how will details show
why some has int id and some has not
then asked to write render redirect and url for
BenishaMAD1
Amazing proctor, extremely kind. Know your written work (code and theory concepts) well.
Questions remembered
* Talk about the folder structure.
* Talk about Models and Relationships
* What is the function of the "name" attribute in a form.
* Coding Question - creating a route to basically display user detail and the trek details of what they booked.
* What is Command Line Argument
* More on Forms - POST, GET
* How to get retrieve data from a search input (query parameter)
* Flask Login - current_user - why is it used or preferred
Sabuj GhatakMAD1
I think i might be missing 1 or 2 questions just know your code well and have basic knowledge of topics she is very nice she gave some hints during the coding question and asked me to drink water if i was feeling nervous
Maam is chill if you are having issues writing code then she will also hint somethings. for coding questions just ask what files you are allowed to look at for help for me i asked if i could look at my models file and she said yeah sure just dont look at other files
Questions remembered
1.This is for level 2 viva
2.show id
3.explain everything in app.py (she will ask anything here by pointing to a line of code)
4.explain models.py(why the tables are designed the way they are for eg: i had a user table with all users where i had a role column to distinguish between trekkers staff and admin)
5.what is backref
6.what are the relationships between the models
7.what are orms
8.i had something called app_context and context_processor in my code she asked to explain that
9.create a route which takes trek id of user from url as a part of endpoint , with defination name trek(), which renders trek.html which displays the booking id , username and status of booking related to that particular trek in the form of table
Well WisherMAD1
If you have not studied your project well, or you are looking for a proctor who asks fewer questions, then you are in trouble. If you have basic good understanding of MAD-1 theory and how it is applied in your project then she is one of the best proctors you can ever get. She is very interactive, points out your mistakes, and even guides you if you go wrong while writing code. Overall she has a very good vibe, you might want to interact more with her. If you don’t know something, do not try to act oversmart. Just admit that you don’t know. If you ask her the question back, she may explain it to you. Be confident, clear, and respectful while answering. You should have a strong understanding of app.py and models.py Be prepared to write routes along with HTML forms or tables. You should know basic frontend concepts. No need to go too deep into Bootstrap elements. Go through all the questions mentioned about her in this sheet, 80–90% of them are likely to repeat.
Questions remembered
DOUBLE CLICK FOR FULL VIEW. LEVEL - 2
There was no demo required. She asked me to show my ID and perform the checksum or download the project. I chose to download the project.
She asked me to explain the structure of my application.
She told me to open models.py and explain the Admin table first, and then explain each table along with its relationship with other tables.
She asked me to create a file named viva.txt and write code defining a one-to-one relationship between Student and User. (I fumbled here.)
She asked me to write code to fetch a student from the Student table using ID.
She asked me to write code to fetch applications from a student (e.g., apps = student.applications).
She asked me to write code for a route along with HTML, where we take the ID from the URL then pass it to the backend then render an HTML page where display the Student Name as a heading and show a table containing Student’s Application ID and Application Status.She emphasized being careful about using methods=['GET', 'POST']. You should clearly know which method to use and why.
While writing HTML code, she asked the difference between <tr>, <td>, and <th>.
She asked me to open app.py and explain @app.template_filter('from_json') which I have used in my code. I explained that I used this for tables.js.
She asked me to open register_student.html and explain why I used pattern="[a-zA-Z0-9_]+"
She asked why I used minlength="6" and what type of validation it represents.
She asked what is enctype and what is this use for?
She asked how many types of HTTP methods are there? How many have you used? Why only GET and POST? What is PUT? If PUT is used for updating, why didn’t you use it? Why are only GET and POST commonly used in HTTP requests?
She asked what would happen if we use the GET method to send data to the server.
She asked how to extract data from query parameters in a URL.
After around 45 minutes, she said “This is all from my side.” Then she provided feedback and asked if I wanted to ask anything else. You should definitely ask for feedback on how you can improve your project or viva performance.
At the end, she asked, "What else are you doing apart from this degree? What resources or documentation did you refer to while building this project?"
JDMAD1
Just be calm & chill & give your best!! , Best Of Luck 😊👍
Questions remembered
Double click to view full!! (LEVEL 2) (im using casual eng while describing but during viva it was formal conversation!!)
show id & no demo, mam directly told i think u already done this stuff in viva 1, so we will proceed with your pro struc & asked to explain fronted backend database stuff & what i used, while u explain she may ask ques related to that thing like relationships etc, i told purpose of relationship, about orm etc, once she get a hint u know about that topic she may move on to next que, her voice was breaking & got disconnected but dont be panicked.
(CODE) Relationships between models, she asked me to make viva.txt & told what exactly i should do i mean like take id of the student from form(id.html) then gave me endpoint names, i done the frontend part then told bout backend like she told to create a route which renders id.html & inside this first get id then with this id i want to retrieve student name & their applications & render it in another html file & show this data in table format & may also ask corresponding info u may need to use orm python obj for data retrieval, (instead of filtering u can use apps=student.applications & pass it), during writing another student.html there she tested my jinga skills like loops conditions(sometime we forget to end loop/if like endfor endif or in var {{}} so dont forget coz sometimes she may not remind u but later deduct marks).
asked about http methods, use of name in form, what will happen if we try to submit method='GET'(ans - we get that value in url) & how will we retrieve it in backend(ans - request.args.get('name')), after i told its value will be in url then she asked me to write & show how the url will look like 💀.
Told to open app.py, then whats the use of secret_key, i imported migrate so asked about that module what it does, gave a situation suppose 2 users already exists & u used migrate & added 2 new columns using migrate then what will the prev 2 users value contain in new columns? (ans - NULL, ans are very simple so dont get panicked with length of que 😊), whats __name__='__main__', whats is session what is session.clear(), she asked to open route where student apply for apps, i opened apply route, she asked for creating apps u r using drive id & student id so i can see u r passing drive id so from where u r getting student id?(ans - from session), then after this she finally wrapped up.😊 Finally at end we had a small conversation about my career like what im interested in, r u doing this degree standalone, she also gave career advice coz i was nervous during viva, she was very friendly she may give hint if u r stuck somewhere & till now it was amazing experience during this viva. 😊
AarushiMAD1
She is calm not loud and guide you at the end of your viva...She made me wear my ear buds because of echo
Questions remembered
Project code and folder overview
Write new codes like fetch id from application and endpoint home that takes input form the form and appears on the home.html page something like that
That match the column question redirect render template and url_for()
Explain debug=True
And basic to moderate questions
omMAD1
mam is too supportive and wherever you feel struck dont lie or jargon tell straight related to what u know related to that and then she would help by providing hints and then u need to explain then
Questions remembered
1)download the project from portal
2)explain folder structure and importance of each line
3)open db.py and explain db related questions primary key foreign key how did u ensure one to one relationship tell the relationship btwn your tables what is secondary table etc
4)open app.py and show route of student applying for drive why <> why <int : > and then scroll down and why if name == _main_
5) redirect rendertemplate and url_for difference
6)get and post method and them in action in our code
7)how did u handle resume
8)how did u handle one student can apply for drive only once
9)write a sql query for inserting values into table
10)how did u get role into line xxx
like she told to scroll app.py and then was randomly asking questions
but if we struggle a bit she would help
11)make a viva.txt write a html and app.py code where a form is shown / name is shown
and then if he submits name should be shown
i wrote basic version and then with her guidance completed the code added jinja loops as her suggestion
12)asked about written code then
13)and then discussed about how did u learn and what do u do aside this degree etc etc
AayushiMAD1
She is very calm and supportive. If you are not able to answer then she will provide hints and help you. Just go through her previous questions and 90% questions will be the same
Questions remembered
• Write a query for retriving students applications
• Write a route and home.html which take a parameter name from a form and show it on a browser
• Match render_template, url_for, redirect
• why <name> is used in forms
• Realtionships between modals like one to one and one to many
• how is relationship one to one
• Why we use <int:id> in route
• Retreive student with help of primary key
Anuran GhoshMAD1
Know your code, especially the models and backend thoroughly. She is really supportive, I fumbled lot of times but she helped me a lot. Gave me confidence as I was getting nervous. At the end even gave me a feedback and said to have self belief and confidence on myself, when I have done my work properly. Had a very inspiring conversation talking to her.
Questions remembered
Ma'am is great and supportive. 1)Explain the outline of the project
Explain models.py and the relationships.
Write a query in Vscode by making viva.txt ( Was having confusion she corrected it)
Code a route and html page to return a name input given by the user ( my idea was right but was fumbling, she helped alot )
To match between render_template, redirect and url for
About the secret key what it does why it's needed
About actions in the html page 8)Why did I use <int> in the route 9)Explain the shortcuts in the models and code one shortcut accordingly 10)asked to explain the resume storing part.
Asked what is _main_ and why is it needed.
AnjaniMAD1
I don't about this AI percentage and all but be thorough with frontend also ,and logic and everything .
Questions remembered
> Will you download the application from the website or do the check sum .
> After downloading the application , told me to run the app . After this is done successfully .
> mam said to explain the the application starting from the models.py .
> While explaining the models mam asked me a question why is a particular relationship one to one and then how did you do that as one to one , (by adding uselist=False)
> Then gave a coding question query the user table and then return the output I have answered it .
> Then matching like url_for and render_template and then redirect she will give things like abc.html , /login , abc_func() so we need to map these to the particular urls .
> Then mam gave a coding question which is big she that is creating a form with the select options and then return the output , this I fumbled , I wanted to be honest I didn't suddently remember the form method and how to create a dropdown I tensed also in the middle , for this question I said I have used AI for frontend . mam only helped and then she only guided to solve this problem and then .
> Went thorough the app.py and asked some questions like what is the use of __main__ what happens if we remove this __main__ and run this in another file , and then
> what is the use of secret key - this simply I told it prevents unauthorised people from accessing it and then
> mam asked about why we use <int:user_id>
> At last madam asked told that's it from my side , overall it was good and then you have answered some questions properly and then some not proper so I will review your performance . and then mam told me you should not say directly that you have used AI you say something like I have referred to it , so should I cut the marks for the front end , and then she told me to prepare for your future and then also she asked me are you doing this as a standalone degree or doing an internship , and then mam told me if it standalone then you should learn everything thoroughly I said I have other project also ,since mam was speaking I could n't interrupt her and then that's it
I have answered most of the questions only in the frontend part I fumbled . Mam was friendly kind and then she guided whenever I fumbled
>> this is not how exactly mam asked it but this I wrote in my own words .>>
MithranMAD1
She asked more questions but all of them were basic questions mostly once I wasn't able to answer repeatedly, I would say he thorough in your basics in jinja and what some of the keywords mean.Very chill gives you time and even helps you find the answer so don't give up until the end and always try your best to answer. At the end she'll even ask about your career goals and what you should work on . So overall best examiner
Questions remembered
1)what is request.args.get() //i fumbled this so hard , she literally explained it to me but i was in my denial phase, so this is the answer to the 8th question here
write route in viva.txt to get username and display it dynamically(no database)
what is ORM 4)a=[1,2,3,4,5] and print greater than 2 in jinja 5)flow of the viva.txt program
query to enter a new user 7)how to retrieve the information in the url when get method is used 8)<int:userid>, why use that? And alternative ways to achieve the same result 9)what are actions //at this point I was cooked
match the following render_template,login,url()
difference between link and a tag
Sheet responseMAD1
Shes a very nice person. Quite helpful. Saw that I'm nervous and assured me there is nothing to be nervous about. Also talked about future plans and placement and guided me on how i could leverage the projects in placements.
Questions remembered
No demo direct question.
Explain the basic structure of your project 3)Went through models files asked me to explain it then asked me specific questions like like what relationships are there in the model and how would u use backref to write a query to find the application without writing an explicit query.
Asked me diff btw GET and POST and can we create data using get.
Coding question- Make viva.txt file where u make route and a input form where the route takes the input from the form and shows it on the browser itself without an output file.
What is the need for name atribute in the form.
How does POST method get called- answer is the method= post in the form and then by clicking the submit button.
What is the code to fetch argument from url. 9)Project Specific question like how and where is the resume stored.
Why did u write <int:id> in the route and what will be the type of id in the subsequent function. 11)Why did i use blueprint class.
Explain the processs of profile change of student.
why did u write request.files.get for pdf and photo ( show both route and html)
match the following with reason- redirect-/login, render_template-login.html url_for-user.login()
HiteshMAD1
A very supportive proctor. I Enjoyed the viva completely and got very good remarks. Learn basic routing and html. Learn every bit of your code as they can ask from any part of the code. Be confident, learn basic theory and you will be fine.
Questions remembered
Explain what files you have made and briefly explain about them.
What are the relationships used in your model?
How does backref works and write a code to fetch applications without using explicit query?(In a newly created viva.txt file)
I had a Admin class, so told me to write codes to add data for a new admin in viva.txt.
Diff between authentication and authorisation.
Write a route for /home which will render a html file for a form to submit a name and that name will be displayed in the browser itself.
How have u handled the resume storage ? Explain those block of codes.
Routes like: '/delete/<int:id>', explain why u have used these.
Have you used template inheritance? What is it?
Allignment of 2 diff texts inside 2 different span tag and 2 Different paragraph tag.
Write a code to fetch company by their id in viva.txt.
Ayush GangwaniMAD1
The proctor was very kind and helpful throughout the session. Prepare your basics very well (especially Flask concepts, routes, models, and HTTP methods) Be confident and calm during the viva Practice writing small code snippets
Questions remembered
1. The proctor joined the session around 15 minutes late.
2. She first checked my ID card for verification.
3.Then she asked whether I wanted to perform checksum verification or download from the portal. I chose to download from the portal.
4.When I was about to run my app.py, she stopped me and asked to first show app.py and models.py.
5.She then asked questions about database relationships used in the project.
6.She gave a coding question: the database already has a User table with only a name field, and I had to explain how to add new data into it. She asked me to write the answer in a file named viva.txt.
7.Next, she asked: if there is a relationship between Student and Application, how will you fetch application data without writing an explicit query?
8.She asked me to explain the User model.
9.Then she asked me to explain the Register Student route, including how it works and the difference between GET and POST methods.
10.She asked: if the Submit button triggers GET instead of POST, then where will the data be visible?
11.Match the following question: redirect → /login, render_template → /login.html, url_for → login.
12.Another coding question (in viva.txt): write a route and HTML form where the user enters a name and on submit, the data is stored in the database.
13.She asked the difference between Authentication and Authorization.
14.At the end, she said my overall viva was good but I fumbled slightly in basic questions, so she would deduct some marks.
She suggested improving the project by adding more technologies and making it portfolio-ready.
She also asked about my field of interest.
The total viva duration was around 35 minutes.
HMMAD1
She is very kind, just know the basics and you will be fine
Questions remembered
project structure
relationship between tables
adding a username to the database(CRUD)
updating the username using name not id
creating a html form to take input username, and route to print that name and then run to see if it works
authentication vs authorization
block vs inline
how is the post method triggered
get post use
command line arguments
command used to get data
importance of name in html
defining one to one, many to one relationships
url_for() and redirect method, what parameter goes with option
endpoint of routes explanation
Sheet responseMAD1
be confident , she is very sweet and helpful
Questions remembered
VIVA - 2
Explain brief structure of your project ( how did u implemented models , views , controllers ?
Know how to present your code and how to write the codes like queries , route and all
Questions remembered
Explain the relationships of models
Write SQL query
Write jinja loop
Write a route
CRUD - create new user and add
Explain the check availability route
In html page what is the name doing in input tag
In html , in the form tag what will happen if i change the method from POST to GET
What is command line
Gave option for what will go in url_for() and redirect(). Option - /home , home.html , home
What is DOM
route for endpoint like /sum/a/b where i want sum of a and b
Sheet responseMAD1
just be confident and know your basics for routes and jinja syntax
Questions remembered
LEVEL 2 VIVA
THEORY QNS -
- explain project structure
- open models.py and explain relationships
- how have you defined 1:1, 1:N, N:M relationships in the code
- how have you implemented add doctor logic, what is the data flow process
- what are http methods
- can you use put instead of post for a form? what will happen if you use put?
- when is post method triggered?
- what goes inside the parentheses in url_for() and redirect()? options - /login, login.html, user_login()
- authentication vs authorization
- what is version control?
- what is the git command for creating new branch?
CODE CHANGES -
- write ORM query to add a new department to the department model
- on admin dashboard it shows total no. of doctors, patients, appointments in a row - make it so it displays it one below another in a column
- create a new file test.py and write a route /course/course_name. it should print "course is [course_name] on the screen. run and demonstrate it.
- consider list a = [1,2,3]. write a jinja for loop to print elements in 'a' that are greater than 1
NAMAD1
Pretty helpful proctor, will guide you if you're get stuck. If you mess up your practical, be prepared to answer theory well.
Questions remembered
Diff between block and inline
Authorization, Authentication, Validation
Write code to show how to commit user to db
Git commit message
What does local host mean?
Create a HTML form to receive username and the corresponding python route to receive and print it.
What is DOM? What does it actually do?
Sheet responseMAD1
She is helpful and also give feedback
Questions remembered
first tell me the project workflow (ex:-controller.py , models.py etc)
asked me to open admin dashboard html page and asked what is 'name'
tell me to run the app and create a booking spot
authorization, authentication , validation
block element, inline 6)a git command 7)code changes: - 1) db command to add a parking spot at 10 no spot
told me to make cards of admin dashboard line by line as column as mine were in side by side like row
Alok TripathiMAD1
Shared viva questions from response sheet: explain the project structure. what files and folders did you create; what happens in a route that handles both get and post method??; How is the post method triggered?
Questions remembered
explain the project structure. what files and folders did you create
what happens in a route that handles both get and post method??
How is the post method triggered?
What is RegisterForm and where is it defined?
Have you used ORM, what is that??
open you models, explain these classes and relationship b/w them..
What is a foreign key?
How do you add a new user to the database using sqlalchemy?
Why did you use flask migrate??
What are crud operations?
Explain what happens step by step when a user registers.
What is the difference b/w authentication, authorization and validation??
How do you protect routes so only logged-in users can access them?
In jinja how does accessing reservation.spot.lot.name work??
What is `.parking-summary-card` and what does the `.` mean in CSS?
What is display: flex used for?
How can you make a section take only half of the page width?
How would you add a hover effect on a button?
What js did you use in your project?
Open the code of chart.js and explain it.
did you implement a search feature in your app?
Can you open and explain the HTML form and route logic used for search?
What are the different http methods??
Can you submit a form using put or delete methods directly from a browser?
Then in that I was asked to code like there exists a user table and we get input from user and add that record in the table and print user added successfully
Create a route which takes staff id at endpoint, defination staff_login, render template to user.html, which show Staff name at first page, it shows Staff id, trek name, Trek id
Times asked1
Official solution
SimpleProject overview: problem → roles → main entities → key flows (register, book, admin approve).
Viva tip1 minute elevator pitch ready rakho, phir demo.
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
Just prepare this and every line it ,, why this why thiss you write here every single line of this code.
Advice: at the end she was like that's all from my side i will evaluate based on your performance u give mostly right answers but the coding ques is 75% right only i was like 🥺
then she said why u seem so stressed i said i was bit nervous she said why u get confused and at last she said that's all if u have any ques ask u will se result once all the level 2 gets completed and wish me luck for my future
overall very sweet proctor i enjoy giving viva .
SimpleORM = Object Relational Mapping. Tables → Python classes. Raw SQL kam likhte ho.
Example
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True)
User.query.get(5) # SELECT ... WHERE id=5
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
9.create a route which takes trek id of user from url as a part of endpoint , with defination name trek(), which renders trek.html which displays the booking id , username and status of booking related to that particular trek in the form of table
Times asked1
Official solution
SimpleORM = Object Relational Mapping. Tables → Python classes. Raw SQL kam likhte ho.
Example
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True)
User.query.get(5) # SELECT ... WHERE id=5
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
Advice: I think i might be missing 1 or 2 questions just know your code well and have basic knowledge of topics she is very nice she gave some hints during the coding question and asked me to drink water if i was feeling nervous
Maam is chill if you are having issues writing code then she will also hint somethings. for coding questions just ask what files you are allowed to look at for help for me i asked if i could look at my models file and she said yeah sure just dont look at other files
if not email or '@' not in email:
flash('Invalid email')
return redirect(request.url)
if User.query.filter_by(email=email).first():
flash('Email taken')
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
She asked what is enctype and what is this use for?
After around 45 minutes, she said “This is all from my side.” Then she provided feedback and asked if I wanted to ask anything else. You should definitely ask for feedback on how you can improve your project or viva performance.
Viva tip1-2 concrete features bolo jo time milne pe add karte — vague 'AI' mat.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
Advice: If you have not studied your project well, or you are looking for a proctor who asks fewer questions, then you are in trouble.
If you have basic good understanding of MAD-1 theory and how it is applied in your project then she is one of the best proctors you can ever get.
She is very interactive, points out your mistakes, and even guides you if you go wrong while writing code. Overall she has a very good vibe, you might want to interact more with her.
If you don’t know something, do not try to act oversmart. Just admit that you don’t know. If you ask her the question back, she may explain it to you.
Be confident, clear, and respectful while answering.
You should have a strong understanding of app.py and models.py
Be prepared to write routes along with HTML forms or tables.
You should know basic frontend concepts. No need to go too deep into Bootstrap elements.
Go through all the questions mentioned about her in this sheet, 80–90% of them are likely to repeat.
show id & no demo, mam directly told i think u already done this stuff in viva 1, so we will proceed with your pro struc & asked to explain fronted backend database stuff & what i used, while u explain she may ask ques related to that thing like relationships etc, i told purpose of relationship, about orm etc, once she get a hint u know about that topic she may move on to next que, her voice was breaking & got disconnected but dont be panicked.
Times asked1
Official solution
Simpledb.relationship se object graph: lot.spots, booking.user. backref reverse side auto deta hai.
asked about http methods, use of name in form, what will happen if we try to submit method='GET'(ans - we get that value in url) & how will we retrieve it in backend(ans - request.args.get('name')), after i told its value will be in url then she asked me to write & show how the url will look like 💀.
Times asked1
Official solution
SimpleORM = Object Relational Mapping. Tables → Python classes. Raw SQL kam likhte ho.
Example
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True)
User.query.get(5) # SELECT ... WHERE id=5
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
Told to open app.py, then whats the use of secret_key, i imported migrate so asked about that module what it does, gave a situation suppose 2 users already exists & u used migrate & added 2 new columns using migrate then what will the prev 2 users value contain in new columns? (ans - NULL, ans are very simple so dont get panicked with length of que 😊), whats __name__='__main__', whats is session what is session.clear(), she asked to open route where student apply for apps, i opened apply route, she asked for creating apps u r using drive id & student id so i can see u r passing drive id so from where u r getting student id?(ans - from session), then after this she finally wrapped up.😊 Finally at end we had a small conversation about my career like what im interested in, r u doing this degree standalone, she also gave career advice coz i was nervous during viva, she was very friendly she may give hint if u r stuck somewhere & till now it was amazing experience during this viva. 😊
Times asked1
Official solution
SimpleCamera pe clearly college/IITM ID dikhao — naam aur photo match hone chahiye.
Viva tipPehle se ID haath mein rakho, glare mat aane do. Iske baad GitHub + project run.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
Advice: Just be calm & chill & give your best!! , Best Of Luck 😊👍
Suggested flow1) Concept kya hai?
2) Mere code mein kahan?
3) Example / demo
4) Edge case
Example
# related file: models.py / routes / template
# formula: request → check/auth → DB → render/redirect
Viva tipExact line yaad nahi to honestly related part dikhao. Bluff mat karo.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
Advice: mam is too supportive and wherever you feel struck dont lie or jargon tell straight related to what u know related to that and then she would help by providing hints and then u need to explain then
Suggested flow1) Concept kya hai?
2) Mere code mein kahan?
3) Example / demo
4) Edge case
Example
# related file: models.py / routes / template
# formula: request → check/auth → DB → render/redirect
Viva tipExact line yaad nahi to honestly related part dikhao. Bluff mat karo.
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
• Retreive student with help of primary key
Times asked1
Official solution
SimplePrimary key row ka unique identity — usually id Integer autoincrement.
Example
id = db.Column(db.Integer, primary_key=True)
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
Advice: She is very calm and supportive. If you are not able to answer then she will provide hints and help you. Just go through her previous questions and 90% questions will be the same
Viva tipFunction signature + 3-4 important lines + edge case.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
Advice: Know your code, especially the models and backend thoroughly. She is really supportive, I fumbled lot of times but she helped me a lot. Gave me confidence as I was getting nervous. At the end even gave me a feedback and said to have self belief and confidence on myself, when I have done my work properly. Had a very inspiring conversation talking to her.
> While explaining the models mam asked me a question why is a particular relationship one to one and then how did you do that as one to one , (by adding uselist=False)
Times asked1
Official solution
Simpledb.relationship se object graph: lot.spots, booking.user. backref reverse side auto deta hai.
> Then gave a coding question query the user table and then return the output I have answered it .
Times asked1
Official solution
SimpleLive coding: notepad/editor mein chhota Flask route / Jinja loop / model field. Calm raho, run karke dikhao.
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
> Then matching like url_for and render_template and then redirect she will give things like abc.html , /login , abc_func() so we need to map these to the particular urls .
Times asked1
Official solution
Simplerender_template Jinja HTML file ko data deke final HTML banata hai.
> Then mam gave a coding question which is big she that is creating a form with the select options and then return the output , this I fumbled , I wanted to be honest I didn't suddently remember the form method and how to create a dropdown I tensed also in the middle , for this question I said I have used AI for frontend . mam only helped and then she only guided to solve this problem and then .
Times asked1
Official solution
SimpleLive coding: notepad/editor mein chhota Flask route / Jinja loop / model field. Calm raho, run karke dikhao.
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
> Went thorough the app.py and asked some questions like what is the use of __main__ what happens if we remove this __main__ and run this in another file , and then
Times asked1
Official solution
SimpleLive UI change: relevant CSS/HTML template kholo — color, margin, flex, bootstrap class. Save + hard refresh.
Example
/* button red */
.btn-primary { background: red; }
/* center navbar item */
.navbar { justify-content: center; }
Viva tipDevTools se pehle try, phir file mein permanent change.
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 is the use of secret key - this simply I told it prevents unauthorised people from accessing it and then
Suggested flow1) Concept kya hai?
2) Mere code mein kahan?
3) Example / demo
4) Edge case
Example
# related file: models.py / routes / template
# formula: request → check/auth → DB → render/redirect
Viva tipExact line yaad nahi to honestly related part dikhao. Bluff mat karo.
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
> At last madam asked told that's it from my side , overall it was good and then you have answered some questions properly and then some not proper so I will review your performance . and then mam told me you should not say directly that you have used AI you say something like I have referred to it , so should I cut the marks for the front end , and then she told me to prepare for your future and then also she asked me are you doing this as a standalone degree or doing an internship , and then mam told me if it standalone then you should learn everything thoroughly I said I have other project also ,since mam was speaking I could n't interrupt her and then that's it
Times asked1
Official solution
SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest 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
11
I have answered most of the questions only in the frontend part I fumbled . Mam was friendly kind and then she guided whenever I fumbled
Times asked1
Official solution
SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest 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
12
>> this is not how exactly mam asked it but this I wrote in my own words .>>
1)what is request.args.get() //i fumbled this so hard , she literally explained it to me but i was in my denial phase, so this is the answer to the 8th question here
@app.route('/ping')
def ping():
return jsonify(ok=True)
@app.route('/even/<int:n>')
def even(n):
return 'even' if n % 2 == 0 else 'odd'
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
query to enter a new user 7)how to retrieve the information in the url when get method is used 8)<int:userid>, why use that? And alternative ways to achieve the same result 9)what are actions //at this point I was cooked
Viva tipUnknown keyword: import, decorator, if, commit — har ka reason. Panic mat.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
Advice: She asked more questions but all of them were basic questions mostly once I wasn't able to answer repeatedly, I would say he thorough in your basics in jinja and what some of the keywords mean.Very chill gives you time and even helps you find the answer so don't give up until the end and always try your best to answer.
At the end she'll even ask about your career goals and what you should work on . So overall best examiner
Coding question- Make viva.txt file where u make route and a input form where the route takes the input from the form and shows it on the browser itself without an output file.
Times asked1
Official solution
SimpleLive coding: notepad/editor mein chhota Flask route / Jinja loop / model field. Calm raho, run karke dikhao.
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
What is the need for name atribute in the form.
Times asked1
Official solution
SimpleORM = Object Relational Mapping. Tables → Python classes. Raw SQL kam likhte ho.
Example
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True)
User.query.get(5) # SELECT ... WHERE id=5
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
How does POST method get called- answer is the method= post in the form and then by clicking the submit button.
Times asked1
Official solution
SimpleGET data read/show karta hai (idempotent). POST create/submit karta hai (form).
@app.route('/ping')
def ping():
return jsonify(ok=True)
@app.route('/even/<int:n>')
def even(n):
return 'even' if n % 2 == 0 else 'odd'
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
Advice: Shes a very nice person. Quite helpful. Saw that I'm nervous and assured me there is nothing to be nervous about. Also talked about future plans and placement and guided me on how i could leverage the projects in placements.
@app.route('/ping')
def ping():
return jsonify(ok=True)
@app.route('/even/<int:n>')
def even(n):
return 'even' if n % 2 == 0 else 'odd'
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
Advice: A very supportive proctor. I Enjoyed the viva completely and got very good remarks. Learn basic routing and html. Learn every bit of your code as they can ask from any part of the code. Be confident, learn basic theory and you will be fine.
1. The proctor joined the session around 15 minutes late.
Times asked1
Official solution
SimpleMAD1 mein usually session-based auth: login pe session['user_id'], har request pe verify.
Example
session['user_id'] = user.id
uid = session.get('user_id')
user = User.query.get(uid)
Viva tipSECRET_KEY set karo warna session insecure. logout pe session.clear().
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
2. She first checked my ID card for verification.
Times asked1
Official solution
SimpleCamera pe clearly college/IITM ID dikhao — naam aur photo match hone chahiye.
Viva tipPehle se ID haath mein rakho, glare mat aane do. Iske baad GitHub + project run.
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
3.Then she asked whether I wanted to perform checksum verification or download from the portal. I chose to download from the portal.
Times asked1
Official solution
SimpleExaminer portal wala submitted ZIP chahta hai. Local extra changes mat dikhana.
Suggested flow1) Portal ZIP download
2) Extract
3) venv + pip install -r requirements.txt
4) flask run / python app.py
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
4.When I was about to run my app.py, she stopped me and asked to first show app.py and models.py.
Times asked1
Official solution
Simplemodels.py = har table ki class: columns, PK/FK, relationships. Yeh Model layer hai.
Suggested flow1) Classes list karo
2) Har table ka kaam 1 line
3) Relationships (1-M / M-M)
4) Constraints (unique, nullable)
Example
class Lot(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), nullable=False)
spots = db.relationship('Spot', backref='lot', lazy=True)
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
5.She then asked questions about database relationships used in the project.
Times asked1
Official solution
Simpledb.relationship se object graph: lot.spots, booking.user. backref reverse side auto deta hai.
6.She gave a coding question: the database already has a User table with only a name field, and I had to explain how to add new data into it. She asked me to write the answer in a file named viva.txt.
Times asked1
Official solution
SimpleLive coding: notepad/editor mein chhota Flask route / Jinja loop / model field. Calm raho, run karke dikhao.
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
7.Next, she asked: if there is a relationship between Student and Application, how will you fetch application data without writing an explicit query?
Times asked1
Official solution
Simpledb.relationship se object graph: lot.spots, booking.user. backref reverse side auto deta hai.
Simplemodels.py = har table ki class: columns, PK/FK, relationships. Yeh Model layer hai.
Suggested flow1) Classes list karo
2) Har table ka kaam 1 line
3) Relationships (1-M / M-M)
4) Constraints (unique, nullable)
Example
class Lot(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), nullable=False)
spots = db.relationship('Spot', backref='lot', lazy=True)
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
10.She asked: if the Submit button triggers GET instead of POST, then where will the data be visible?
Times asked1
Official solution
SimpleGET data read/show karta hai (idempotent). POST create/submit karta hai (form).
Suggested flow1) Concept kya hai?
2) Mere code mein kahan?
3) Example / demo
4) Edge case
Example
# related file: models.py / routes / template
# formula: request → check/auth → DB → render/redirect
Viva tipExact line yaad nahi to honestly related part dikhao. Bluff mat karo.
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
The total viva duration was around 35 minutes.
Times asked1
Official solution
SimpleViva wrap-up hai. Short thanks + confirm submission ZIP latest 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
Advice: The proctor was very kind and helpful throughout the session.
Prepare your basics very well (especially Flask concepts, routes, models, and HTTP methods)
Be confident and calm during the viva
Practice writing small code snippets
first tell me the project workflow (ex:-controller.py , models.py etc)
Times asked1
Official solution
Simplemodels.py = har table ki class: columns, PK/FK, relationships. Yeh Model layer hai.
Suggested flow1) Classes list karo
2) Har table ka kaam 1 line
3) Relationships (1-M / M-M)
4) Constraints (unique, nullable)
Example
class Lot(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), nullable=False)
spots = db.relationship('Spot', backref='lot', lazy=True)
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
asked me to open admin dashboard html page and asked what is 'name'
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.
Community answers
2 replies
·
Browse student answers
B
bn
so yea i will go to portal and screen share and show my id
A
an
ill show my id
My solution
Not submitted yet
2
Download the project from the Viva Portal or perform checksum.
Times asked5
Official solution
SimpleChecksum file ka hash (jaise SHA256) — file change hui ya nahi verify.
Portal pe submitted ZIP ka checksum diya hota hai. Local file ka hash nikaalo, match hona chahiye.
Linux: sha256sum project.zip
Mismatch = galat file / corrupt download. Examiner integrity check karta hai ki tumhari submitted copy hi run ho rahi hai.
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.
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
Explain the purpose of every file and how they are connected.
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.
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
Explain current_app.
Times asked1
Official solution
SimpleApplication context app-level data (config, db), Request context ek HTTP request (request, session).
Request ke andar Flask khud context push karta hai. Scripts/shell mein db query ke liye:
with app.app_context():
User.query.all()
app.app_context().push() same, lekin with better (cleanup).
current_app proxy current Flask app ki taraf. Factory pattern mein import app cycle avoid.
Request context ke bahar request.form error dega.
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 is ORM?
Times asked49
Official solution
SimpleORM = Object Relational Mapping. Database tables ko Python classes/objects se map karta hai, raw SQL kam likhni padti hai.
Bina ORM: cursor.execute('SELECT * FROM user WHERE id=?', [5])
ORM se: User.query.get(5) ya db.session.get(User, 5)
Example model
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True)
FaydePython mein soch sakte ho, SQL injection se protection (parameterized), relationships easy, DB switch thoda aasan.
Nuksaancomplex queries slow/abstract, seekhne ki layer extra, kabhi raw SQL phir bhi chahiye.
MAD1: SQLAlchemy (Flask-SQLAlchemy). Tables db.create_all() ya migrations se banti hain.
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
Have you used ORM? Why?
Times asked1
Official solution
SimpleORM = Object Relational Mapping. Database tables ko Python classes/objects se map karta hai, raw SQL kam likhni padti hai.
Bina ORM: cursor.execute('SELECT * FROM user WHERE id=?', [5])
ORM se: User.query.get(5) ya db.session.get(User, 5)
Example model
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True)
FaydePython mein soch sakte ho, SQL injection se protection (parameterized), relationships easy, DB switch thoda aasan.
Nuksaancomplex queries slow/abstract, seekhne ki layer extra, kabhi raw SQL phir bhi chahiye.
MAD1: SQLAlchemy (Flask-SQLAlchemy). Tables db.create_all() ya migrations se banti hain.
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
Explain the frontend, backend, and database architecture.
Times asked1
Official solution
SimpleFrontend user jo dekhta/click karta hai, Backend server logic + database.
Frontend: HTML, CSS, Bootstrap, Jinja templates, thoda JS. Browser pe chalta hai.
Backend: Flask routes, SQLAlchemy, session, validation. Python server pe.
Data flow: form POST → Flask request.form → DB save → render_template/redirect → HTML dikha.
MAD1 typical stack: Flask + Jinja + SQLAlchemy + SQLite + Bootstrap.
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
Explain the complete workflow when a user registers.
Times asked1
Official solution
Examiner code pe ungli rakh ke poochta hai — panic mat karo, 4-line formula bolo.
1) Yeh file/line kya role hai (model / route / template / config)?
2) Input kahan se aata hai (form, URL <id>, session, JSON)?
3) DB pe kya query/write?
4) Output kya (render_template / redirect / jsonify)?
Example
@app.route('/book/<int:id>', methods=['POST']) — logged-in user session se, trek id URL se, Booking add, slots--, redirect history.
Unknown line: imports (request, url_for, flash), decorators, if checks, commit — har keyword ka reason ready rakho.
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
Explain the complete data flow for a feature (e.g., Add Doctor, Apply for Drive, Profile Update).
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.
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
Explain models.py.
Times asked21
Official solution
Simplemodels.py har table ki class hai — columns, PK/FK, relationships. Yeh Model layer hai.
Viva mein file khol ke bolo:
1) Kaunsi classes/tables hain (User, Role-specific, Booking...)
2) Har table ka kaam 1 line
3) Relationships: 1-1 / 1-M / M-M, backref, cascade, lazy
4) Constraints: unique email, nullable, default status
Example skeleton
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True, nullable=False)
role = db.Column(db.String(20), default='user')
bookings = db.relationship('Booking', backref='user', cascade='all, delete-orphan')
ER diagram: rectangles entities, lines relationships, PK/FK mark. Schema = yahi structure.
Tables create: db.create_all() ya migrations. SQLite file SQL viewer se dikha sakte ho.
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.
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
Explain how a route with both GET and POST methods works.
Times asked1
Official solution
SimpleGET data mangta hai (read), POST data bhejta hai (create/submit).
GETURL mein dikhta hai, bookmark ho sakta hai, browser back/refresh safe hai, data URL query mein jaata hai. Search, page open, login form dikhana.
POSTbody mein data jaata hai, URL mein password nahi dikhta, refresh pe dubara submit ho sakta hai. Login, register, form save.
Example
# page dikhana
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'GET':
return render_template('login.html')
# POST: form submit
email = request.form.get('email')
...
GET se theoretically data bhej sakte ho (?q=flask), lekin create/update ke liye nahi use karna — data log/history mein save ho jaata hai, length limit hoti hai.
HTML form default GET hota hai; method='POST' likhna zaroori hai login/register pe.
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
Explain endpoint routes such as '/delete/<int:id>'.
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.
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 @app.template_filter.
Times asked1
Official solution
Yeh list filter/sort/display task hai. Query badlo, template same rakh sakte ho.
Jinja: {% for r in rows %}<tr><td>{{ r.name|upper }}</td></tr>{% endfor %}
{{ rows|length }} count dikhane ke liye.
Alphabet sort: order_by(Model.name). Status filter: filter_by(status='pending').
Assigned staff column: relationship se {{ booking.staff.name }}.
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
Explain context_processor.
Times asked1
Official solution
Examiner code pe ungli rakh ke poochta hai — panic mat karo, 4-line formula bolo.
1) Yeh file/line kya role hai (model / route / template / config)?
2) Input kahan se aata hai (form, URL <id>, session, JSON)?
3) DB pe kya query/write?
4) Output kya (render_template / redirect / jsonify)?
Example
@app.route('/book/<int:id>', methods=['POST']) — logged-in user session se, trek id URL se, Booking add, slots--, redirect history.
Unknown line: imports (request, url_for, flash), decorators, if checks, commit — har keyword ka reason ready rakho.
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
Explain app_context.
Times asked1
Official solution
SimpleApplication context app-level data (config, db), Request context ek HTTP request (request, session).
Request ke andar Flask khud context push karta hai. Scripts/shell mein db query ke liye:
with app.app_context():
User.query.all()
app.app_context().push() same, lekin with better (cleanup).
current_app proxy current Flask app ki taraf. Factory pattern mein import app cycle avoid.
Request context ke bahar request.form error dega.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
19
Explain all model relationships.
Times asked1
Official solution
SimpleRelationships tables ko jodti hain taaki related data object se mil jaaye.
One-to-Many: User → kai Posts. posts = relationship('Post', backref='author'). FK post.user_id.
One-to-One: User → Profile. uselist=False + unique FK. Profile.user_id unique.
Many-to-Many: Student ↔ Drive. Junction/secondary table (student_id, drive_id).
Example 1-1:
class Profile(db.Model):
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), unique=True)
user = db.relationship('User', back_populates='profile', uselist=False)
1-M ko 1-1: child FK pe unique=True + uselist=False.
Parent-child: parent PK, child FK. Junction table extra columns bhi rakh sakti hai (applied_on).
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
20
Explain One-to-One, One-to-Many, and Many-to-Many relationships.
Times asked1
Official solution
SimpleRelationships tables ko jodti hain taaki related data object se mil jaaye.
One-to-Many: User → kai Posts. posts = relationship('Post', backref='author'). FK post.user_id.
One-to-One: User → Profile. uselist=False + unique FK. Profile.user_id unique.
Many-to-Many: Student ↔ Drive. Junction/secondary table (student_id, drive_id).
Example 1-1:
class Profile(db.Model):
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), unique=True)
user = db.relationship('User', back_populates='profile', uselist=False)
1-M ko 1-1: child FK pe unique=True + uselist=False.
Parent-child: parent PK, child FK. Junction table extra columns bhi rakh sakti hai (applied_on).
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
21
Explain backref.
Times asked5
Official solution
Simplebackref relationship ki reverse side automatically bana deta hai.
class Post(db.Model):
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
user = db.relationship('User', backref='posts')
Ab post.user milta hai, aur user.posts bhi — Post model pe sirf ek line.
secondary Many-to-Many junction table ke liye: relationship(..., secondary=likes_table, backref='liked_by').
Explicit chahiye to back_populates use karo.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
22
Explain nullable.
Times asked1
Official solution
Simplenullable=False matlab column khali nahi. default seedha value. Query objects lazy hote hain jab tak .all/.first.
age = db.Column(db.Integer, nullable=True) # optional
status = db.Column(db.String(20), default='pending')
__tablename__ = 'users' # table name override
User.query.all() → list of User. .first() → User ya None. .get_or_404(id) → User ya 404.
filter_by(...) Query object return karta hai, execute .all() pe. Type: BaseQuery / list after all().
db.func.count(User.id) aggregate. Empty table render: loop 0 baar, crash nahi agar code sahi.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
23
Explain Foreign Key.
Times asked3
Official solution
SimpleForeign Key doosri table ki PK ko refer karti hai, relationship + referential integrity.
Invalid user_id insert nahi hoga. FK unique nahi hona zaroori — One-to-Many mein same user_id kai rows.
FK + PK same column: 1-1 sharing, jaise AdminProfile.id = FK to user.id.
Should FK always unique? Nahi. Tab One-to-One chahiye ho tab unique.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
24
Explain Secondary (Junction) Tables.
Times asked1
Official solution
SimpleRelationships tables ko jodti hain taaki related data object se mil jaaye.
One-to-Many: User → kai Posts. posts = relationship('Post', backref='author'). FK post.user_id.
One-to-One: User → Profile. uselist=False + unique FK. Profile.user_id unique.
Many-to-Many: Student ↔ Drive. Junction/secondary table (student_id, drive_id).
Example 1-1:
class Profile(db.Model):
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), unique=True)
user = db.relationship('User', back_populates='profile', uselist=False)
1-M ko 1-1: child FK pe unique=True + uselist=False.
Parent-child: parent PK, child FK. Junction table extra columns bhi rakh sakti hai (applied_on).
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
25
How do you add a new record using SQLAlchemy ORM?
Times asked1
Official solution
SimpleORM = Object Relational Mapping. Database tables ko Python classes/objects se map karta hai, raw SQL kam likhni padti hai.
Bina ORM: cursor.execute('SELECT * FROM user WHERE id=?', [5])
ORM se: User.query.get(5) ya db.session.get(User, 5)
Example model
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True)
FaydePython mein soch sakte ho, SQL injection se protection (parameterized), relationships easy, DB switch thoda aasan.
Nuksaancomplex queries slow/abstract, seekhne ki layer extra, kabhi raw SQL phir bhi chahiye.
MAD1: SQLAlchemy (Flask-SQLAlchemy). Tables db.create_all() ya migrations se banti hain.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
26
Write an ORM query to insert a new record.
Times asked1
Official solution
SimpleORM = Object Relational Mapping. Database tables ko Python classes/objects se map karta hai, raw SQL kam likhni padti hai.
Bina ORM: cursor.execute('SELECT * FROM user WHERE id=?', [5])
ORM se: User.query.get(5) ya db.session.get(User, 5)
Example model
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(120), unique=True)
FaydePython mein soch sakte ho, SQL injection se protection (parameterized), relationships easy, DB switch thoda aasan.
Nuksaancomplex queries slow/abstract, seekhne ki layer extra, kabhi raw SQL phir bhi chahiye.
MAD1: SQLAlchemy (Flask-SQLAlchemy). Tables db.create_all() ya migrations se banti hain.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
27
Update a record using a field other than the primary key.
Times asked1
Official solution
SimplePrimary Key har row ko uniquely identify karti hai. Unique Key bhi unique hoti hai lekin table ki main ID nahi.
id = db.Column(db.Integer, primary_key=True) # auto increment
email = db.Column(db.String(120), unique=True)
PK: NOT NULL, ek (ya composite). Index automatically.
Record fetch: User.query.get(id) PK se tez.
FK hamesha unique nahi — Many side pe repeat hoti hai. Unique FK = One-to-One.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
28
Fetch a record using its Primary Key.
Times asked1
Official solution
SimplePrimary Key har row ko uniquely identify karti hai. Unique Key bhi unique hoti hai lekin table ki main ID nahi.
id = db.Column(db.Integer, primary_key=True) # auto increment
email = db.Column(db.String(120), unique=True)
PK: NOT NULL, ek (ya composite). Index automatically.
Record fetch: User.query.get(id) PK se tez.
FK hamesha unique nahi — Many side pe repeat hoti hai. Unique FK = One-to-One.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
29
Fetch related data using relationships (without writing an explicit SQL query).
Times asked1
Official solution
Yeh list filter/sort/display task hai. Query badlo, template same rakh sakte ho.
app.run() development server start karta hai. Production mein gunicorn/waitress.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
33
Why is SQLALCHEMY_TRACK_MODIFICATIONS=False used?
Times asked1
Official solution
SimpleSQLAlchemy Python ka sabse popular ORM hai. MAD1 mein Flask-SQLAlchemy wrapper use hota hai.
db = SQLAlchemy(app)
class Book(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(80), nullable=False)
Operations: db.session.add(obj), .commit(), .delete(obj), Model.query.all(), .filter_by(), .get_or_404(id).
db.Model ek class hai (function nahi). db object engine + session + metadata hold karta hai.
SQLALCHEMY_TRACK_MODIFICATIONS=False extra signals band karta hai, performance warning hatati hai.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
34
Explain debug=True.
Times asked1
Official solution
Examiner code pe ungli rakh ke poochta hai — panic mat karo, 4-line formula bolo.
1) Yeh file/line kya role hai (model / route / template / config)?
2) Input kahan se aata hai (form, URL <id>, session, JSON)?
3) DB pe kya query/write?
4) Output kya (render_template / redirect / jsonify)?
Example
@app.route('/book/<int:id>', methods=['POST']) — logged-in user session se, trek id URL se, Booking add, slots--, redirect history.
Unknown line: imports (request, url_for, flash), decorators, if checks, commit — har keyword ka reason ready rakho.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
35
Explain if __name__ == "__main__".
Times asked1
Official solution
Simpleapp = Flask(__name__) app banata hai; if __name__ == '__main__' tabhi server start jab file directly run ho.
app = Flask(__name__)
if __name__ == '__main__':
app.run(debug=True, port=5000)
__name__ module ka naam. Direct run pe '__main__', import pe filename. Import karoge to server auto-start nahi — tests/blueprints ke liye zaroori.
debug=True: auto-reload + debugger. Production mein band rakho (security).
Port: app.run(port=8000) ya flask run --port 8000. Default 5000. Haan, change ho sakta hai.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
36
Explain url_for().
Times asked2
Official solution
Simpleurl_for Flask function/endpoint name se URL generate karta hai, hardcode path nahi.
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.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
37
Explain redirect().
Times asked2
Official solution
Simpleredirect browser ko naya URL pe GET karne ko kehta hai (generally 302).
return redirect(url_for('dashboard'))
Login/register/delete ke baad use karo taaki refresh duplicate POST na kare.
Doosra page dikhana hai with new request — redirect. Same request pe HTML — render_template.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
38
Explain render_template().
Times asked1
Official solution
Simplerender_template HTML file ko Jinja se process karke browser ko bhejta hai. Backend data ko frontend se jodta hai.
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.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
39
Match:
redirect() → route
render_template() → HTML template
url_for() → endpoint/function name
Times asked1
Official solution
Simplerender_template HTML page bana ke turant dikhata hai, redirect user ko doosre URL pe bhej deta hai.
render_template('home.html', user=user) → server template fill karke 200 response deta hai. URL same rehta hai.
redirect(url_for('dashboard')) → 302 response, browser naya GET karta hai. URL change ho jaata hai.
Examplelogin POST successful hone ke baad render_template mat use karo, warna refresh pe form dubara submit ho jaayega.
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.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
41
Why do some routes use <int:id> while others don't?
Times asked1
Official solution
Simple<int:id> URL se integer nikalta hai. Alternatives: query string, POST form, slug string.
request.args.get('id') # /user?id=5
request.form.get('id') # hidden field
int converter galat 'abc' pe 404 — yeh protection 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
43
Explain all HTTP methods.
Times asked2
Official solution
SimpleHTTP methods batate hain request kya karna chahti hai. Common: GET POST PUT PATCH DELETE.
GETread/fetch. Safe, URL se. Page kholna, search.
POSTcreate/submit. Form, login.
PUTpoora replace/update. Idempotent.
PATCHpartial update.
DELETEhataana.
HEAD: sirf headers. OPTIONS: CORS preflight.
Flask: @app.route('/x', methods=['GET','POST'])
Agar methods na likho to default sirf GET.
HTML form native sirf GET/POST. PUT/DELETE JS/fetch ya hidden _method se.
GET se data fetch ho sakta hai, create nahi karna chahiye. POST se theoretically fetch ho sakta hai lekin cache/semantics galat.
DELETE fetch ke liye nahi. GET POST ka kaam officially nahi karta — side effects GET pe mat rakho.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
44
Difference between GET and POST.
Times asked7
Official solution
SimpleGET data mangta hai (read), POST data bhejta hai (create/submit).
GETURL mein dikhta hai, bookmark ho sakta hai, browser back/refresh safe hai, data URL query mein jaata hai. Search, page open, login form dikhana.
POSTbody mein data jaata hai, URL mein password nahi dikhta, refresh pe dubara submit ho sakta hai. Login, register, form save.
Example
# page dikhana
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'GET':
return render_template('login.html')
# POST: form submit
email = request.form.get('email')
...
GET se theoretically data bhej sakte ho (?q=flask), lekin create/update ke liye nahi use karna — data log/history mein save ho jaata hai, length limit hoti hai.
HTML form default GET hota hai; method='POST' likhna zaroori hai login/register pe.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
45
Can a form be submitted using PUT or DELETE?
Times asked1
Official solution
SimpleHTTP methods batate hain request kya karna chahti hai. Common: GET POST PUT PATCH DELETE.
GETread/fetch. Safe, URL se. Page kholna, search.
POSTcreate/submit. Form, login.
PUTpoora replace/update. Idempotent.
PATCHpartial update.
DELETEhataana.
HEAD: sirf headers. OPTIONS: CORS preflight.
Flask: @app.route('/x', methods=['GET','POST'])
Agar methods na likho to default sirf GET.
HTML form native sirf GET/POST. PUT/DELETE JS/fetch ya hidden _method se.
GET se data fetch ho sakta hai, create nahi karna chahiye. POST se theoretically fetch ho sakta hai lekin cache/semantics galat.
DELETE fetch ke liye nahi. GET POST ka kaam officially nahi karta — side effects GET pe mat rakho.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
46
What happens if a form uses the GET method?
Times asked1
Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example do.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
47
How is the POST method triggered?
Times asked1
Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example do.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
48
Can GET be used to create data?
Times asked1
Official solution
SimpleGET data mangta hai (read), POST data bhejta hai (create/submit).
GETURL mein dikhta hai, bookmark ho sakta hai, browser back/refresh safe hai, data URL query mein jaata hai. Search, page open, login form dikhana.
POSTbody mein data jaata hai, URL mein password nahi dikhta, refresh pe dubara submit ho sakta hai. Login, register, form save.
Example
# page dikhana
@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'GET':
return render_template('login.html')
# POST: form submit
email = request.form.get('email')
...
GET se theoretically data bhej sakte ho (?q=flask), lekin create/update ke liye nahi use karna — data log/history mein save ho jaata hai, length limit hoti hai.
HTML form default GET hota hai; method='POST' likhna zaroori hai login/register pe.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
49
How do you retrieve query parameters?
Times asked1
Official solution
Yeh list filter/sort/display task hai. Query badlo, template same rakh sakte ho.
name attribute server pe key ban'ti hai: request.form['email']. id JS/CSS, value default/dikhta hua text.
action URL. method GET/POST. enctype file upload pe multipart.
required frontend empty submit rokta hai (backend phir bhi check).
name attribute server pe key ban'ti hai: request.form['email']. id JS/CSS, value default/dikhta hua text.
action URL. method GET/POST. enctype file upload pe multipart.
required frontend empty submit rokta hai (backend phir bhi check).
Difference between Authentication, Authorization, and Validation.
Times asked1
Official solution
SimpleAuthentication poochta hai "tu kaun hai?", Authorization poochta hai "tujhe yeh kaam karne ki permission hai?"
Authentication: login. Username + password check karke prove karte ho ki tum genuine user ho. Success pe session/token milta hai.
Authorization: uske baad role check. Admin hi parking lot delete kar sakta hai, normal user nahi.
Example (Flask):
# Authentication
if user and check_password_hash(user.password, form_password):
session['user_id'] = user.id
# Authorization
if session.get('role') != 'admin':
abort(403) # logged in ho, lekin allowed nahi
Project example: student login = authentication. Student admin dashboard nahi khol sakta = authorization.
Validation alag cheez hai (form sahi bhara hai ya nahi, jaise age 18+).
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
54
How do you protect routes so only logged-in users can access them?
Times asked1
Official solution
Simple@login_required / custom decorator check karta hai session mein user hai ya nahi, nahi to login pe bhejta hai.
def login_required(f):
@wraps(f)
def wrapper(*a, **k):
if 'user_id' not in session:
return redirect(url_for('login'))
return f(*a, **k)
return wrapper
@app.before_request se bhi global check ho sakta hai.
Decorator order: pehle @app.route, uske neeche @login_required generally. Swap karoge to kabhi route register galat ho sakta hai — Flask-Login docs follow karo.
Role decorator @role_required('admin') authorization ke liye. Order matter karta hai: pehle auth, phir role.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
55
What type of validation is pattern?
Times asked1
Official solution
SimpleValidation galat data rok ti hai — frontend turant, backend must.
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
56
Explain minlength validation.
Times asked1
Official solution
SimpleValidation galat data rok ti hai — frontend turant, backend must.
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
57
What is Template Inheritance?
Times asked10
Official solution
Simpleextends poora layout inherit karta hai, include chhota piece insert karta hai.
extends: child page base.html ka structure use karti hai, blocks override karti hai. Ek hi parent.
include: navbar.html / footer.html jahan chaho insert. Kai baar use ho sakta hai.
base.html:
{% block content %}{% endblock %}
home.html:
{% extends 'base.html' %}
{% block content %}<h1>Home</h1>{% endblock %}
{% include 'navbar.html' %} → navbar har page pe
Fayda: header/footer ek jagah, change once — saari pages update. MAD1 mein almost har project use karta hai.
SimpleJinja2 Flask ka template engine hai. HTML ke andar Python-jaisa data print/loop/if kar sakte ho.
Bina Jinja har user ke liye alag HTML file. Jinja se ek template + data.
{{ user.name }} print, {% for x in items %} loop, {% if %} condition, {% extends %} layout.
Example routereturn render_template('dash.html', treks=treks)
dash.html: {% for t in treks %}<li>{{ t.name }}</li>{% endfor %}
HTML files templates/ folder mein isliye kyunki Flask default wahan dhundhta hai. render_template Jinja ko run karta hai.
Boolean Jinja handle karta hai: {% if user.is_admin %}.
name attribute server pe key ban'ti hai: request.form['email']. id JS/CSS, value default/dikhta hua text.
action URL. method GET/POST. enctype file upload pe multipart.
required frontend empty submit rokta hai (backend phir bhi check).
SimpleBlock poori line leta hai, Inline text ke saath baithta hai.
Block (div, p, h1, section): width 100%, next element neeche aata hai. Height/width/margin set kar sakte ho.
Inline (span, a, strong): sirf content jitni jagah. Width/height generally nahi chalti.
Inline-block: inline ki tarah baithta hai, lekin width/height milti hai.
Example
<div>Hello</div><div>World</div> do lines. <span>Hello</span> <span>World</span> ek line.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
62
Difference between <tr>, <td>, and <th>.
Times asked1
Official solution
SimpleForm user input server ko bhejti hai. Table rows/columns dikhati hai.
name attribute server pe key ban'ti hai: request.form['email']. id JS/CSS, value default/dikhta hua text.
action URL. method GET/POST. enctype file upload pe multipart.
required frontend empty submit rokta hai (backend phir bhi check).
ID page mein unique hona chahiye. Class reuse hoti hai — saare buttons .btn.
CSS specificity: ID > class > element. Isliye # wala style . wale ko haarata hai.
HTML: id JavaScript/getElementById ke liye, class styling groups ke liye.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
64
What is display: flex?
Times asked1
Official solution
Definition style question: 1 line simple Hinglish + project example + mini code.
Template'X ka kaam Y hai. Mere project mein Z jagah use hua.'
Example'Session login state rakhta hai. session[user_id]=u.id login pe, logout pe session.clear().'
Agar topic Vue/Celery/Redis ho aur project mein nahi hai to sach bolo, theory example do.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
65
How do you make a section occupy half the page width?
Times asked1
Official solution
Simpleexaminer UI tweak maangta hai — CSS class ya inline, instantly dikhao.
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.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
70
What is the DOM?
Times asked3
Official solution
SimpleDOM = Document Object Model — HTML ka tree jo browser memory mein banata hai. JS isi ko change karta hai.
document.getElementById('btn').style.color = 'red'
Jinja server pe HTML banata hai, phir browser DOM parse karta hai. Vue DOM ko reactive update karta hai.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
71
What is Version Control?
Times asked2
Official solution
SimpleVCS history track karta hai, Git ek distributed VCS hai.
VCS: kaun kab kya change kiya, rollback, branches. Example: Git, SVN.
Git distributed: har developer ke paas poori copy (commits) hoti hai. Central GitHub sirf remote hosting hai, lekin Git ka model distributed hai.
SVN centralized: bina server ke history nahi.
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.
SimpleFile upload form multipart, Flask request.files, disk ya DB path store.
<form method='POST' enctype='multipart/form-data'>
f = request.files.get('resume')
f.save(os.path.join('uploads', secure_filename(f.filename)))
Sensitive docs uploads/ web se seedha serve mat karo, login check ke baad send_from_directory.
Student resume edit: policy — allowed hai to Update route, nahi to freeze after apply.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
77
Why did you use request.files.get()?
Times asked1
Official solution
SimpleFile upload form multipart, Flask request.files, disk ya DB path store.
<form method='POST' enctype='multipart/form-data'>
f = request.files.get('resume')
f.save(os.path.join('uploads', secure_filename(f.filename)))
Sensitive docs uploads/ web se seedha serve mat karo, login check ke baad send_from_directory.
Student resume edit: policy — allowed hai to Update route, nahi to freeze after apply.
Community answers
No replies yet
No community answers yet
Open My solution to be the first to share yours.
My solution
Not submitted yet
78
Create a route and HTML form that accepts user input and displays it on the browser.
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.
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.
Create a route with URL parameters (e.g., /sum/<a>/<b> or /course/<course_name>).
Times asked1
Official solution
SimpleURL parameters se numbers lo, calculate karke return/render.
@app.route('/sum/<int:a>/<int:b>')
def add(a, b):
return f'Hello, sum is {a+b}'
Product: a*b. Square: n*n. Even/odd: 'even' if n%2==0 else 'odd'.
Form se: request.form.get('a', type=int). Background color even/odd:
color = 'green' if n%2==0 else 'red'
return render_template('page.html', color=color)
CSS: body { background: {{ color }}; }
Simple<int:id> URL se integer nikalta hai. Alternatives: query string, POST form, slug string.
Auth: session['user_id'] + role check. CRUD: add/commit, query.all, field update, delete.
Live change maange to: related model → route → template, phir browser refresh karke dikhao.
Example (generic create):
obj = Model(name=request.form.get('name'))