1. What is Python?

Python is a high-level, interpreted, object-oriented programming language known for its simplicity and readability.

2. What are advanced topics in Python?

Advanced topics include OOP concepts, decorators, generators, iterators, multithreading, multiprocessing,
memory management, context managers, metaclasses, and more.

3. What is Object-Oriented Programming (OOP)?

OOP is a programming paradigm based on objects and classes that contain data and methods.

4. What are the main principles of OOP?

  • Encapsulation
  • Abstraction
  • Inheritance
  • Polymorphism

5. What is encapsulation?

Encapsulation means binding data and methods together and restricting direct access to some components.

6. What is abstraction?

Abstraction hides internal implementation and shows only essential features.

7. What is inheritance?

Inheritance allows one class to inherit properties of another class.

8. What is polymorphism?

Polymorphism allows methods to behave differently based on object.

9. What is method overloading?

Python does not support traditional method overloading but can achieve similar behavior using default arguments.

10. What is method overriding?

Method overriding occurs when child class redefines parent class method.

11. What is a decorator?

Decorator is a function that modifies behavior of another function.

12. Example of decorator:

def decorator(func):
def wrapper():
print("Before function")
func()
print("After function")
return wrapper

13. What is a generator?

Generator is a function that returns an iterator using yield keyword.

14. Why use generators?

Generators save memory by generating values one at a time.

15. What is yield keyword?

Yield pauses function execution and returns value.

16. What is an iterator?

Iterator is an object that implements __iter__() and __next__() methods.

17. Difference between iterator and iterable?

Iterable can be looped over, iterator produces next value.

18. What is lambda function?

Lambda is an anonymous function.

19. Syntax of lambda:

lambda arguments: expression

20. What is map() function?

map() applies function to all items in iterable.

21. What is filter()?

filter() filters items based on condition.

22. What is reduce()?

reduce() applies function cumulatively.

23. What is list comprehension?

Compact way to create list.

24. What is dictionary comprehension?

Compact way to create dictionary.

25. What is set comprehension?

Compact way to create set.

26. What is multithreading?

Multithreading allows multiple threads to run concurrently.

27. What is multiprocessing?

Multiprocessing runs processes in parallel.

28. Difference between thread and process?

  • Thread shares memory
  • Process has separate memory

29. What is GIL?

Global Interpreter Lock allows only one thread to execute Python bytecode at a time.

30. Why multiprocessing preferred for CPU tasks?

Because GIL limits threads in CPU-bound tasks.

31. What is exception handling?

Handling runtime errors using try, except.

32. What is finally block?

finally executes always.

33. What is custom exception?

User-defined exception class.

34. What is context manager?

Manages resources using with statement.

35. What are dunder methods?

Special methods like __init__, __str__.

36. What is __init__ method?

Constructor method.

37. What is __str__?

Returns string representation.

38. What is __repr__?

Returns official string representation.

39. What is shallow copy?

Copies object but not nested objects.

40. What is deep copy?

Copies object and nested objects.

41. What is memory management in Python?

Python uses automatic garbage collection.

42. What is garbage collection?

Removes unused objects from memory.

43. What is reference counting?

Counts references to object.

44. What is module?

File containing Python code.

45. What is package?

Collection of modules.

46. What is a virtual environment in Python?

A virtual environment is an isolated environment that allows developers to install packages
separately for different projects without conflicts.

47. Why is virtual environment important?

It prevents dependency conflicts between projects and keeps project requirements isolated.

48. What is pip?

pip is Pythonโ€™s package installer used to install and manage third-party libraries.

49. What is asyncio?

Asyncio is a Python library used to write concurrent code using async and await keywords.

50. What is coroutine?

A coroutine is a special function defined using async that can pause execution using await.

51. Difference between synchronous and asynchronous programming?

  • Synchronous executes one task at a time.
  • Asynchronous allows multiple tasks to run without waiting.

52. What is event loop?

Event loop manages execution of asynchronous tasks in asyncio.

53. What is thread synchronization?

Thread synchronization ensures that multiple threads do not access shared resources simultaneously.

