Python Interview Questions

1. Python Basics (150 Questions)

  1. What is Python, and why is it popular?
  2. Explain the difference between Python 2 and Python 3.
  3. What are the key features of Python?
  4. What is PEP 8, and why is it important?
  5. How is Python an interpreted language?
  6. What is the difference between a compiled and an interpreted language?
  7. What are Python’s built-in data types?
  8. Explain the difference between mutable and immutable objects in Python.
  9. What is the difference between a list and a tuple?
  10. How do you define a variable in Python?
  11. What is the purpose of the pass statement?
  12. Explain the use of None in Python.
  13. What is the difference between = and == operators?
  14. How does Python handle memory management?
  15. What is garbage collection in Python?
  16. Explain the concept of dynamic typing in Python.
  17. What are Python’s naming conventions for variables?
  18. How do you check the type of a variable in Python?
  19. What is the id() function in Python?
  20. What is the difference between is and ==?
  21. How do you convert a string to an integer in Python?
  22. What is the purpose of the print() function?
  23. How do you use comments in Python?
  24. What are docstrings, and how are they used?
  25. What is the difference between single, double, and triple quotes in Python?
  26. Explain the input() function in Python.
  27. What is the difference between int and float?
  28. How do you handle exceptions in Python?
  29. What is the purpose of the try and except blocks?
  30. What is the finally block used for?
  31. What is the else clause in exception handling?
  32. How do you raise an exception in Python?
  33. What is a custom exception, and how do you create one?
  34. What is the assert statement, and when is it used?
  35. Explain the difference between break and continue statements.
  36. What is the return statement, and how is it used?
  37. How do you use the global keyword in Python?
  38. What is the nonlocal keyword, and when is it used?
  39. Explain the difference between local and global variables.
  40. What are Python’s built-in functions?
  41. How do you use the len() function?
  42. What is the purpose of the type() function?
  43. Explain the range() function and its parameters.
  44. How do you use the zip() function?
  45. What is the enumerate() function, and how is it used?
  46. How do you use the slice() function in Python?
  47. What is the difference between shallow copy and deep copy?
  48. How do you perform a shallow copy in Python?
  49. How do you perform a deep copy in Python?
  50. What is the copy module in Python?
  51. Explain the import statement in Python.
  52. What is the difference between import module and from module import *?
  53. How do you import a specific function from a module?
  54. What is the as keyword used for in imports?
  55. What is the sys module in Python?
  56. How do you access command-line arguments in Python?
  57. What is the os module, and what are its common functions?
  58. Explain the dir() function in Python.
  59. What is the help() function, and how is it used?
  60. How do you check the Python version in a program?
  61. What is the difference between __name__ and __main__?
  62. Explain the concept of Python’s GIL (Global Interpreter Lock).
  63. What are Python’s reserved keywords?
  64. How do you check if a keyword is reserved in Python?
  65. What is the purpose of the del statement?
  66. How do you swap two variables in Python?
  67. What is the difference between and and & operators?
  68. What is the difference between or and | operators?
  69. Explain the not operator in Python.
  70. What are bitwise operators in Python?
  71. How do you use the in operator in Python?
  72. What is the isinstance() function, and how is it used?
  73. How do you check if an object is iterable?
  74. What is the difference between list() and []?
  75. What is the bool data type in Python?
  76. How do you convert a number to a string in Python?
  77. What is string interpolation in Python?
  78. Explain the f-string syntax in Python.
  79. What is the difference between % formatting and str.format()?
  80. How do you use the join() method for strings?
  81. What is the split() method, and how is it used?
  82. How do you reverse a string in Python?
  83. What is the strip() method, and what does it do?
  84. How do you check if a string is alphanumeric?
  85. What is the difference between upper() and lower() methods?
  86. How do you capitalize a string in Python?
  87. What is the replace() method for strings?
  88. How do you check if a string starts with a specific substring?
  89. How do you check if a string ends with a specific substring?
  90. What is the find() method, and how does it differ from index()?
  91. How do you count occurrences of a substring in a string?
  92. What is the startswith() method in Python?
  93. What is the endswith() method in Python?
  94. How do you check if a string is empty?
  95. What is the purpose of the chr() function?
  96. What is the purpose of the ord() function?
  97. How do you use escape characters in Python?
  98. What is the r prefix in Python strings?
  99. What is the u prefix in Python strings?
  100. What is the b prefix in Python strings?
  101. How do you concatenate strings in Python?
  102. What is the difference between string concatenation and string formatting?
  103. How do you handle multiline strings in Python?
  104. What is the repr() function, and how does it differ from str()?
  105. How do you use the format() method for string formatting?
  106. What is the purpose of the encode() and decode() methods?
  107. How do you handle Unicode strings in Python?
  108. What is the difference between ASCII and Unicode?
  109. How do you check the memory usage of an object in Python?
  110. What is the sys.getsizeof() function?
  111. How do you use the round() function in Python?
  112. What is the abs() function, and how is it used?
  113. How do you use the max() and min() functions?
  114. What is the sum() function, and how is it used?
  115. How do you generate random numbers in Python?
  116. What is the random module, and what are its key functions?
  117. How do you use the randint() function in the random module?
  118. What is the choice() function in the random module?
  119. How do you shuffle a list using the random module?
  120. What is the seed() function in the random module?
  121. How do you use the math module in Python?
  122. What is the math.pi constant?
  123. How do you calculate the square root using the math module?
  124. What is the math.ceil() function?
  125. What is the math.floor() function?
  126. How do you use the pow() function in Python?
  127. What is the divmod() function, and how is it used?
  128. How do you handle floating-point precision issues in Python?
  129. What is the decimal module, and when is it used?
  130. How do you use the fractions module in Python?
  131. What is the difference between int and long in Python 3?
  132. How do you convert a string to a float in Python?
  133. What is the complex data type in Python?
  134. How do you perform complex number arithmetic in Python?
  135. What is the bin() function, and how is it used?
  136. What is the hex() function, and how is it used?
  137. What is the oct() function, and how is it used?
  138. How do you convert a number to binary in Python?
  139. What is the format() function for number formatting?
  140. How do you use the zfill() method for strings?
  141. What is the isnumeric() method for strings?
  142. What is the isdigit() method, and how does it differ from isnumeric()?
  143. How do you check if a string contains only whitespace?
  144. What is the title() method for strings?
  145. How do you align text using string methods?
  146. What is the ljust() method for strings?
  147. What is the rjust() method for strings?
  148. What is the center() method for strings?
  149. How do you use the partition() method for strings?
  150. What is the rpartition() method for strings?

