Python DS Questions
Python DS Questions
PYTHON
1. What are Python's basic data types? Explain mutable vs immutable types.
2. How do you handle exceptions in Python? Explain try-except blocks.
3. What is the difference between lists and tuples?
4. Explain list comprehensions with an example.
5. How do you handle file operations in Python?
6. What are lambda functions? Provide an example.
7. How do you remove duplicates from a list?
8. What is the difference between '==' and 'is' operators?
9. How do you create and use dictionaries in Python?
10. Explain string formatting methods in Python.
11. What are Python modules and packages?
12. How do you use the map() and filter() functions?
13. What is the difference between append() and extend()?
14. How do you handle missing values in Python?
15. Explain Python's garbage collection mechanism.
16. What are Python decorators?
17. How do you use the zip() function?
18. Explain Python's slicing notation.
19. What is the difference between deep copy and shallow copy?
20. What are generators and iterators?
21. Explain context managers and the 'with' statement.
22. How do you optimize Python code for performance?
23. How do you implement method overriding in Python?
24. Explain Python's memory management.
25. Explain property decorators in Python.
26. How do you create a function in Python? Provide an example.
27. What is the purpose of the len() function in Python?
28. How can you merge two dictionaries in Python?
29. What is a lambda function in Python? Provide an example.
30. What is a DataFrame in Pandas?
31. How do you create a simple line plot using Matplotlib? Provide an example.
32. Explain how to create a box plot using Seaborn and what it represents.
33. What is the purpose of the groupby() function in Pandas?
34. How do you create a simple test case using Pytest? Provide an example.
35. Explain list slicing and provide an example.
36. What is a generator in Python, and how does it differ from a regular function?
Data Science & AI Bootcamp – Interview Question Bank
37. What is an API in the context of Python programming?
38. What is the purpose of the logging module in Python?
39. What is Pydantic used for in Python applications?
40. How can you log messages with different severity levels using the logging module?