54. What is Lock in threading?

Lock prevents multiple threads from executing critical section at same time.

55. What is Semaphore?

Semaphore controls access to shared resource by multiple threads.

56. What is socket programming?

Socket programming enables communication between devices over network.

57. What is REST API?

REST API allows communication between client and server using HTTP methods.

58. What is unit testing?

Unit testing checks individual components of program using testing frameworks like unittest.

59. What is logging module?

Logging module records events for debugging and monitoring.

60. What is regular expression?

Regular expression (regex) is used for pattern matching in strings.

61. What is metaclass?

Metaclass is a class that defines behavior of another class.

62. What is descriptor?

Descriptor is object attribute with binding behavior using __get__, __set__, __delete__ methods.

63. What is monkey patching?

Monkey patching modifies class or module at runtime.

64. What is dataclass?

Dataclass automatically generates special methods like __init__ and __repr__.

65. What are type hints?

Type hints specify expected data types for better readability and static checking.

66. What is PEP?

PEP stands for Python Enhancement Proposal, which describes new features or guidelines.

67. What is PEP 8?

PEP 8 is coding style guide for Python.

68. What is Python internals?

Python internals refer to working of Python interpreter and memory model.

69. What is bytecode?

Bytecode is intermediate code generated by Python interpreter.

70. What is performance optimization?

Improving speed and efficiency of Python programs.

71. What is profiling?

Profiling measures performance and identifies bottlenecks.

72. What is caching?

Caching stores frequently used data for faster access.

73. What is LRU cache?

Least Recently Used cache removes least recently used items first.

74. What is memory leak?

Memory leak occurs when memory is not released properly.

75. What is generator expression?

Generator expression creates generator using compact syntax.

76. What is functional programming?

Functional programming focuses on pure functions and immutability.

77. What is immutability?

Immutability means object cannot be modified after creation.

78. What is namedtuple?

Namedtuple creates tuple with named fields.

79. What is slots in Python?

__slots__ restricts dynamic creation of attributes to save memory.

80. What is introspection?

Introspection allows inspecting object properties at runtime.

81. What is reflection?

Reflection allows modifying program structure at runtime.

82. What is dynamic typing?

Dynamic typing means variable type determined at runtime.

83. What is duck typing?

Duck typing means object behavior determines type rather than class.

84. What is serialization?

Serialization converts object into storable format.

85. What is deserialization?

Deserialization restores object from stored format.

86. What is dependency injection?

Dependency injection provides required objects from outside rather than creating internally.

87. What is SOLID principle?

SOLID principles are design guidelines for writing maintainable code.

88. What is MVC architecture?

MVC divides application into Model, View, Controller.

89. What is threading module?

Threading module allows multi-threaded programs.

90. What is multiprocessing module?

Multiprocessing module enables parallel execution.

91. What is queue module?

Queue module provides thread-safe data structure.

92. What is heapq?

heapq provides heap queue algorithm.

93. What is bisect module?

bisect helps in binary search operations.

94. What is weak reference?

Weak reference does not increase reference count.

95. What is ABC module?

ABC module provides abstract base classes.

96. What is asyncio task?

Asyncio task schedules coroutine for execution.

97. What is thread pool?

Thread pool manages group of threads.

98. What is process pool?

Process pool manages group of processes.

99. What is context switching?

Switching CPU from one task to another.

100. Why advanced Python is important?

Advanced Python knowledge is essential for building scalable applications,
handling concurrency, optimizing performance, and clearing technical interviews.

๐Ÿ“ข Join Our WhatsApp Channel

๐Ÿ’ผ Get Daily IT Job Updates, Interview Preparation Tips & Instant Alerts directly on WhatsApp.

๐Ÿ‘‰ Join WhatsApp Now

๐Ÿ“ข Join Our Telegram Channel

๐Ÿ’ผ Get Daily IT Job Updates, Interview Tips & Exclusive Alerts directly on Telegram!

๐Ÿ‘‰ Join Telegram

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright ยฉ 2022 - 2025 itfreesource.com

Enable Notifications OK No thanks