2. Control Flow (100 Questions)

  1. What is an if statement, and how is it used?
  2. How do you write a nested if statement?
  3. What is the elif clause, and when is it used?
  4. How do you use the else clause in Python?
  5. What is a ternary operator in Python?
  6. How do you write a one-line if statement?
  7. What is the difference between if and elif?
  8. How do you handle multiple conditions in an if statement?
  9. What is the while loop, and how is it used?
  10. How do you break out of a while loop?
  11. What is the for loop, and how is it used?
  12. How do you iterate over a list using a for loop?
  13. How do you iterate over a string using a for loop?
  14. How do you iterate over a dictionary using a for loop?
  15. What is the range() function in a for loop?
  16. How do you skip iterations in a for loop?
  17. What is the difference between break and continue in loops?
  18. How do you use nested loops in Python?
  19. What is a loop variable in Python?
  20. How do you use the else clause with loops?
  21. What happens when a loop’s else clause is executed?
  22. How do you create an infinite loop in Python?
  23. How do you avoid infinite loops in Python?
  24. What is the pass statement in loops?
  25. How do you iterate over multiple sequences simultaneously?
  26. What is the zip() function in loops?
  27. How do you use the enumerate() function in loops?
  28. How do you iterate over a list in reverse order?
  29. What is the reversed() function in Python?
  30. How do you iterate over a range with a step value?
  31. What is short-circuit evaluation in Python?
  32. How does the and operator work in control flow?
  33. How does the or operator work in control flow?
  34. What is the precedence of logical operators in Python?
  35. How do you use the not operator in control flow?
  36. What is a switch-case equivalent in Python?
  37. How do you implement a match-case statement in Python 3.10+?
  38. What are the benefits of the match statement over if-elif?
  39. How do you handle multiple conditions in a match statement?
  40. What is the _ wildcard in a match statement?
  41. How do you use pattern matching with lists in a match statement?
  42. What is the difference between a for loop and a while loop?
  43. How do you optimize loops in Python?
  44. What is loop unrolling in Python?
  45. How do you use list comprehensions in place of loops?
  46. What is the difference between a list comprehension and a for loop?
  47. How do you handle nested list comprehensions?
  48. What is a generator expression, and how is it used in loops?
  49. How do you iterate over a file line by line?
  50. What is the next() function in Python?
  51. How do you use the iter() function in Python?
  52. What is an iterator in Python?
  53. What is the difference between an iterator and an iterable?
  54. How do you create a custom iterator in Python?
  55. What is the __iter__() method in Python?
  56. What is the __next__() method in Python?
  57. How do you handle StopIteration in Python?
  58. What is a sentinel value in loops?
  59. How do you use the while True construct effectively?
  60. What is the break statement’s effect in nested loops?
  61. How do you exit multiple nested loops at once?
  62. What is the continue statement’s effect in nested loops?
  63. How do you use else with a while loop?
  64. How do you iterate over a dictionary’s keys and values?
  65. What is the items() method in dictionaries?
  66. How do you use break in a for loop with else?
  67. What is the difference between for and while in terms of performance?
  68. How do you handle empty iterables in loops?
  69. What is the map() function, and how is it used in loops?
  70. What is the filter() function, and how is it used in loops?
  71. How do you combine map() and filter() in Python?
  72. What is the reduce() function in Python?
  73. How do you use the functools.reduce() function?
  74. What is the any() function in Python?
  75. What is the all() function in Python?
  76. How do you use any() and all() in control flow?
  77. What is a guard clause in Python?
  78. How do you implement a guard clause in Python?
  79. What is the difference between while and do-while loops?
  80. How do you simulate a do-while loop in Python?
  81. What is the itertools module, and how is it used in loops?
  82. How do you use itertools.cycle() in Python?
  83. What is itertools.chain() and how is it used?
  84. How do you use itertools.islice() in Python?
  85. What is itertools.count(), and how is it used?
  86. How do you handle large datasets in loops efficiently?
  87. What is lazy evaluation in Python loops?
  88. How do you use generators to optimize loops?
  89. What is the yield keyword in Python?
  90. How do you create a generator function in Python?
  91. What is the difference between a generator and a list comprehension?
  92. How do you use yield from in Python?
  93. What is a coroutine in Python?
  94. How do you use async and await in loops?
  95. What is the asyncio module in Python?
  96. How do you handle asynchronous iteration in Python?
  97. What is the async for loop in Python?
  98. How do you use asyncio.gather() in loops?
  99. What is the difference between synchronous and asynchronous loops?
  100. How do you optimize control flow for performance in Python?

