Python, Django & Flask Interview Preparation
Guide
Python Core
Q: Key Features of Python
Interpreted, object-oriented, dynamic typing, large ecosystem.
Q: List vs Tuple
Lists are mutable, tuples are immutable.
Q: Decorators
Functions that extend behavior of other functions.
Q: Generators
Use yield to generate values lazily.
Q: OOP Concepts
Encapsulation, Inheritance, Polymorphism, Abstraction.
Q: Exception Handling
try, except, else, finally blocks.
Advanced Python
Q: Lambda Functions
Anonymous functions for short operations.
Q: *args and **kwargs
Variable-length positional and keyword arguments.
Q: GIL
Global Interpreter Lock controls Python thread execution.
Q: Context Managers
Used with 'with' statement for resource management.
Django
Q: What is Django?
High-level Python web framework using MVT architecture.
Q: MVT Architecture
Model, View, Template.
Q: ORM
Database operations through Python objects.
Q: Migrations
Manage database schema changes.
Q: Middleware
Request/response processing components.
Q: Django Admin
Built-in administration interface.
Q: Authentication
Users, groups, permissions, sessions.
Q: CSRF Protection
Protects against forged requests.
Flask
Q: What is Flask?
Lightweight micro web framework.
Q: Routes
Map URLs to Python functions.
Q: Blueprints
Application modularization.
Q: Jinja2
Template engine used by Flask.
Q: SQLAlchemy
Popular ORM for Flask.
Q: Sessions
Store user-specific data.
Q: REST APIs
Common Flask use case.
Backend & API
Q: REST API
Client-server communication architecture.
Q: HTTP Methods
GET, POST, PUT, PATCH, DELETE.
Q: JWT
Token-based authentication.
Q: CORS
Cross-origin request control.
Q: API Security
Validation, auth, HTTPS, rate limiting.