Interview question for technical

 

HOW TO EXPLAIN IN INTERVIEW (VERY IMPORTANT)

Say this 👇

“I implemented secure authentication using FastAPI with JWT-based login/signup, password hashing, and role-ready architecture. The system is scalable to production databases and frontend frameworks.”

🔥 This sounds industry-ready.


❓ Why do we separate models and schemas?

Answer:

Models define database structure, schemas define data validation and API contracts. This separation improves security, scalability, and maintainability.

🔥 Recruiter-approved answer.


🧠 INTERVIEW LINE (REMEMBER THIS)

Say this confidently:

“I established a database connection using SQLAlchemy with SQLite, created models using declarative base, and initialized tables during app startup.”

🔥 Recruiters LOVE this sentence.

❓ COMMON CONFUSION (VERY IMPORTANT)

❌ “Do I need to install SQLite?”

👉 NO
SQLite comes built-in with Python


❌ “Do I need username/password?”

👉 NO (only for PostgreSQL, MySQL)


❌ “Why not MongoDB first?”

👉 MongoDB adds network + auth + driver complexity
SQLite teaches core concepts first


🔁 DIFFERENT PATH EXAMPLES (FOR CLARITY)

▶ Same folder (MOST COMMON)

sqlite:///./users.db

▶ Inside a folder called db

sqlite:///./db/users.db

▶ Absolute path (advanced)

sqlite:////C:/projects/gym_auth/users.db

(Notice 4 slashes for absolute path on Windows)


🔄 COMPARISON WITH OTHER DATABASES (JUST FOR AWARENESS)

You DO NOT use these now, just understand difference 👇

PostgreSQL

postgresql://username:password@localhost:5432/gymdb

MySQL

mysql://username:password@localhost:3306/gymdb

SQLite is much simpler:

sqlite:///./users.db

🧠 INTERVIEW QUESTION & PERFECT ANSWER

❓ Why use SQLite in your project?

Answer:

SQLite is lightweight, serverless, and ideal for rapid development and prototyping. It allows easy migration to production databases later.

🔥 This is a professional answer.\

🧠 INTERVIEW QUESTION (VERY COMMON)

❓ Why use sessions instead of direct engine?

Perfect answer:

Sessions manage transactions, handle rollbacks, and ensure safe database interactions per request.

🔥 Recruiter-approved answer.

Comments