Python Basics
1. What is Python, and why is it widely used in data science?
2. What are the differences between Python 2 and Python 3?
3. How does Python handle memory management?
4. What is the difference between list and tuple in Python?
5. What are the different data types in Python?
6. How do you define a function in Python? Provide an example.
7. What is the purpose of the self keyword in Python?
8. Explain the concept of list comprehension in Python.
9. How does Python handle exceptions? Provide an example of handling exceptions.
10. What is the difference between deepcopy() and shallow copy() in Python?
11. How do you create and use a lambda function in Python?
12. What is the difference between is and == in Python?
13. How can you check if a number is prime in Python?
14. What is the difference between range() and xrange() in Python?
15. How do you iterate over a dictionary in Python?
Intermediate Python
16. What is a generator in Python, and how is it different from a function that returns a list?
17. How do you handle missing values in Python?
18. Explain decorators in Python. Provide an example.
19. What is the purpose of the with statement in Python? Give an example.
20. What are Python modules and packages? How do you import them?
21. What is the purpose of *args and **kwargs in Python functions?
22. How would you remove duplicates from a list in Python?
23. How do you reverse a string in Python?
24. Explain the difference between immutable and mutable types in Python.
25. How can you check if a key exists in a dictionary?
26. What are list comprehensions and how are they different from map()?
27. How do you merge two dictionaries in Python?
28. How do you sort a list in Python? What are the options for sorting in reverse?
29. How would you find the largest and smallest elements in a list?
30. What are iterators and iterable objects in Python?
Advanced Python
31. What is the Global Interpreter Lock (GIL) in Python, and how does it affect concurrency?
32. Explain the @staticmethod and @classmethod decorators in Python.
33. How do you implement multithreading and multiprocessing in Python? What are their
differences?
34. What are regular expressions in Python? How would you match a pattern in a string?
35. What is the purpose of yield in Python? Provide an example.
36. How do you manage memory in Python, and what are memory leaks?
37. What is the map() function in Python? How is it different from a list comprehension?
38. Explain the concept of functional programming in Python. Provide an example.
39. How do you debug a Python script? What tools or techniques do you use?
40. What is the purpose of __init__() in Python classes?
41. Explain the concept of Duck typing in Python.
42. What is a singleton pattern in Python? How do you implement it?
43. How do you handle file I/O in Python? Provide an example of reading and writing to a file.
44. What are monitors in Python, and how are they used in concurrent programming?
45. Explain the differences between Python’s str and repr functions.
Data Handling & Manipulation
46. What is Pandas in Python, and how do you use it for data analysis?
47. How do you load a CSV file into a Pandas DataFrame?
48. How do you remove missing values from a Pandas DataFrame?
49. How would you filter rows based on a condition in a Pandas DataFrame?
50. What is groupby in Pandas, and how would you apply it to aggregate data?
51. How do you merge two DataFrames in Pandas?
52. What is the difference between loc[] and iloc[] in Pandas?
53. How do you apply a function to each row in a Pandas DataFrame?
54. How would you convert a column in a DataFrame to a specific data type?
55. How do you drop columns or rows from a Pandas DataFrame?
56. Explain the concept of pivot tables in Pandas.
57. How do you calculate moving averages in Pandas?
58. How would you handle categorical data in Pandas?
59. How do you perform data reshaping in Pandas using melt and pivot functions?
60. What are missing values in Pandas, and how would you handle them?
Data Visualization
61. What is Matplotlib, and how do you create basic plots with it?
62. How would you create a histogram using Matplotlib?
63. How do you customize the axis and labels in Matplotlib?
64. What is the purpose of Seaborn in Python, and how is it different from Matplotlib?
65. How do you create a heatmap in Seaborn?
66. Explain how to plot a correlation matrix in Seaborn.
67. What is Plotly, and how does it differ from Matplotlib and Seaborn?
68. How do you add interactive plots using Plotly in Python?
69. What are subplots in Matplotlib, and how do you use them?
70. How do you visualize missing data in a dataset using Python?
Machine Learning & Data Science
71. What is the difference between supervised and unsupervised learning?
72. Explain the train-test split in machine learning.
73. How do you handle overfitting in machine learning models?
74. What are the different types of machine learning algorithms? Provide examples.
75. How does a decision tree work? What are its advantages and disadvantages?
76. What is cross-validation, and why is it important?
77. What is regularization, and how does it help in improving models?
78. Explain the concept of gradient descent and its variants.
79. How do you evaluate the performance of a machine learning model?
80. What is the Random Forest algorithm, and how does it work?
81. What are SVMs (Support Vector Machines), and how are they used in classification?
82. How does the k-means clustering algorithm work?
83. What are principal component analysis (PCA) and its use in data science?
84. How would you handle class imbalance in classification tasks?
85. What is the bias-variance tradeoff?
86. What is logistic regression, and when would you use it?
87. What is XGBoost, and why is it preferred for certain types of problems?
88. How does a Naive Bayes classifier work?
89. What is k-fold cross-validation, and why is it used?
90. Explain how feature selection works in machine learning.
Advanced Topics
91. How do you implement deep learning models using TensorFlow or Keras?
92. Explain the difference between classification and regression tasks.
93. How does Natural Language Processing (NLP) work in Python?
94. How would you implement a neural network in Python?
95. What is hyperparameter tuning, and how do you perform it in Python?
96. Explain the difference between batch and online learning.
97. What is the train-validation-test split in machine learning?
98. How does the Adam optimizer work in deep learning?
99. What is the purpose of backpropagation in training neural networks?
100. How do you handle outliers in a dataset in Python?