Soal Wawancara Coding Python

Latih 80 soal wawancara coding Python gratis lengkap dengan jawaban dan penjelasan.

Tingkat: Coding Interview Kesulitan: medium 80 soal 60 mnt
Jawab setiap soal Python, lalu periksa nilai Anda. Jawaban salah disimpan secara lokal untuk ditinjau.
Hari beruntun: 0 hari Tersimpan hanya di perangkat ini
Kemajuan 0 / 80
Soal 1

Which data type is immutable in Python?

Pilih jawaban
Soal 2

What does len("hello") return?

Pilih jawaban
Soal 3

Which operator checks whether two values are equal?

Pilih jawaban
Soal 4

What is the result of 2 ** 3?

Pilih jawaban
Soal 5

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

Pilih jawaban
Soal 6

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

Pilih jawaban
Soal 7

Which keyword defines a function?

Pilih jawaban
Soal 8

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

Pilih jawaban
Soal 9

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

Pilih jawaban
Soal 10

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

Pilih jawaban
Soal 11

Which collection stores only unique values?

Pilih jawaban
Soal 12

What is the result of 5 // 2?

Pilih jawaban
Soal 13

What is the result of 5 % 2?

Pilih jawaban
Soal 14

Which keyword exits a loop immediately?

Pilih jawaban
Soal 15

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

Pilih jawaban
Soal 16

What is the output of bool(0)?

Pilih jawaban
Soal 17

Which statement handles exceptions?

Pilih jawaban
Soal 18

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

Pilih jawaban
Soal 19

Which syntax creates a dictionary?

Pilih jawaban
Soal 20

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

Pilih jawaban
Soal 21

Which keyword creates a class?

Pilih jawaban
Soal 22

What does self represent inside a Python class method?

Pilih jawaban
Soal 23

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

Pilih jawaban
Soal 24

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

Pilih jawaban
Soal 25

Which function returns the largest item in a list?

Pilih jawaban
Soal 26

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

Pilih jawaban
Soal 27

Which slice returns the last item of list x?

Pilih jawaban
Soal 28

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

Pilih jawaban
Soal 29

Which keyword defines an anonymous function?

Pilih jawaban
Soal 30

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

Pilih jawaban
Soal 31

Which data structure gives the fastest average membership test?

Pilih jawaban
Soal 32

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

Pilih jawaban
Soal 33

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

Pilih jawaban
Soal 34

Which statement is true about tuples?

Pilih jawaban
Soal 35

What does isinstance(3, int) return?

Pilih jawaban
Soal 36

Which function returns the number of items in a container?

Pilih jawaban
Soal 37

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

Pilih jawaban
Soal 38

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

Pilih jawaban
Soal 39

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

Pilih jawaban
Soal 40

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

Pilih jawaban
Soal 41

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

Pilih jawaban
Soal 42

Which exception is raised by 1 / 0?

Pilih jawaban
Soal 43

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

Pilih jawaban
Soal 44

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

Pilih jawaban
Soal 45

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

Pilih jawaban
Soal 46

Which expression evaluates to True?

Pilih jawaban
Soal 47

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

Pilih jawaban
Soal 48

Which method joins a list of strings into one string?

Pilih jawaban
Soal 49

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

Pilih jawaban
Soal 50

Which operator performs floor division?

Pilih jawaban
Soal 51

What is the result of 3 * "ab"?

Pilih jawaban
Soal 52

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

Pilih jawaban
Soal 53

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

Pilih jawaban
Soal 54

Which keyword imports a module?

Pilih jawaban
Soal 55

What is the purpose of a docstring?

Pilih jawaban
Soal 56

Which file commonly marks a directory as a Python package?

Pilih jawaban
Soal 57

What does the global keyword do inside a function?

Pilih jawaban
Soal 58

Which built-in function returns an object identity?

Pilih jawaban
Soal 59

What is the output of bool([])?

Pilih jawaban
Soal 60

Which is a valid variable name in Python?

Pilih jawaban
Soal 61

Which of the following built-in types are immutable?

Pilih jawaban
Soal 62

Which methods can add items to a list?

Pilih jawaban
Soal 63

Which expressions create a set?

Pilih jawaban
Soal 64

Which statements are true about dictionaries?

Pilih jawaban
Soal 65

Which built-in functions return iterables?

Pilih jawaban
Soal 66

Which keywords are used for exception handling?

Pilih jawaban
Soal 67

Python lists are zero-indexed.

Pilih jawaban
Soal 68

A Python string can be changed in place.

Pilih jawaban
Soal 69

None is a valid value in Python.

Pilih jawaban
Soal 70

A while loop always runs at least once.

Pilih jawaban
Soal 71

Dictionaries preserve insertion order in Python 3.7 and later.

Pilih jawaban
Soal 72

The is operator compares object identity, not value.

Pilih jawaban
Soal 73

A function without a return statement returns None.

Pilih jawaban
Soal 74

Python uses && for logical AND.

Pilih jawaban
Soal 75

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

Soal 76

Type the keyword used to define a function.

Soal 77

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

Soal 78

Type the keyword that raises an exception manually.

Soal 79

Type the keyword used to produce values from a generator.

Soal 80

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