Python Interview Questions (15)
1. Explain mutable and immutable objects with examples.
2. What is the difference between a list, tuple, set, and dictionary? When would you use
each?
3. Explain *args and **kwargs. Where would you use them in real projects?
4. What is the difference between shallow copy and deep copy? Explain with an example.
5. Explain Python's memory management. What are reference counting and garbage
collection?
6. What is the Global Interpreter Lock (GIL)? Why doesn't multithreading improve CPU-
bound applications?
7. Compare threading, multiprocessing, and asyncio. When would you choose each?
8. What happens internally when Python imports a module?
9. How are Python dictionaries implemented? What happens during a hash collision?
10. What are iterators, iterables, and generators? Explain the differences with examples.
Coding Questions
11. Group Anagrams: Given a list of strings, group all anagrams together.
12. Find Duplicate Files: Given a list of filenames, print duplicate filenames with their
occurrence count.
13. Log File Analyzer: Count INFO, WARN, and ERROR entries from a log file.
14. Find Missing Employee IDs: Given a sorted list of employee IDs, print all missing IDs.
15. Top 5 Most Frequent Words: Read a text file and print the top five most frequent words