AP CSP Exam Question Types with Answers
Here is a list of AP CSP Exam question types with a very simple example to show what is meant by that type of question.
List operations
You work with lists and understand how they change
Example
list ← [10,20,30]
REMOVE(list, 2)
What is list?
Answer: [10,30]
ลบตำแหน่งที่
List indexing (position vs value)
You must know positions start at 1 in pseudocode
Example
list ← [5,10,15]
What is list[2]?
Answer: 10
ตำแหน่งเริ่มที่ 1 คำตอบคือ 10
Nested conditionals
You follow conditions inside conditions
Example
x ← 7
IF x > 5
IF x < 10
PRINT(“A”)
ELSE
PRINT(“B”)
Answer: A
ต้องดูเงื่อนไขซ้อนกัน คำตอบคือ A
Loop with condition stop
Loop stops when condition changes
Example
x ← 1
REPEAT UNTIL x > 3
x ← x + 1
What is x?
Answer: 4
ลูปหยุดเมื่อเงื่อนไขเป็นจริง คำตอบคือ 4
Counting iterations
You count how many times a loop runs
Example
FOR i ← 1 TO 4
PRINT(i)
How many outputs?
Answer: 4
นับจำนวนรอบ คำตอบคือ 4
Parallel lists
Two lists work together
Example
names ← [“A”,”B”]
scores ← [80,90]
Who has score 90?
Answer: B
ใช้สองลิสต์ร่วมกัน คำตอบคือ B
Minimum / maximum data
Find highest or lowest value
Example
data ← [3,7,2,9]
What is the maximum?
Answer: 9
หาค่าสูงสุด คำตอบคือ 9
Binary representation
You convert numbers to binary
Example
What is binary of 5?
Answer: 101
แปลงเป็นเลขฐานสอง คำตอบคือ 101
Data compression idea
You understand why data is reduced
Example
Why compress images?
Answer: reduce file size
ลดขนาดไฟล์
Fault tolerance
System continues even with failure
Example
If one server fails, what happens?
Answer: system still works
ระบบยังทำงานได้
Redundancy
Extra components improve reliability
Example
Why use backup server?
Answer: prevent failure
ป้องกันระบบล่ม
IP vs DNS
You match names to addresses
Example
What does DNS do?
Answer: converts domain to IP
แปลงชื่อเป็น IP
Packet switching
Data sent in parts
Example
Why split data into packets?
Answer: faster and reliable
ส่งเร็วและเสถียร
Encryption basics
Protect data
Example
Why encrypt messages?
Answer: keep data secure
ป้องกันข้อมูล
Personal data and privacy
Understand risks
Example
Is sharing password safe?
Answer: No
ไม่ปลอดภัย
Bias in data
Data can be unfair
Example
If data only includes one group, result?
Answer: biased
ข้อมูลลำเอียง
Simulation
Model real-world systems
Example
Why use simulation?
Answer: test without risk
ทดลองโดยไม่เสี่ยง
Abstraction in systems
Hide unnecessary detail
Example
Why use functions?
Answer: simplify code
ทำให้โค้ดง่าย
Event-driven programming
Program responds to actions
Example
Button click → action
Answer: event triggers code
เหตุการณ์ทำให้โค้ดทำงาน





