What is the difference between Python arrays and lists?

Heisenbug logo
TheHeisenBug

Search

Search across questions, learning content, and hands-on projects

Ace Your Next Tech Interview

5,986+ interview questions across 87 technologies — with expert answers, advanced search, AI-powered assistance, personal highlights, structured learning paths, and hands-on practice projects.

5,986+Questions & Answers
87Technologies
AdvancedSearch
Built-inAsk AI
PersonalHighlights
StructuredLearning Paths
Hands-onPractice Projects

Lifetime Access

One-time payment. No subscriptions. Unlock everything, forever.

$19.90USD

or R$49.90 BRL

FeatureFreePremium
Question titlesAllAll
Answers per topicTop 5All
Learning chaptersFirst 5All
Practice projectsFirst 3All
Highlights
Ask AI
Read tracking
Search

Python Interview Questions

  1. [JUNIOR] What is Python and what are its key features?
  2. [JUNIOR] What are the built-in data types in Python?
  3. [JUNIOR] What is the difference between a list and a tuple in Python?
  4. [MID] What are decorators in Python and how do you create a custom one?
  5. [MID] What is the difference between a shallow copy and a deep copy in Python?
  6. [SENIOR] What is the Global Interpreter Lock (GIL) and how does it affect multithreading?
  7. [JUNIOR] What is PEP 8 and why is it important?
  8. [JUNIOR] What is a dynamically typed language?
  9. [JUNIOR] What does the pass statement do in Python?
  10. [JUNIOR] What is the __init__() method in Python?
  11. [MID] What are iterators and generators in Python and how do they differ?
  12. [MID] What is list comprehension in Python and when should you use it?
  13. [MID] How is exception handling done in Python using try, except, else, and finally?
  14. [MID] How is memory managed in Python?
  15. [SENIOR] What is the difference between concurrency and parallelism in Python?
  16. [SENIOR] When should you use multiprocessing versus multithreading in Python?
  17. [JUNIOR] What is a lambda function in Python?
  18. [JUNIOR] What are *args and **kwargs in function definitions?
  19. [JUNIOR] What is the difference between a mutable and an immutable data type in Python?
  20. [JUNIOR] What is slicing in Python and can slices have negative indices?
  21. [JUNIOR] What is a docstring in Python and how do you write one?
  22. [JUNIOR] What is the difference between a set and a dictionary in Python?
  23. [MID] What is the yield keyword used for in Python?
  24. [MID] What is the difference between @classmethod, @staticmethod, and instance methods?
  25. [MID] What is a context manager in Python and how does it differ from try...finally?
  26. [MID] What is the difference between is and == operators in Python?
  27. [MID] Why should you not use mutable objects as default arguments in Python?
  28. [MID] What are Python namespaces and why are they used?
  29. [SENIOR] What is MRO (Method Resolution Order) in Python and how does it work?
  30. [SENIOR] Does Python support multiple inheritance and how does it solve the diamond problem?
  31. [SENIOR] How would you profile a Python application to identify performance bottlenecks?
  32. [SENIOR] What are async and await keywords in Python and how does asyncio work?
  33. [JUNIOR] What is the difference between / and // operators in Python?
  34. [JUNIOR] What are break, continue, and pass statements in Python?
  35. [JUNIOR] What is variable scope in Python?
  36. [JUNIOR] What is PIP in Python?
  37. [JUNIOR] What is indentation in Python and why is it important?
  38. [MID] What is pickling and unpickling in Python?
  39. [MID] How are arguments passed in Python -- by value or by reference?
  40. [MID] What is the difference between __iter__ and __next__ methods?
  41. [MID] How do you write unit tests in Python using the unittest module?
  42. [MID] What is the difference between a .py and a .pyc file?
  43. [MID] What are data classes in Python and when should you use them?
  44. [SENIOR] What are metaclasses in Python and when would you use them?
  45. [SENIOR] What are descriptors in Python and how do they differ from decorators?
  46. [SENIOR] What is the __slots__ attribute and how can it improve performance?
  47. [SENIOR] How would you identify and resolve memory leaks in a production Python application?
  48. [SENIOR] What is duck typing in Python and how does it apply in real projects?
  49. [EXPERT] Why does the GIL still exist in Python and what are the ongoing efforts to remove it?
  50. [JUNIOR] What is the self keyword used for in Python?
  51. [JUNIOR] What are modules and packages in Python?
  52. [JUNIOR] What is the difference between Python arrays and lists?
  53. [JUNIOR] How can you concatenate two lists in Python?
  54. [MID] What is the Walrus operator (:=) in Python and when would you use it?
  55. [MID] What are negative indexes in Python and why are they used?
  56. [MID] How can you copy an object in Python?
  57. [MID] What is the difference between dict.get() and direct indexing with dict[key]?
  58. [MID] What is the difference between globals(), locals(), and vars() in Python?
  59. [SENIOR] What is monkey patching in Python and is it ever a good idea?
  60. [SENIOR] How do dict and set work internally and what is their time complexity for lookups?
  61. [SENIOR] What is the difference between __new__() and __init__() methods?
  62. [SENIOR] How would you process a file too large to fit into memory in Python?
  63. [SENIOR] What is string interning in Python and why does Python use it?
  64. [EXPERT] What is Cython, IronPython, and PyPy, and why do these alternate implementations exist?
  65. [EXPERT] How can you integrate async programming with synchronous libraries or legacy codebases?
  66. [EXPERT] What is backpressure in async systems and how do you handle it in Python?
  67. [JUNIOR] What is the zip() function in Python?
  68. [JUNIOR] How do you check if all characters in a string are alphanumeric?
  69. [JUNIOR] What are membership operators in Python?
  70. [MID] What does the id() function do in Python?
  71. [MID] How do you isolate Python code effectively using virtual environments?
  72. [MID] What are function annotations in Python?
  73. [SENIOR] How would you optimize a Python web application under high load?
  74. [SENIOR] What are the key differences between synchronous and asynchronous programming in Python?
  75. [SENIOR] How do you handle the producer-consumer problem in Python using threading or asyncio?
  76. [EXPERT] How does Python manage binary dependencies and what is the difference between wheels and eggs?
  77. [EXPERT] Why does Python not support tail recursion optimization and how would you implement a similar effect?
  78. [EXPERT] How would you design a high-performance async API server in Python and what frameworks would you use?
  79. [JUNIOR] How do you convert a string to an integer in Python?
  80. [JUNIOR] How can you make a Python script executable on Unix?
  81. [MID] What is the __init__.py module and what is it for?
  82. [MID] How can you reload a previously imported module in Python?
  83. [SENIOR] What is name mangling in Python and why does it exist?
  84. [SENIOR] What is late binding in Python closures and how does it affect lambdas in loops?
  85. [SENIOR] What is __pycache__ and why does Python generate .pyc files?
  86. [EXPERT] How do you access a Python module from C and vice versa?
  87. [EXPERT] What are the limitations of async programming in Python and how would you work around them?
  88. [EXPERT] How do you handle transitive dependencies effectively in large Python projects?
  89. [SENIOR] What is the PYTHONOPTIMIZE flag and what does it do?
  90. [EXPERT] What are .pth files in Python and when would you use them?
  91. [EXPERT] How do you distribute Python code effectively across different platforms?
  92. [EXPERT] What are exception groups in Python and when would you use them?
  93. [EXPERT] How would you implement a dictionary from scratch using core Python?