3. Functions (150 Questions)

  1. What is a function in Python?
  2. How do you define a function in Python?
  3. What is the difference between a function and a method?
  4. How do you call a function in Python?
  5. What are function arguments in Python?
  6. What is the difference between positional and keyword arguments?
  7. How do you use default arguments in a function?
  8. What are variable-length arguments in Python?
  9. How do you use *args in a function?
  10. How do you use **kwargs in a function?
  11. What is the difference between *args and **kwargs?
  12. How do you pass a dictionary as keyword arguments to a function?
  13. What is a return value in Python functions?
  14. How do you return multiple values from a function?
  15. What is the return statement in Python?
  16. How do you handle functions with no return value?
  17. What is a void function in Python?
  18. How do you define a function with optional arguments?
  19. What is a lambda function in Python?
  20. How do you use a lambda function in Python?
  21. What is the difference between a lambda function and a regular function?
  22. How do you use lambda functions with map()?
  23. How do you use lambda functions with filter()?
  24. What is a nested function in Python?
  25. How do you define a function inside another function?
  26. What is a closure in Python?
  27. How do you create a closure in Python?
  28. What is the nonlocal keyword in nested functions?
  29. How do you access outer function variables in a nested function?
  30. What is function scope in Python?
  31. What is the LEGB rule in Python?
  32. How do you use the global keyword in a function?
  33. What is function overloading, and does Python support it?
  34. How do you simulate function overloading in Python?
  35. What is function recursion in Python?
  36. How do you write a recursive function in Python?
  37. What is the base case in a recursive function?
  38. What are the advantages of recursion in Python?
  39. What are the disadvantages of recursion in Python?
  40. How do you optimize recursive functions in Python?
  41. What is tail recursion, and does Python support it?
  42. How do you handle stack overflow in recursive functions?
  43. What is memoization in Python?
  44. How do you implement memoization in Python?
  45. What is the functools.lru_cache decorator?
  46. How do you use the lru_cache decorator for memoization?
  47. What is a decorator in Python?
  48. How do you create a custom decorator in Python?
  49. What is the @ symbol used for in Python decorators?
  50. How do you chain multiple decorators in Python?
  51. What is a higher-order function in Python?
  52. How do you pass a function as an argument to another function?
  53. What is the callable() function in Python?
  54. How do you check if an object is callable?
  55. What is function composition in Python?
  56. How do you implement function composition in Python?
  57. What is the functools module in Python?
  58. How do you use functools.partial() in Python?
  59. What is the operator module, and how is it used with functions?
  60. How do you use the itemgetter() function from the operator module?
  61. What is the attrgetter() function in the operator module?
  62. How do you handle default mutable arguments in functions?
  63. What is the issue with mutable default arguments in Python?
  64. How do you avoid issues with mutable default arguments?
  65. What is a pure function in Python?
  66. What are the benefits of pure functions?
  67. How do you write a pure function in Python?
  68. What is a side effect in a function?
  69. How do you avoid side effects in functions?
  70. What is function annotation in Python?
  71. How do you add type hints to function parameters?
  72. What is the typing module in Python?
  73. How do you use Union from the typing module?
  74. What is the Any type in the typing module?
  75. How do you use Optional in type hints?
  76. What is the Callable type in the typing module?
  77. How do you use type hints with return values?
  78. What is the mypy tool, and how is it used with Python?
  79. How do you document a function using docstrings?
  80. What is the difference between a docstring and a comment?
  81. How do you access a function’s docstring?
  82. What is the __doc__ attribute in Python?
  83. How do you use the help() function with functions?
  84. What is function introspection in Python?
  85. How do you use the inspect module in Python?
  86. What is the signature() function in the inspect module?
  87. How do you get the parameters of a function using inspect?
  88. What is a first-class function in Python?
  89. How does Python support first-class functions?
  90. What is a function factory in Python?
  91. How do you create a function factory in Python?
  92. What is a callback function in Python?
  93. How do you implement a callback function in Python?
  94. What is the apply() function equivalent in Python?
  95. How do you handle variable scope in recursive functions?
  96. What is the staticmethod decorator in Python?
  97. What is the classmethod decorator in Python?
  98. What is the difference between staticmethod and classmethod?
  99. How do you use the @property decorator in Python?
  100. What is a getter and setter in Python?
  101. How do you implement a getter using @property?
  102. How do you implement a setter using @property?
  103. What is the @property.setter decorator?
  104. What is the @property.deleter decorator?
  105. How do you create a read-only property in Python?
  106. What is the difference between a method and a function?
  107. How do you use default arguments with **kwargs?
  108. What is the functools.wraps decorator?
  109. How do you preserve metadata in a decorator using functools.wraps?
  110. What is the __call__() method in Python?
  111. How do you make a class callable in Python?
  112. What is a method descriptor in Python?
  113. How do you use descriptors in Python functions?
  114. What is a bound method in Python?
  115. What is an unbound method in Python?
  116. How do you convert a function to a method in Python?
  117. What is the difference between a function and a lambda expression?
  118. How do you use lambda functions in sorting?
  119. What is the key parameter in sorting functions?
  120. How do you sort a list using a lambda function?
  121. What is the sorted() function in Python?
  122. How does sorted() differ from list.sort()?
  123. What is the reverse parameter in sorting functions?
  124. How do you sort a dictionary by values in Python?
  125. How do you sort a dictionary by keys in Python?
  126. What is the operator.itemgetter() in sorting?
  127. How do you use operator.itemgetter() for sorting?
  128. What is the operator.attrgetter() in sorting?
  129. How do you use operator.attrgetter() for sorting?
  130. How do you handle exceptions in a function?
  131. What is the try-except block inside a function?
  132. How do you raise an exception in a function?
  133. What is a generator function in Python?
  134. How do you create a generator function in Python?
  135. What is the difference between a generator and a regular function?
  136. How do you use yield in a generator function?
  137. What is the send() method in generators?
  138. How do you use the throw() method in generators?
  139. What is the close() method in generators?
  140. How do you handle generator termination in Python?
  141. What is a coroutine, and how is it different from a generator?
  142. How do you use async def in Python functions?
  143. What is the await keyword in Python?
  144. How do you handle asynchronous functions in Python?
  145. What is the asyncio.run() function?
  146. How do you use asyncio.create_task() in Python?
  147. What is the asyncio.sleep() function?
  148. How do you handle multiple coroutines in Python?
  149. What is the asyncio.gather() function?
  150. How do you cancel an asynchronous task in Python?

