# FastAPI - API dữ liệu (Data Engineering) > Routes, Pydantic models, dependencies, middleware, tài liệu OpenAPI, deployment - 20 câu hỏi phỏng vấn - Mid-Level - [Câu hỏi phỏng vấn: Data Engineering](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van.md) ## 1. FastAPI là gì? **Câu trả lời** FastAPI là một web framework Python hiện đại, hiệu năng cao để xây dựng API. Nó sử dụng type hints Python tiêu chuẩn để tự động xác thực dữ liệu và tạo tài liệu. FastAPI được xây dựng trên Starlette cho chức năng web và Pydantic cho việc xác thực dữ liệu, mang lại hiệu năng tương đương với Node.js và Go. ## 2. Decorator nào nên được sử dụng để định nghĩa một route GET trong FastAPI? **Câu trả lời** FastAPI sử dụng các decorator phương thức HTTP trực tiếp trên instance của ứng dụng. Decorator @app.get("/path") định nghĩa một route GET. Mỗi phương thức HTTP có decorator tương ứng: @app.post(), @app.put(), @app.delete(), v.v. Cú pháp này được lấy cảm hứng từ Flask nhưng có thêm xác thực tự động. ## 3. Vai trò của Pydantic trong FastAPI là gì? **Câu trả lời** Pydantic là thư viện xác thực dữ liệu được FastAPI sử dụng. Nó cho phép định nghĩa các models dữ liệu với các kiểu Python và tự động xác thực dữ liệu đầu vào. Pydantic cũng tạo ra JSON schema cho tài liệu OpenAPI và cung cấp các thông báo lỗi chi tiết khi dữ liệu không hợp lệ. ## Còn 17 câu hỏi nữa - Làm thế nào để định nghĩa một path parameter trong route FastAPI? - FastAPI phân biệt query parameter và path parameter như thế nào? Đăng ký miễn phí: https://sharpskill.dev/vi/login ## Các chủ đề phỏng vấn Data Engineering khác - [Linux & Shell - Cơ bản](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/linux-shell-basics.md): 20 câu hỏi, Junior - [Git & GitHub - Kiến thức cơ bản](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/git-github-fundamentals.md): 20 câu hỏi, Junior - [Python nâng cao cho Data Engineering](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/python-advanced-de.md): 25 câu hỏi, Junior - [Docker - Cơ bản](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/docker-fundamentals.md): 25 câu hỏi, Junior - [Google Cloud Platform - Cơ bản](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/gcp-fundamentals.md): 20 câu hỏi, Junior - [CI/CD và chất lượng mã](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/ci-cd-code-quality.md): 20 câu hỏi, Mid-Level - [Docker Compose](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/docker-compose.md): 20 câu hỏi, Mid-Level - [SQL nâng cao cho Data Engineering](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/sql-advanced-de.md): 20 câu hỏi, Mid-Level - [Data Lake - Kiến trúc và nạp dữ liệu](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/data-lake.md): 20 câu hỏi, Mid-Level - [BigQuery cho Data Engineering](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/bigquery-de.md): 20 câu hỏi, Mid-Level - [PostgreSQL - Quản trị](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/postgresql-admin.md): 20 câu hỏi, Mid-Level - [Data Modeling cho Data Engineering](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/data-modeling-de.md): 20 câu hỏi, Mid-Level - [Fivetran & Airbyte - Nạp dữ liệu](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/fivetran-airbyte.md): 20 câu hỏi, Mid-Level - [dbt - Kiến thức cơ bản](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/dbt-fundamentals-de.md): 20 câu hỏi, Mid-Level - [Apache Airflow - Cơ bản](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/airflow-fundamentals.md): 20 câu hỏi, Mid-Level - [Kubernetes - Cơ Bản](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/kubernetes-fundamentals.md): 20 câu hỏi, Mid-Level - [dbt - Tính năng nâng cao](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/dbt-advanced-de.md): 20 câu hỏi, Senior - [Mẫu ETL / ELT / ETLT](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/etl-elt-patterns.md): 20 câu hỏi, Senior - [Apache Airflow - Nâng cao](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/airflow-advanced.md): 20 câu hỏi, Senior - [Airflow + dbt - Điều phối pipeline](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/airflow-dbt-integration.md): 20 câu hỏi, Senior - [PySpark - Xử lý quy mô lớn](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/pyspark.md): 20 câu hỏi, Senior - [Google Pub/Sub - Streaming dữ liệu](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/pubsub-streaming.md): 20 câu hỏi, Senior - [Apache Beam & Dataflow](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/apache-beam-dataflow.md): 20 câu hỏi, Senior - [Kubernetes - Production và Scaling](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/kubernetes-advanced.md): 20 câu hỏi, Senior - [Terraform - Infrastructure as Code](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/terraform.md): 20 câu hỏi, Senior - [Cơ sở dữ liệu NoSQL](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/nosql-databases.md): 20 câu hỏi, Senior - [Data Architecture hiện đại](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/data-architecture.md): 20 câu hỏi, Senior - [Giám sát và Khả năng quan sát](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/monitoring-observability.md): 20 câu hỏi, Senior - [IAM và Bảo mật Dữ liệu](https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/iam-security-de.md): 20 câu hỏi, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/vi/technologies/data-engineering/cau-hoi-phong-van/fastapi