ข้อสอบสัมภาษณ์เขียนโปรแกรม Python

ฝึกข้อสอบสัมภาษณ์เขียนโปรแกรม Python ฟรี 80 ข้อ พร้อมเฉลยและคำอธิบาย

ระดับ: Coding Interview ความยาก: medium 80 ข้อ 60 นาที
ตอบข้อสอบ Python แต่ละข้อ แล้วตรวจคะแนน ข้อที่ผิดจะถูกบันทึกไว้ในเครื่องเพื่อทบทวน
จำนวนวันต่อเนื่อง: 0 วัน บันทึกเฉพาะอุปกรณ์นี้
ความคืบหน้า 0 / 80
ข้อ 1

Which data type is immutable in Python?

เลือกคำตอบ
ข้อ 2

What does len("hello") return?

เลือกคำตอบ
ข้อ 3

Which operator checks whether two values are equal?

เลือกคำตอบ
ข้อ 4

What is the result of 2 ** 3?

เลือกคำตอบ
ข้อ 5

Which method removes the last item from a list and returns it?

เลือกคำตอบ
ข้อ 6

What does print(type([])) output?

เลือกคำตอบ
ข้อ 7

Which keyword defines a function?

เลือกคำตอบ
ข้อ 8

Which values does list(range(3)) produce?

เลือกคำตอบ
ข้อ 9

Which built-in function converts a string to an integer?

เลือกคำตอบ
ข้อ 10

What is the result of "a" + "b"?

เลือกคำตอบ
ข้อ 11

Which collection stores only unique values?

เลือกคำตอบ
ข้อ 12

What is the result of 5 // 2?

เลือกคำตอบ
ข้อ 13

What is the result of 5 % 2?

เลือกคำตอบ
ข้อ 14

Which keyword exits a loop immediately?

เลือกคำตอบ
ข้อ 15

Which method adds one item to the end of a list?

เลือกคำตอบ
ข้อ 16

What is the output of bool(0)?

เลือกคำตอบ
ข้อ 17

Which statement handles exceptions?

เลือกคำตอบ
ข้อ 18

What is the result of [1, 2] + [3]?

เลือกคำตอบ
ข้อ 19

Which syntax creates a dictionary?

เลือกคำตอบ
ข้อ 20

What does dict.get("missing", 0) return when the key is missing?

เลือกคำตอบ
ข้อ 21

Which keyword creates a class?

เลือกคำตอบ
ข้อ 22

What does self represent inside a Python class method?

เลือกคำตอบ
ข้อ 23

Which method is called automatically when a class instance is created?

เลือกคำตอบ
ข้อ 24

What is the output of "abc".upper()?

เลือกคำตอบ
ข้อ 25

Which function returns the largest item in a list?

เลือกคำตอบ
ข้อ 26

What is the result of sum([1, 2, 3])?

เลือกคำตอบ
ข้อ 27

Which slice returns the last item of list x?

เลือกคำตอบ
ข้อ 28

What is the output of sorted([3, 1, 2])?

เลือกคำตอบ
ข้อ 29

Which keyword defines an anonymous function?

เลือกคำตอบ
ข้อ 30

What is the result of list(map(str, [1, 2]))?

เลือกคำตอบ
ข้อ 31

Which data structure gives the fastest average membership test?

เลือกคำตอบ
ข้อ 32

What is the worst-case time complexity of searching for a value in a list?

เลือกคำตอบ
ข้อ 33

What is the average time complexity of looking up a key in a dict?

เลือกคำตอบ
ข้อ 34

Which statement is true about tuples?

เลือกคำตอบ
ข้อ 35

What does isinstance(3, int) return?

เลือกคำตอบ
ข้อ 36

Which function returns the number of items in a container?

เลือกคำตอบ
ข้อ 37

What is the output of "hello".count("l")?

เลือกคำตอบ
ข้อ 38

Which built-in function returns index-value pairs from an iterable?

เลือกคำตอบ
ข้อ 39

What is list(zip([1, 2], ["a", "b"]))?

เลือกคำตอบ
ข้อ 40

Which keyword is used inside a function to create a generator?

เลือกคำตอบ
ข้อ 41

What does next(iter([1, 2])) return?

เลือกคำตอบ
ข้อ 42

Which exception is raised by 1 / 0?

เลือกคำตอบ
ข้อ 43

Which exception is raised by [1, 2][5]?

เลือกคำตอบ
ข้อ 44

Which exception is raised by {"a": 1}["b"]?

เลือกคำตอบ
ข้อ 45

What is the output of print(1 == 1.0)?

เลือกคำตอบ
ข้อ 46

Which expression evaluates to True?

เลือกคำตอบ
ข้อ 47

What is the result of "x" in "example"?

เลือกคำตอบ
ข้อ 48

Which method joins a list of strings into one string?

เลือกคำตอบ
ข้อ 49

What does set([1, 1, 2]) produce?

เลือกคำตอบ
ข้อ 50

Which operator performs floor division?

เลือกคำตอบ
ข้อ 51

What is the result of 3 * "ab"?

เลือกคำตอบ
ข้อ 52

Which built-in function applies a function to every item and returns an iterator?

เลือกคำตอบ
ข้อ 53

What is list(filter(lambda x: x > 2, [1, 2, 3]))?

เลือกคำตอบ
ข้อ 54

Which keyword imports a module?

เลือกคำตอบ
ข้อ 55

What is the purpose of a docstring?

เลือกคำตอบ
ข้อ 56

Which file commonly marks a directory as a Python package?

เลือกคำตอบ
ข้อ 57

What does the global keyword do inside a function?

เลือกคำตอบ
ข้อ 58

Which built-in function returns an object identity?

เลือกคำตอบ
ข้อ 59

What is the output of bool([])?

เลือกคำตอบ
ข้อ 60

Which is a valid variable name in Python?

เลือกคำตอบ
ข้อ 61

Which of the following built-in types are immutable?

เลือกคำตอบ
ข้อ 62

Which methods can add items to a list?

เลือกคำตอบ
ข้อ 63

Which expressions create a set?

เลือกคำตอบ
ข้อ 64

Which statements are true about dictionaries?

เลือกคำตอบ
ข้อ 65

Which built-in functions return iterables?

เลือกคำตอบ
ข้อ 66

Which keywords are used for exception handling?

เลือกคำตอบ
ข้อ 67

Python lists are zero-indexed.

เลือกคำตอบ
ข้อ 68

A Python string can be changed in place.

เลือกคำตอบ
ข้อ 69

None is a valid value in Python.

เลือกคำตอบ
ข้อ 70

A while loop always runs at least once.

เลือกคำตอบ
ข้อ 71

Dictionaries preserve insertion order in Python 3.7 and later.

เลือกคำตอบ
ข้อ 72

The is operator compares object identity, not value.

เลือกคำตอบ
ข้อ 73

A function without a return statement returns None.

เลือกคำตอบ
ข้อ 74

Python uses && for logical AND.

เลือกคำตอบ
ข้อ 75

What is the output of print(2 + 3 * 4)? Type the number only.

ข้อ 76

Type the keyword used to define a function.

ข้อ 77

Type the method used to add one item to the end of a list.

ข้อ 78

Type the keyword that raises an exception manually.

ข้อ 79

Type the keyword used to produce values from a generator.

ข้อ 80

What does type(3.5) return? Type the short class name.