4. Data Structures (150 Questions)

  1. What are the built-in data structures in Python?
  2. What is a list in Python?
  3. How do you create a list in Python?
  4. What is the difference between a list and an array?
  5. How do you append an element to a list?
  6. What is the append() method for lists?
  7. How do you insert an element into a list at a specific index?
  8. What is the insert() method for lists?
  9. How do you remove an element from a list?
  10. What is the remove() method for lists?
  11. How do you use the pop() method for lists?
  12. What is the difference between pop() and remove()?
  13. How do you clear a list in Python?
  14. What is the clear() method for lists?
  15. How do you extend a list in Python?
  16. What is the extend() method for lists?
  17. How do you reverse a list in Python?
  18. What is the reverse() method for lists?
  19. How do you sort a list in Python?
  20. What is the sort() method for lists?
  21. How do you copy a list in Python?
  22. What is the copy() method for lists?
  23. How do you check if an element exists in a list?
  24. What is the in operator for lists?
  25. How do you find the index of an element in a list?
  26. What is the index() method for lists?
  27. How do you count occurrences of an element in a list?
  28. What is the count() method for lists?
  29. How do you slice a list in Python?
  30. What is list indexing in Python?
  31. How do you access elements in a nested list?
  32. What is a list comprehension in Python?
  33. How do you create a list comprehension?
  34. What is the difference between a list comprehension and a loop?
  35. How do you handle nested list comprehensions?
  36. What is a tuple in Python?
  37. How do you create a tuple in Python?
  38. What is the difference between a tuple and a list?
  39. How do you access elements in a tuple?
  40. What is tuple unpacking in Python?
  41. How do you perform tuple unpacking?
  42. What is the immutability of tuples in Python?
  43. How do you concatenate tuples in Python?
  44. What is tuple slicing in Python?
  45. How do you check if an element exists in a tuple?
  46. What is the index() method for tuples?
  47. What is the count() method for tuples?
  48. How do you convert a list to a tuple?
  49. How do you convert a tuple to a list?
  50. What is a dictionary in Python?
  51. How do you create a dictionary in Python?
  52. What is the difference between a dictionary and a list?
  53. How do you access values in a dictionary?
  54. What is the get() method for dictionaries?
  55. How do you add a key-value pair to a dictionary?
  56. What is the update() method for dictionaries?
  57. How do you remove a key-value pair from a dictionary?
  58. What is the pop() method for dictionaries?
  59. How do you use the popitem() method for dictionaries?
  60. What is the clear() method for dictionaries?
  61. How do you check if a key exists in a dictionary?
  62. What is the in operator for dictionaries?
  63. How do you iterate over a dictionary’s keys?
  64. How do you iterate over a dictionary’s values?
  65. What is the items() method for dictionaries?
  66. How do you iterate over a dictionary’s key-value pairs?
  67. What is the keys() method for dictionaries?
  68. What is the values() method for dictionaries?
  69. How do you copy a dictionary in Python?
  70. What is the copy() method for dictionaries?
  71. How do you merge two dictionaries in Python?
  72. What is a dictionary comprehension in Python?
  73. How do you create a dictionary comprehension?
  74. What is a set in Python?
  75. How do you create a set in Python?
  76. What is the difference between a set and a list?
  77. How do you add an element to a set?
  78. What is the add() method for sets?
  79. How do you remove an element from a set?
  80. What is the remove() method for sets?
  81. What is the discard() method for sets?
  82. What is the difference between remove() and discard() in sets?
  83. How do you clear a set in Python?
  84. What is the clear() method for sets?
  85. How do you perform a union of two sets?
  86. What is the union() method for sets?
  87. How do you perform an intersection of two sets?
  88. What is the intersection() method for sets?
  89. How do you perform a difference of two sets?
  90. What is the difference() method for sets?
  91. How do you perform a symmetric difference of two sets?
  92. What is the symmetric_difference() method for sets?
  93. How do you check if a set is a subset of another set?
  94. What is the issubset() method for sets?
  95. How do you check if a set is a superset of another set?
  96. What is the issuperset() method for sets?
  97. How do you check if two sets are disjoint?
  98. What is the isdisjoint() method for sets?
  99. How do you copy a set in Python?
  100. What is the copy() method for sets?
  101. What is a frozenset in Python?
  102. How do you create a frozenset in Python?
  103. What is the difference between a set and a frozenset?
  104. How do you convert a list to a set?
  105. How do you convert a set to a list?
  106. What is the collections module in Python?
  107. What is a namedtuple in the collections module?
  108. How do you create a namedtuple in Python?
  109. What is a deque in the collections module?
  110. How do you use a deque in Python?
  111. What is the difference between a list and a deque?
  112. What is a Counter in the collections module?
  113. How do you use the Counter class in Python?
  114. What is an OrderedDict in the collections module?
  115. How do you create an OrderedDict in Python?
  116. What is the difference between OrderedDict and a regular dictionary?
  117. What is a defaultdict in the collections module?
  118. How do you create a defaultdict in Python?
  119. What is the difference between defaultdict and a regular dictionary?
  120. What is a ChainMap in the collections module?
  121. How do you use a ChainMap in Python?
  122. What is the heapq module in Python?
  123. How do you create a heap using the heapq module?
  124. What is the heappush() function in the heapq module?
  125. What is the heappop() function in the heapq module?
  126. How do you find the smallest elements in a heap?
  127. What is the heapify() function in the heapq module?
  128. What is a priority queue, and how is it implemented in Python?
  129. How do you implement a priority queue using heapq?
  130. What is the array module in Python?
  131. How do you create an array in Python?
  132. What is the difference between an array and a list?
  133. How do you access elements in an array?
  134. What is the bytearray data type in Python?
  135. How do you create a bytearray in Python?
  136. What is the difference between bytes and bytearray?
  137. How do you convert a string to a bytearray?
  138. What is a linked list, and how do you implement it in Python?
  139. What is a stack, and how do you implement it in Python?
  140. What is a queue, and how do you implement it in Python?
  141. What is a deque, and how does it differ from a queue?
  142. How do you implement a circular queue in Python?
  143. What is a binary tree, and how do you implement it in Python?
  144. What is a binary search tree (BST) in Python?
  145. How do you implement a BST in Python?
  146. What is a trie, and how do you implement it in Python?
  147. What is a hash table, and how is it implemented in Python?
  148. How do dictionaries use hash tables internally?
  149. What is a collision in a hash table, and how is it resolved?
  150. How do you handle hash collisions in Python dictionaries?

5. Object-Oriented Programming (OOP) (150 Questions)

  1. What is object-oriented programming in Python?
  2. What is a class in Python?
  3. How do you define a class in Python?
  4. What is an object in Python?
  5. How do you create an object from a class?
  6. What is the __init__() method in Python?
  7. How do you use the self parameter in Python?
  8. What is the difference between a class and an object?
  9. What is inheritance in Python?
  10. How do you implement inheritance in Python?
  11. What is single inheritance in Python?
  12. What is multiple inheritance in Python?
  13. What is multilevel inheritance in Python?
  14. What is hierarchical inheritance in Python?
  15. What is hybrid inheritance in Python?
  16. How do you use the super() function in Python?
  17. What is method overriding in Python?
  18. How do you override a method in a subclass?
  19. What is method overloading, and does Python support it?
  20. How do you simulate method overloading in Python?
  21. What is polymorphism in Python?
  22. How do you implement polymorphism in Python?
  23. What is encapsulation in Python?
  24. How do you achieve encapsulation in Python?
  25. What is the difference between public, private, and protected members?
  26. How do you define private attributes in Python?
  27. What is name mangling in Python?
  28. How do you use double underscores for private attributes?
  29. What is a property in Python?
  30. How do you create a property using the @property decorator?
  31. What is a getter method in Python?
  32. What is a setter method in Python?
  33. How do you create a read-only property in Python?
  34. What is a class method in Python?
  35. How do you define a class method using @classmethod?
  36. What is a static method in Python?
  37. How do you define a static method using @staticmethod?
  38. What is the difference between a class method and a static method?
  39. What is an abstract class in Python?
  40. How do you create an abstract class in Python?
  41. What is the abc module in Python?
  42. How do you use the ABC class from the abc module?
  43. What is an abstract method in Python?
  44. How do you define an abstract method using @abstractmethod?
  45. What is method resolution order (MRO) in Python?
  46. How do you check the MRO of a class?
  47. What is the __mro__ attribute in Python?
  48. How do you handle diamond problem in multiple inheritance?
  49. What is a mixin in Python?
  50. How do you create a mixin in Python?
  51. What is the difference between a mixin and a regular class?
  52. How do you use composition in Python?
  53. What is the difference between inheritance and composition?
  54. What is a class variable in Python?
  55. What is an instance variable in Python?
  56. How do you access class variables in Python?
  57. How do you access instance variables in Python?
  58. What is the difference between class and instance variables?
  59. How do you define a class attribute in Python?
  60. What is the __dict__ attribute in Python?
  61. How do you use __dict__ to inspect object attributes?
  62. What is the __slots__ attribute in Python?
  63. How do you use __slots__ to optimize memory?
  64. What are the advantages of using __slots__?
  65. What are the limitations of using __slots__?
  66. What is a metaclass in Python?
  67. How do you create a metaclass in Python?
  68. What is the type class in Python?
  69. How do you use type to create a class dynamically?
  70. What is the __new__() method in Python?
  71. How does __new__() differ from __init__()?
  72. What is the __call__() method in Python?
  73. How do you make a class callable in Python?
  74. What is operator overloading in Python?
  75. How do you overload operators in Python?
  76. What is the __add__() method in Python?
  77. How do you overload the + operator in Python?
  78. What is the __str__() method in Python?
  79. How does __str__() differ from __repr__()?
  80. What is the __len__() method in Python?
  81. How do you overload the len() function for a class?
  82. What is the __getitem__() method in Python?
  83. How do you make a class subscriptable in Python?
  84. What is the __setitem__() method in Python?
  85. How do you make a class support item assignment?
  86. What is the __delitem__() method in Python?
  87. How do you implement __delitem__() in a class?
  88. What is the __iter__() method in Python?
  89. How do you make a class iterable in Python?
  90. What is the __next__() method in Python?
  91. How do you create a custom iterator class in Python?
  92. What is the __eq__() method in Python?
  93. How do you overload the == operator in Python?
  94. What is the __lt__() method in Python?
  95. How do you overload comparison operators in Python?
  96. What is the __hash__() method in Python?
  97. How do you make a class hashable in Python?
  98. What is the __bool__() method in Python?
  99. How do you customize truth value testing in Python?
  100. What is the __getattr__() method in Python?
  101. How do you handle attribute access dynamically in Python?
  102. What is the __setattr__() method in Python?
  103. How do you handle attribute assignment dynamically?
  104. What is the __delattr__() method in Python?
  105. How do you handle attribute deletion dynamically?
  106. What is a descriptor in Python?
  107. How do you create a custom descriptor in Python?
  108. What is the __get__() method in descriptors?
  109. What is the __set__() method in descriptors?
  110. What is the __delete__() method in descriptors?
  111. How do you use descriptors to implement properties?
  112. What is a weak reference in Python?
  113. How do you use the weakref module in Python?
  114. What is a weak reference to an object?
  115. How do you create a weak reference to a class instance?
  116. What is the weakref.proxy() function in Python?
  117. How do you handle cyclic references in Python?
  118. What is garbage collection in the context of OOP?
  119. How do you use the gc module in Python?
  120. What is the __del__() method in Python?
  121. How do you implement a destructor in Python?
  122. What are the limitations of the __del__() method?
  123. How do you handle memory leaks in Python classes?
  124. What is a class decorator in Python?
  125. How do you create a class decorator in Python?
  126. What is the difference between a class decorator and a function decorator?
  127. How do you use dataclasses in Python?
  128. What is the @dataclass decorator in Python?
  129. How do you define default values in a dataclass?
  130. What is the field() function in a dataclass?
  131. How do you make a dataclass immutable?
  132. What is the __post_init__() method in a dataclass?
  133. How do you use type hints in a dataclass?
  134. What is the difference between a dataclass and a regular class?
  135. How do you implement a singleton pattern in Python?
  136. What is the factory pattern in Python?
  137. How do you implement a factory pattern in Python?
  138. What is the abstract factory pattern in Python?
  139. How do you implement an abstract factory pattern in Python?
  140. What is the builder pattern in Python?
  141. How do you implement a builder pattern in Python?
  142. What is the observer pattern in Python?
  143. How do you implement an observer pattern in Python?
  144. What is the strategy pattern in Python?
  145. How do you implement a strategy pattern in Python?
  146. What is the decorator pattern in Python?
  147. How do you implement a decorator pattern in Python?
  148. What is the adapter pattern in Python?
  149. How do you implement an adapter pattern in Python?
  150. What is the facade pattern in Python?

