Preguntas de entrevista de programación en Python

Practica 80 preguntas gratis de entrevista de programación en Python con respuestas y explicaciones.

Nivel: Coding Interview Dificultad: medium 80 preguntas 60 min
Responde cada pregunta de Python y comprueba tu puntuación. Los errores se guardan localmente para repasar.
Racha de días: 0 días Guardado solo en este dispositivo
Progreso 0 / 80
Pregunta 1

Which data type is immutable in Python?

Selecciona una respuesta
Pregunta 2

What does len("hello") return?

Selecciona una respuesta
Pregunta 3

Which operator checks whether two values are equal?

Selecciona una respuesta
Pregunta 4

What is the result of 2 ** 3?

Selecciona una respuesta
Pregunta 5

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

Selecciona una respuesta
Pregunta 6

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

Selecciona una respuesta
Pregunta 7

Which keyword defines a function?

Selecciona una respuesta
Pregunta 8

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

Selecciona una respuesta
Pregunta 9

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

Selecciona una respuesta
Pregunta 10

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

Selecciona una respuesta
Pregunta 11

Which collection stores only unique values?

Selecciona una respuesta
Pregunta 12

What is the result of 5 // 2?

Selecciona una respuesta
Pregunta 13

What is the result of 5 % 2?

Selecciona una respuesta
Pregunta 14

Which keyword exits a loop immediately?

Selecciona una respuesta
Pregunta 15

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

Selecciona una respuesta
Pregunta 16

What is the output of bool(0)?

Selecciona una respuesta
Pregunta 17

Which statement handles exceptions?

Selecciona una respuesta
Pregunta 18

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

Selecciona una respuesta
Pregunta 19

Which syntax creates a dictionary?

Selecciona una respuesta
Pregunta 20

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

Selecciona una respuesta
Pregunta 21

Which keyword creates a class?

Selecciona una respuesta
Pregunta 22

What does self represent inside a Python class method?

Selecciona una respuesta
Pregunta 23

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

Selecciona una respuesta
Pregunta 24

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

Selecciona una respuesta
Pregunta 25

Which function returns the largest item in a list?

Selecciona una respuesta
Pregunta 26

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

Selecciona una respuesta
Pregunta 27

Which slice returns the last item of list x?

Selecciona una respuesta
Pregunta 28

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

Selecciona una respuesta
Pregunta 29

Which keyword defines an anonymous function?

Selecciona una respuesta
Pregunta 30

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

Selecciona una respuesta
Pregunta 31

Which data structure gives the fastest average membership test?

Selecciona una respuesta
Pregunta 32

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

Selecciona una respuesta
Pregunta 33

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

Selecciona una respuesta
Pregunta 34

Which statement is true about tuples?

Selecciona una respuesta
Pregunta 35

What does isinstance(3, int) return?

Selecciona una respuesta
Pregunta 36

Which function returns the number of items in a container?

Selecciona una respuesta
Pregunta 37

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

Selecciona una respuesta
Pregunta 38

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

Selecciona una respuesta
Pregunta 39

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

Selecciona una respuesta
Pregunta 40

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

Selecciona una respuesta
Pregunta 41

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

Selecciona una respuesta
Pregunta 42

Which exception is raised by 1 / 0?

Selecciona una respuesta
Pregunta 43

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

Selecciona una respuesta
Pregunta 44

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

Selecciona una respuesta
Pregunta 45

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

Selecciona una respuesta
Pregunta 46

Which expression evaluates to True?

Selecciona una respuesta
Pregunta 47

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

Selecciona una respuesta
Pregunta 48

Which method joins a list of strings into one string?

Selecciona una respuesta
Pregunta 49

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

Selecciona una respuesta
Pregunta 50

Which operator performs floor division?

Selecciona una respuesta
Pregunta 51

What is the result of 3 * "ab"?

Selecciona una respuesta
Pregunta 52

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

Selecciona una respuesta
Pregunta 53

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

Selecciona una respuesta
Pregunta 54

Which keyword imports a module?

Selecciona una respuesta
Pregunta 55

What is the purpose of a docstring?

Selecciona una respuesta
Pregunta 56

Which file commonly marks a directory as a Python package?

Selecciona una respuesta
Pregunta 57

What does the global keyword do inside a function?

Selecciona una respuesta
Pregunta 58

Which built-in function returns an object identity?

Selecciona una respuesta
Pregunta 59

What is the output of bool([])?

Selecciona una respuesta
Pregunta 60

Which is a valid variable name in Python?

Selecciona una respuesta
Pregunta 61

Which of the following built-in types are immutable?

Selecciona una respuesta
Pregunta 62

Which methods can add items to a list?

Selecciona una respuesta
Pregunta 63

Which expressions create a set?

Selecciona una respuesta
Pregunta 64

Which statements are true about dictionaries?

Selecciona una respuesta
Pregunta 65

Which built-in functions return iterables?

Selecciona una respuesta
Pregunta 66

Which keywords are used for exception handling?

Selecciona una respuesta
Pregunta 67

Python lists are zero-indexed.

Selecciona una respuesta
Pregunta 68

A Python string can be changed in place.

Selecciona una respuesta
Pregunta 69

None is a valid value in Python.

Selecciona una respuesta
Pregunta 70

A while loop always runs at least once.

Selecciona una respuesta
Pregunta 71

Dictionaries preserve insertion order in Python 3.7 and later.

Selecciona una respuesta
Pregunta 72

The is operator compares object identity, not value.

Selecciona una respuesta
Pregunta 73

A function without a return statement returns None.

Selecciona una respuesta
Pregunta 74

Python uses && for logical AND.

Selecciona una respuesta
Pregunta 75

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

Pregunta 76

Type the keyword used to define a function.

Pregunta 77

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

Pregunta 78

Type the keyword that raises an exception manually.

Pregunta 79

Type the keyword used to produce values from a generator.

Pregunta 80

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