Top Python Interview Questions for MNCs (Basic
to Advanced)
Comprehensive Python interview preparation guide covering basic, intermediate, and advanced
topics commonly asked in MNCs like TCS, Infosys, Wipro, Accenture, IBM, and Capgemini.
Basic Python Questions
1. What are Python’s key features?
2. What are Python’s data types?
3. What is the difference between Python 2 and Python 3?
4. What is indentation and why is it important in Python?
5. What is the difference between a list, tuple, and set?
6. What is a dictionary in Python?
7. Explain mutable and immutable data types with examples.
8. What is the use of the ‘is’ and ‘==’ operators?
9. What are Python’s built-in data structures?
10. What is PEP 8 and why is it important?
Intermediate Python Questions
11. What is a lambda function?
12. What are list, set, and dictionary comprehensions?
13. Explain *args and **kwargs with examples.
14. What are modules and packages in Python?
15. Explain the difference between shallow copy and deep copy.
16. What are decorators in Python?
17. What is the difference between @staticmethod, @classmethod, and instance method?
18. What is inheritance and polymorphism?
19. What is the purpose of __init__() in a class?
20. How do you handle exceptions in Python?
Advanced Python Questions
21. What is the Global Interpreter Lock (GIL)?
22. What are generators and iterators in Python?
23. Explain Python’s garbage collection mechanism.
24. How is memory managed in Python?
25. What is monkey patching in Python?
26. What are metaclasses?
27. How does Python implement multithreading and multiprocessing?
28. What are coroutines in Python?
29. What are context managers and how are they implemented?
30. What is the difference between deepcopy() and copy()?
File Handling and Modules
31. How do you open, read, and write a file in Python?
32. What are JSON and Pickle modules used for?
33. How do you handle CSV files in Python?
34. How do you read and write Excel files in Python?
35. How do you import a module and what is __name__ == '__main__'?
Coding and Logic Questions
36. Write a Python program to reverse a string.
37. Write a Python program to check if a number is prime.
38. Write a Python program to find factorial using recursion.
39. Write a Python program to find the second largest number in a list.
40. Write a Python program to find duplicates in a list.
41. Write a Python program to check if a string is a palindrome.
42. Write a Python program to print Fibonacci series up to n terms.
43. Write a Python program to sort a dictionary by value.
44. Write a Python program to merge two dictionaries.
45. Write a Python program to count vowels in a string.
Practical and Real-world Questions
46. How do you connect Python to a MySQL or SQLite database?
47. What are commonly used Python libraries for data analysis and machine learning?
48. How do you handle API calls in Python?
49. How can you optimize Python code for performance?
50. What are Python virtual environments and why are they used?
51. What is Flask? How is it different from Django?
52. How do you write unit tests in Python?
53. How do you deploy a Python web application?
54. What is the difference between NumPy arrays and Python lists?
55. How do you serialize data in Python?
Data Science and ML Related
56. What is the use of NumPy and Pandas in Python?
57. What is the difference between loc[] and iloc[] in Pandas?
58. How do you handle missing values in Pandas?
59. What are lambda functions and how are they used in data manipulation?
60. How is Python used in Machine Learning projects?
61. Explain broadcasting in NumPy.
62. How do you visualize data using Matplotlib or Seaborn?
63. What is the use of Scikit-learn?
64. How do you load a dataset from CSV in Pandas?
65. How do you group and aggregate data in Pandas?
End of Document
This document is designed to help you prepare for Python interviews at top MNCs. Practice coding
daily and focus on explaining your thought process clearly in interviews.