6. File Handling (100 Questions)

  1. How do you open a file in Python?
  2. What is the open() function in Python?
  3. What are the different modes for opening a file in Python?
  4. What is the difference between r and r+ modes in file handling?
  5. What is the difference between w and w+ modes in file handling?
  6. What is the a mode in file handling?
  7. What is the b mode in file handling?
  8. How do you read a file in Python?
  9. What is the read() method for files?
  10. How do you read a file line by line in Python?
  11. What is the readline() method for files?
  12. What is the readlines() method for files?
  13. How do you write to a file in Python?
  14. What is the write() method for files?
  15. What is the writelines() method for files?
  16. How do you close a file in Python?
  17. What is the close() method for files?
  18. Why is it important to close a file in Python?
  19. How do you use the with statement for file handling?
  20. What are the benefits of using the with statement for files?
  21. How do you handle file not found errors in Python?
  22. What is the FileNotFoundError in Python?
  23. How do you check if a file exists in Python?
  24. What is the os.path.exists() function?
  25. How do you check if a path is a file or directory?
  26. What is the os.path.isfile() function?
  27. What is the os.path.isdir() function?
  28. How do you get the current working directory in Python?
  29. What is the os.getcwd() function?
  30. How do you change the current working directory in Python?
  31. What is the os.chdir() function?
  32. How do you create a directory in Python?
  33. What is the os.mkdir() function?
  34. How do you create nested directories in Python?
  35. What is the os.makedirs() function?
  36. How do you remove a file in Python?
  37. What is the os.remove() function?
  38. How do you remove a directory in Python?
  39. What is the os.rmdir() function?
  40. How do you remove a directory with all its contents?
  41. What is the shutil.rmtree() function?
  42. How do you rename a file in Python?
  43. What is the os.rename() function?
  44. How do you copy a file in Python?
  45. What is the shutil.copy() function?
  46. How do you move a file in Python?
  47. What is the shutil.move() function?
  48. How do you get the size of a file in Python?
  49. What is the os.path.getsize() function?
  50. How do you get the last modified time of a file?
  51. What is the os.path.getmtime() function?
  52. How do you read a binary file in Python?
  53. How do you write to a binary file in Python?
  54. What is the pickle module in Python?
  55. How do you serialize an object using pickle?
  56. What is the pickle.dump() function?
  57. How do you deserialize an object using pickle?
  58. What is the pickle.load() function?
  59. What are the limitations of the pickle module?
  60. How do you handle large files in Python?
  61. What is the io module in Python?
  62. How do you use the io.StringIO class?
  63. What is the io.BytesIO class?
  64. How do you read a CSV file in Python?
  65. What is the csv module in Python?
  66. How do you use the csv.reader() function?
  67. How do you write to a CSV file in Python?
  68. What is the csv.writer() function?
  69. How do you read a JSON file in Python?
  70. What is the json module in Python?
  71. How do you use the json.load() function?
  72. How do you write to a JSON file in Python?
  73. What is the json.dump() function?
  74. How do you parse a JSON string in Python?
  75. What is the json.loads() function?
  76. How do you convert a Python object to a JSON string?
  77. What is the json.dumps() function?
  78. How do you handle malformed JSON data?
  79. What is the yaml module in Python?
  80. How do you read a YAML file in Python?
  81. How do you write to a YAML file in Python?
  82. What is the difference between JSON and YAML?
  83. How do you read an Excel file in Python?
  84. What is the pandas library for file handling?
  85. How do you use pandas.read_excel()?
  86. How do you write to an Excel file using pandas?
  87. What is the openpyxl library in Python?
  88. How do you read an Excel file using openpyxl?
  89. How do you write to an Excel file using openpyxl?
  90. What is the xlrd library in Python?
  91. How do you handle file permissions in Python?
  92. What is the os.access() function?
  93. How do you change file permissions in Python?
  94. What is the os.chmod() function?
  95. How do you handle file encoding in Python?
  96. What is the encoding parameter in the open() function?
  97. How do you read a file with a specific encoding?
  98. What is the utf-8 encoding in Python?
  99. How do you handle Unicode errors in file handling?
  100. What is the io module’s role in file handling?

