wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

FastAPI for Beginner

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

API คืออะไร?

a)

ระบบที่ใช้เก็บข้อมูลเท่านั้น

b)

กลไกที่ให้โปรแกรมต่าง ๆ ติดต่อกันได้

c)

โปรแกรมแอนตี้ไวรัส

d)

ระบบจัดการไฟล์

2.

ข้อใดคือ HTTP Method สำหรับดึงข้อมูล

a)

POST

b)

PUT

c)

GET

d)

DELETE

3.

Status Code 201 หมายถึงอะไร?

a)

Bad Request

b)

Created

c)

OK

d)

Forbidden

4.

ข้อใดคือจุดเด่นสำคัญของ FastAPI

a)

ช้าแต่ใช้งานง่าย

b)

รองรับเฉพาะ MySQL

c)

เร็วมากและรองรับ async/await

d)

ต้องเขียน config เยอะ

5.

คำสั่งสร้าง Virtual Environment ด้วย uv คือข้อใด

a)

uv make

b)

uv venv

c)

uv env create

d)

uv build

6.

Endpoint /hello ควรเขียนด้วย Method ใดสำหรับการแสดงข้อความอย่างเดียว

a)

POST

b)

DELETE

c)

GET

d)

PUT

7.

Path Parameter เหมาะใช้สำหรับสิ่งใด

a)

ส่งข้อมูลใหญ่ ๆ

b)

ระบุ resource เช่น id

c)

ส่งไฟล์

d)

ส่ง token

8.

ข้อใดคือโครงสร้างที่ใช้ทำ In-memory CRUD

a)

SQL Database

b)

Docker Container

c)

list หรือ dict

d)

Binary File

9.

ข้อใดเป็นคำสั่งรัน PostgreSQL ด้วย Docker Compose

a)

docker compose up db

b)

docker up postgres

c)

docker compose start python

d)

uv compose run postgres

10.

ORM ย่อมาจากอะไร

a)

Object Relational Mapping

b)

Online Resource Monitor

c)

Object Runtime Module

d)

Operational Relational Method

11.

SQLAlchemy ทำหน้าที่อะไร

a)

ทดสอบ API

b)

เชื่อมต่อและจัดการ Database

c)

สร้าง JWT Token

d)

จัดเก็บ Static File

12.

Pydantic ใช้ทำอะไร

a)

ส่งอีเมล

b)

Validate Request Body

c)

สร้าง Dockerfile

d)

ทำการ Login

13.

คำสั่งสร้าง Migration ใหม่ด้วย Alembic

a)

alembic add

b)

alembic new_version

c)

alembic revision --autogenerate -m "init"

d)

alembic migrate start

14.

JWT ใช้สำหรับอะไร

a)

ย่อไฟล์รูป

b)

ยืนยันตัวตนผู้ใช้งาน

c)

จัดการ HTML Template

d)

เขียน CSS

15.

Password Hashing ควรทำเมื่อไหร่

a)

หลังผู้ใช้ลืมรหัสผ่าน

b)

ก่อนเก็บ Password ลง DB

c)

ตอนระบบ deploy

d)

ขณะโหลด Static File

16.

ข้อใดคือบทบาทของ Authorization

a)

ตรวจสอบว่าเป็นใคร

b)

ตรวจสอบเวอร์ชัน Python

c)

ตรวจสอบว่ามีสิทธิทำอะไร

d)

ตรวจสอบ Dockerfile

17.

ใน FastAPI การ Upload File ใช้คลาสใด

a)

Path

b)

File

c)

Static

d)

Upload

18.

Unit Test สำหรับ FastAPI ควรใช้เครื่องมือใด

a)

pytest + TestClient

b)

HTML Validator

c)

SQL Shell

d)

Docker Service

19.

Dockerfile สำหรับ FastAPI ต้องเปิดพอร์ตใด (โดยทั่วไป)

a)

22

b)

8000

c)

3306

d)

5000

20.

Platform ใดที่เหมาะสำหรับ Deploy FastAPI แบบฟรี

a)

Photoshop

b)

Render

c)

WordPress

d)

MS Excel