7. Modules and Packages (100 Questions)

  1. What is a module in Python?
  2. How do you create a module in Python?
  3. How do you import a module in Python?
  4. What is the difference between import and from ... import?
  5. How do you import a specific function from a module?
  6. What is the as keyword in imports?
  7. How do you import all functions from a module?
  8. What are the dangers of using from module import *?
  9. What is a package in Python?
  10. How do you create a package in Python?
  11. What is the __init__.py file in a package?
  12. How do you import a module from a package?
  13. What is the difference between a module and a package?
  14. How do you use relative imports in Python?
  15. What is the . notation in relative imports?
  16. What is the .. notation in relative imports?
  17. How do you handle import errors in Python?
  18. What is the ImportError exception in Python?
  19. How do you resolve module not found errors?
  20. What is the sys.path variable in Python?
  21. How do you add a directory to sys.path?
  22. What is the PYTHONPATH environment variable?
  23. How do you set the PYTHONPATH environment variable?
  24. What is the site module in Python?
  25. How do you install a third-party module in Python?
  26. What is pip in Python?
  27. How do you use pip install to install a module?
  28. What is the requirements.txt file in Python?
  29. How do you create a requirements.txt file?
  30. How do you install dependencies from requirements.txt?
  31. What is venv in Python?
  32. How do you create a virtual environment in Python?
  33. How do you activate a virtual environment in Python?
  34. What is the difference between venv and virtualenv?
  35. How do you deactivate a virtual environment?
  36. What is the site-packages directory in a virtual environment?
  37. How do you upgrade a package using pip?
  38. What is the pip freeze command?
  39. How do you uninstall a package using pip?
  40. What is the pip list command?
  41. How do you check the version of an installed package?
  42. What is the importlib module in Python?
  43. How do you dynamically import a module in Python?
  44. What is the importlib.import_module() function?
  45. How do you reload a module in Python?
  46. What is the importlib.reload() function?
  47. How do you handle cyclic imports in Python?
  48. What is a namespace package in Python?
  49. How do you create a namespace package?
  50. What is the difference between a regular package and a namespace package?
  51. How do you distribute a Python package?
  52. What is setup.py in a Python package?
  53. How do you create a setup.py file?
  54. What is the setuptools module in Python?
  55. How do you use setuptools to package a module?
  56. What is the wheel format in Python?
  57. How do you create a wheel file for a package?
  58. What is the twine tool in Python?
  59. How do you upload a package to PyPI using twine?
  60. What is the PyPI repository?
  61. How do you install a package from a local wheel file?
  62. What is the distutils module in Python?
  63. How does distutils differ from setuptools?
  64. What is a Python egg, and how is it used?
  65. How do you create a Python egg?
  66. What is the pipenv tool in Python?
  67. How do you use Pipfile in pipenv?
  68. What is the Pipfile.lock file?
  69. How do you manage dependencies with pipenv?
  70. What is the poetry tool in Python?
  71. How do you use poetry to manage dependencies?
  72. What is the pyproject.toml file?
  73. How do you create a pyproject.toml file?
  74. What is the flit tool in Python?
  75. How do you use flit to package a module?
  76. What is the difference between pip, pipenv, and poetry?
  77. How do you handle package version conflicts?
  78. What is dependency resolution in Python?
  79. How do you check for outdated packages using pip?
  80. What is the pipdeptree tool in Python?
  81. How do you visualize package dependencies?
  82. What is the pkg_resources module in Python?
  83. How do you access package metadata using pkg_resources?
  84. What is the __version__ attribute in a module?
  85. How do you specify a package version in requirements.txt?
  86. What is the extras_require field in setup.py?
  87. How do you install optional dependencies for a package?
  88. What is the entry_points field in setup.py?
  89. How do you create a console script using entry_points?
  90. What is the console_scripts entry point in Python?
  91. How do you test a Python package?
  92. What is the pytest framework for testing modules?
  93. How do you write tests for a Python module?
  94. What is the unittest module in Python?
  95. How do you use unittest to test a module?
  96. What is the doctest module in Python?
  97. How do you write doctests for a module?
  98. What is the difference between unittest and pytest?
  99. How do you mock dependencies in a Python module?
  100. What is the unittest.mock module in Python?

8. Exception Handling (100 Questions)

  1. What is an exception in Python?
  2. How do you handle exceptions in Python?
  3. What is the try-except block in Python?
  4. How do you catch a specific exception in Python?
  5. What is the except clause in Python?
  6. How do you catch multiple exceptions in a single except block?
  7. What is the Exception class in Python?
  8. How do you catch all exceptions in Python?
  9. What is the danger of catching all exceptions?
  10. How do you use the else clause in exception handling?
  11. What is the finally clause in exception handling?
  12. How do you raise an exception in Python?
  13. What is the raise statement in Python?
  14. How do you re-raise an exception in Python?
  15. What is the assert statement in Python?
  16. How do you use assertions for debugging?
  17. What is the difference between assert and raise?
  18. How do you create a custom exception in Python?
  19. What is the BaseException class in Python?
  20. How do you inherit from the Exception class?
  21. What is the ValueError exception in Python?
  22. What is the TypeError exception in Python?
  23. What is the IndexError exception in Python?
  24. What is the KeyError exception in Python?
  25. What is the FileNotFoundError exception in Python?
  26. What is the ZeroDivisionError exception in Python?
  27. What is the AttributeError exception in Python?
  28. What is the ImportError exception in Python?
  29. What is the ModuleNotFoundError exception in Python?
  30. What is the NameError exception in Python?
  31. What is the SyntaxError exception in Python?
  32. What is the IndentationError exception in Python?
  33. What is the TabError exception in Python?
  34. What is the OverflowError exception in Python?
  35. What is the MemoryError exception in Python?
  36. What is the RuntimeError exception in Python?
  37. What is the NotImplementedError exception in Python?
  38. How do you handle NotImplementedError in Python?
  39. What is the StopIteration exception in Python?
  40. How do you handle StopIteration in iterators?
  41. What is the KeyboardInterrupt exception in Python?
  42. How do you handle KeyboardInterrupt in Python?
  43. What is the SystemExit exception in Python?
  44. How do you handle SystemExit in Python?
  45. What is the GeneratorExit exception in Python?
  46. How do you handle GeneratorExit in Python?
  47. What is the OSError exception in Python?
  48. How do you handle OSError in file operations?
  49. What is the IOError exception in Python?
  50. How do you handle IOError in Python?
  51. What is the PermissionError exception in Python?
  52. How do you handle PermissionError in Python?
  53. What is the FileExistsError exception in Python?
  54. How do you handle FileExistsError in Python?
  55. What is the IsADirectoryError exception in Python?
  56. How do you handle IsADirectoryError in Python?
  57. What is the TimeoutError exception in Python?
  58. How do you handle TimeoutError in Python?
  59. What is the ConnectionError exception in Python?
  60. How do you handle ConnectionError in Python?
  61. How do you log exceptions in Python?
  62. What is the logging module in Python?
  63. How do you use logging.exception() to log exceptions?
  64. How do you create a custom exception hierarchy?
  65. What is the try-except-else-finally structure in Python?
  66. How do you handle nested try-except blocks?
  67. What is the traceback module in Python?
  68. How do you use traceback.print_exc() in Python?
  69. How do you get the full traceback of an exception?
  70. What is the sys.exc_info() function in Python?
  71. How do you use sys.exc_info() to handle exceptions?
  72. What is the contextlib module in Python?
  73. How do you use contextlib.suppress() to handle exceptions?
  74. What is the with statement’s role in exception handling?
  75. How do you create a custom context manager for exception handling?
  76. What is the __enter__() method in a context manager?
  77. What is the __exit__() method in a context manager?
  78. How do you handle exceptions in a context manager?
  79. What is the contextlib.contextmanager decorator?
  80. How do you create a context manager using @contextmanager?
  81. How do you handle exceptions in asynchronous code?
  82. What is the try-except block in asynchronous functions?
  83. How do you handle asyncio.TimeoutError in Python?
  84. What is the asyncio.CancelledError exception?
  85. How do you handle asyncio.CancelledError in Python?
  86. How do you debug exceptions in Python?
  87. What is the pdb module in Python?
  88. How do you use pdb.set_trace() to debug exceptions?
  89. What is the ipdb module in Python?
  90. How do you use ipdb for debugging exceptions?
  91. What is the difference between pdb and ipdb?
  92. How do you use try-except with loops?
  93. How do you handle exceptions in recursive functions?
  94. What is exception chaining in Python?
  95. How do you use the from keyword in exception raising?
  96. What is the __cause__ attribute in exceptions?
  97. What is the __context__ attribute in exceptions?
  98. How do you suppress exception context in Python?
  99. What is the raise ... from None syntax in Python?
  100. How do you test exception handling in Python?

9. Functional Programming (100 Questions)

  1. What is functional programming in Python?
  2. How does Python support functional programming?
  3. What is a pure function in functional programming?
  4. How do you write a pure function in Python?
  5. What is immutability in functional programming?
  6. How do you achieve immutability in Python?
  7. What is a first-class function in Python?
  8. How does Python support first-class functions?
  9. What is a higher-order function in Python?
  10. How do you create a higher-order function in Python?
  11. What is the map() function in Python?
  12. How do you use map() in functional programming?
  13. What is the filter() function in Python?
  14. How do you use filter() in functional programming?
  15. What is the reduce() function in Python?
  16. How do you use functools.reduce() in Python?
  17. What is a lambda function in functional programming?
  18. How do you use lambda functions in functional programming?
  19. What is function composition in functional programming?
  20. How do you implement function composition in Python?
  21. What is the operator module in functional programming?
  22. How do you use operator.add() in Python?
  23. What is the itemgetter() function in functional programming?
  24. How do you use itemgetter() in sorting?
  25. What is the attrgetter() function in functional programming?
  26. How do you use attrgetter() in sorting?
  27. What is currying in functional programming?
  28. How do you implement currying in Python?
  29. What is partial application in Python?
  30. How do you use functools.partial() for partial application?
  31. What is a closure in functional programming?
  32. How do you create a closure in Python?
  33. What is memoization in functional programming?
  34. How do you implement memoization in Python?
  35. What is the functools.lru_cache decorator?
  36. How do you use lru_cache for memoization?
  37. What is lazy evaluation in Python?
  38. How do you achieve lazy evaluation in Python?
  39. What is a generator in functional programming?
  40. How do you create a generator function in Python?
  41. What is the yield keyword in functional programming?
  42. How do you use yield from in generators?
  43. What is a generator expression in Python?
  44. How do you create a generator expression?
  45. What is the difference between a generator and a list comprehension?
  46. How do you use generators for lazy evaluation?
  47. What is the itertools module in functional programming?
  48. How do you use itertools.chain() in Python?
  49. What is the itertools.cycle() function?
  50. How do you use itertools.cycle() in Python?
  51. What is the itertools.islice() function?
  52. How do you use itertools.islice() in Python?
  53. What is the itertools.count() function?
  54. How do you use itertools.count() in Python?
  55. What is the itertools.combinations() function?
  56. How do you use itertools.combinations() in Python?
  57. What is the itertools.permutations() function?
  58. How do you use itertools.permutations() in Python?
  59. What is the itertools.product() function?
  60. How do you use itertools.product() in Python?
  61. What is a monad in functional programming?
  62. How do you implement a monad in Python?
  63. What is the Maybe monad in Python?
  64. How do you implement the Maybe monad in Python?
  65. What is the List monad in Python?
  66. How do you implement the List monad in Python?
  67. What is a functor in functional programming?
  68. How do you implement a functor in Python?
  69. What is the map() function’s role in functors?
  70. What is immutability’s role in functional programming?
  71. How do you handle side effects in functional programming?
  72. What is referential transparency in Python?
  73. How do you achieve referential transparency in Python?
  74. What is a pipeline in functional programming?
  75. How do you create a pipeline in Python?
  76. What is the toolz library in Python?
  77. How do you use toolz for functional programming?
  78. What is the fn library in Python?
  79. How do you use fn for functional programming?
  80. What is the pyfunctional library in Python?
  81. How do you use pyfunctional for functional programming?
  82. What is the difference between imperative and functional programming?
  83. How do you combine functional and object-oriented programming in Python?
  84. What is the operator module’s role in functional programming?
  85. How do you use operator.mul() in Python?
  86. What is the compose() function in functional programming?
  87. How do you implement compose() in Python?
  88. What is the pipe() function in functional programming?
  89. How do you implement pipe() in Python?
  90. How do you handle recursion in functional programming?
  91. What is tail recursion in functional programming?
  92. How do you simulate tail recursion in Python?
  93. What is the functools module’s role in functional programming?
  94. How do you use functools.reduce() in functional programming?
  95. What is the itertools.accumulate() function?
  96. How do you use itertools.accumulate() in Python?
  97. How do you handle errors in functional programming?
  98. What is the Result type in functional programming?
  99. How do you implement the Result type in Python?
  100. How do you test functional code in Python?

10. Algorithms and Data Structures (150 Questions)

  1. What is an algorithm in Python?
  2. How do you implement a binary search algorithm in Python?
  3. What is the time complexity of binary search?
  4. How do you implement a linear search algorithm in Python?
  5. What is the time complexity of linear search?
  6. How do you implement a bubble sort algorithm in Python?
  7. What is the time complexity of bubble sort?
  8. How do you implement a selection sort algorithm in Python?
  9. What is the time complexity of selection sort?
  10. How do you implement an insertion sort algorithm in Python?
  11. What is the time complexity of insertion sort?
  12. How do you implement a merge sort algorithm in Python?
  13. What is the time complexity of merge sort?
  14. How do you implement a quicksort algorithm in Python?
  15. What is the time complexity of quicksort?
  16. How do you implement a heap sort algorithm in Python?
  17. What is the time complexity of heap sort?
  18. How do you implement a counting sort algorithm in Python?
  19. What is the time complexity of counting sort?
  20. How do you implement a radix sort algorithm in Python?
  21. What is the time complexity of radix sort?
  22. How do you implement a bucket sort algorithm in Python?
  23. What is the time complexity of bucket sort?
  24. What is a sorting algorithm’s stability?
  25. Which sorting algorithms are stable in Python?
  26. How do you implement a depth-first search (DFS) in Python?
  27. What is the time complexity of DFS?
  28. How do you implement a breadth-first search (BFS) in Python?
  29. What is the time complexity of BFS?
  30. How do you implement Dijkstra’s algorithm in Python?
  31. What is the time complexity of Dijkstra’s algorithm?
  32. How do you implement a Bellman-Ford algorithm in Python?
  33. What is the time complexity of Bellman-Ford?
  34. How do you implement a Floyd-Warshall algorithm in Python?
  35. What is the time complexity of Floyd-Warshall?
  36. How do you implement a Kruskal’s algorithm in Python?
  37. What is the time complexity of Kruskal’s algorithm?
  38. How do you implement a Prim’s algorithm in Python?
  39. What is the time complexity of Prim’s algorithm?
  40. How do you implement a topological sort in Python?
  41. What is the time complexity of topological sort?
  42. How do you implement a binary search tree (BST) in Python?
  43. What is the time complexity of BST operations?
  44. How do you implement an AVL tree in Python?
  45. What is the time complexity of AVL tree operations?
  46. How do you implement a red-black tree in Python?
  47. What is the time complexity of red-black tree operations?
  48. How do you implement a trie in Python?
  49. What is the time complexity of trie operations?
  50. How do you implement a hash table in Python?
  51. What is the time complexity of hash table operations?
  52. How do you handle collisions in a hash table?
  53. What is open addressing in hash tables?
  54. What is separate chaining in hash tables?
  55. How do you implement a stack in Python?
  56. What is the time complexity of stack operations?
  57. How do you implement a queue in Python?
  58. What is the time complexity of queue operations?
  59. How do you implement a deque in Python?
  60. What is the time complexity of deque operations?
  61. How do you implement a priority queue in Python?
  62. What is the time complexity of priority queue operations?
  63. How do you implement a linked list in Python?
  64. What is the time complexity of linked list operations?
  65. How do you implement a doubly linked list in Python?
  66. What is the time complexity of doubly linked list operations?
  67. How do you implement a circular linked list in Python?
  68. What is the time complexity of circular linked list operations?
  69. How do you reverse a linked list in Python?
  70. What is the time complexity of reversing a linked list?
  71. How do you detect a cycle in a linked list?
  72. What is Floyd’s cycle detection algorithm?
  73. How do you implement Floyd’s cycle detection in Python?
  74. How do you find the middle of a linked list?
  75. How do you merge two sorted linked lists?
  76. What is the time complexity of merging two linked lists?
  77. How do you implement a binary heap in Python?
  78. What is the time complexity of binary heap operations?
  79. How do you implement a min-heap in Python?
  80. How do you implement a max-heap in Python?
  81. How do you implement a Fibonacci heap in Python?
  82. What is the time complexity of Fibonacci heap operations?
  83. How do you implement a disjoint set (union-find) in Python?
  84. What is the time complexity of union-find operations?
  85. How do you implement a graph in Python?
  86. What is an adjacency list in a graph?
  87. What is an adjacency matrix in a graph?
  88. How do you implement a weighted graph in Python?
  89. How do you implement a directed graph in Python?
  90. How do you implement an undirected graph in Python?
  91. How do you find the shortest path in a graph?
  92. How do you detect a cycle in a graph?
  93. How do you implement a minimum spanning tree in Python?
  94. What is the difference between DFS and BFS?
  95. How do you implement a dynamic programming solution in Python?
  96. What is the knapsack problem, and how do you solve it in Python?
  97. What is the longest common subsequence problem?
  98. How do you solve the longest common subsequence in Python?
  99. What is the edit distance problem in Python?
  100. How do you solve the edit distance problem in Python?
  101. What is the coin change problem in Python?
  102. How do you solve the coin change problem in Python?
  103. What is the matrix chain multiplication problem?
  104. How do you solve matrix chain multiplication in Python?
  105. What is the longest increasing subsequence problem?
  106. How do you solve the longest increasing subsequence in Python?
  107. What is the subset sum problem in Python?
  108. How do you solve the subset sum problem in Python?
  109. What is a greedy algorithm in Python?
  110. How do you implement a greedy algorithm in Python?
  111. What is Huffman coding, and how do you implement it in Python?
  112. What is the activity selection problem?
  113. How do you solve the activity selection problem in Python?
  114. What is the fractional knapsack problem?
  115. How do you solve the fractional knapsack problem in Python?
  116. What is a backtracking algorithm in Python?
  117. How do you implement a backtracking algorithm in Python?
  118. What is the N-Queens problem in Python?
  119. How do you solve the N-Queens problem in Python?
  120. What is the Sudoku solver problem?
  121. How do you implement a Sudoku solver in Python?
  122. What is the graph coloring problem?
  123. How do you solve the graph coloring problem in Python?
  124. What is the traveling salesman problem (TSP)?
  125. How do you solve the TSP in Python?
  126. What is a divide-and-conquer algorithm in Python?
  127. How do you implement a divide-and-conquer algorithm in Python?
  128. What is the closest pair of points problem?
  129. How do you solve the closest pair of points in Python?
  130. What is the convex hull problem?
  131. How do you solve the convex hull problem in Python?
  132. What is the line sweep algorithm in Python?
  133. How do you implement a line sweep algorithm in Python?
  134. What is the KMP algorithm in Python?
  135. How do you implement the KMP algorithm in Python?
  136. What is the Rabin-Karp algorithm in Python?
  137. How do you implement the Rabin-Karp algorithm in Python?
  138. What is the Boyer-Moore algorithm in Python?
  139. How do you implement the Boyer-Moore algorithm in Python?
  140. What is the A* algorithm in Python?
  141. How do you implement the A* algorithm in Python?
  142. What is the time complexity of the A* algorithm?
  143. What is a heuristic function in the A* algorithm?
  144. How do you design a heuristic function for A*?
  145. What is the difference between A* and Dijkstra’s algorithm?
  146. How do you implement a trie for string searching?
  147. What is the time complexity of trie operations?
  148. How do you implement a suffix tree