JavaScript
Python
Java
React
Sorting Visualizer
Complexity Analyzer
Coding Patterns
1. Fundamentals
1.1. `print()` Function
1.2. Variables and Types
1.3. f-Strings
1.4. Arithmetic Operators
1.5. Logical Operators
1.6. Conditional Statements
1.7. `for` Loops
1.8. `while` Loops
1.9. `pass`, `continue`, `break`
1.10. User Input
2. Data Structures: Lists & Tuples
2.1. Lists: Creation
2.2. List Methods
2.3. Slicing Sequences
2.4. List Comprehensions
2.5. Conditional List Comprehensions
2.6. Tuples: Creation
2.7. Tuple Unpacking
2.8. Single-Item Tuples
2.9. Lists vs. Tuples
2.10. Identity vs. Equality (`is` vs. `==`)
3. Data Structures: Dictionaries & Sets
3.1. Dictionaries: Creation
3.2. Dictionary Methods
3.3. Iterating Dictionaries
3.4. Dictionary Comprehensions
3.5. Merging Dictionaries
3.6. Sets: Creation
3.7. Set Methods
3.8. Set Operations
3.9. Set Comprehensions
3.10. `frozenset`
4. Functions & Scope
4.1. Defining Functions
4.2. Positional & Keyword Arguments
4.3. Default Argument Values
4.4. Mutable Default Argument Pitfall
4.5. `*args` and `**kwargs`
4.6. Lambda (Anonymous) Functions
4.7. LEGB Scope Rule
4.8. The `global` Keyword
4.9. The `nonlocal` Keyword
4.10. Docstrings
5. Functional Programming
5.1. `map()` Function
5.2. `filter()` Function
5.3. `functools.reduce()`
5.4. Decorators
5.5. Generators and `yield`
5.6. Generator Expressions
5.7. `itertools.cycle`
5.8. `itertools.combinations`
5.9. `any()` and `all()`
5.10. `sorted()` with a `key`
6. Object-Oriented Programming (OOP)
6.1. Classes and `__init__`
6.2. Instance Methods
6.3. Class vs. Instance Attributes
6.4. Inheritance
6.5. The `super()` Function
6.6. Multiple Inheritance
6.7. Dunder Method: `__str__`
6.8. Dunder Method: `__repr__`
6.9. Dunder Method: `__len__`
6.10. Dunder Method: `__eq__`
7. Advanced OOP
7.1. `@property` Decorator
7.2. Property Setters
7.3. `@classmethod`
7.4. `@staticmethod`
7.5. "Private" Attributes
7.6. `__slots__`
7.7. `dataclasses` Module
7.8. Abstract Base Classes (ABCs)
7.9. The `__new__` Method
7.10. Descriptors
8. Files & Error Handling
8.1. `try...except` Blocks
8.2. Catching the Exception Object
8.3. The `else` Block
8.4. The `finally` Block
8.5. Raising Exceptions
8.6. Custom Exceptions
8.7. Reading Files with `with`
8.8. Writing to Files
8.9. Context Managers
8.10. EAFP vs. LBYL
9. Standard Library
9.1. `os` Module
9.2. `sys` Module
9.3. `datetime` Module
9.4. `json` Module
9.5. `math` Module
9.6. `random` Module
9.7. Regular Expressions (`re` module)
9.8. `collections.Counter`
9.9. `collections.defaultdict`
9.10. `pathlib` Module
10. Advanced Concepts
10.1. Type Hinting
10.2. Shallow vs. Deep Copy
10.3. The GIL (Global Interpreter Lock)
10.4. `threading` Module
10.5. `multiprocessing` Module
10.6. `asyncio` for Asynchronous I/O
10.7. `async` and `await`
10.8. Walrus Operator `:=`
10.9. Positional-Only Arguments
10.10. Keyword-Only Arguments
Interview Questions
1. What is the GIL and how does it affect Python concurrency?
2. What is the difference between a list and a tuple?
3. What are decorators in Python?
4. What is a generator?
5. What is the issue with using a mutable object as a default function argument?
6. What is the LEGB rule for scope resolution?
7. What is the difference between `is` and `==`?
8. What is the difference between a shallow copy and a deep copy?
9. What are dunder (magic) methods?
10. How do you create list, dict, and set comprehensions?
11. What is the `with` statement used for?
12. Explain `*args` and `**kwargs`.
13. Is Python a statically typed or dynamically typed language?
14. Explain how arguments are passed in Python.
15. Are strings in Python mutable or immutable?
16. How does slicing work?
17. What is the difference between `__init__` and `__new__`?
18. Explain the difference between `__repr__` and `__str__`.
19. How does memory management work in Python?
20. What are lambda functions?
21. What is pip?
22. What are virtual environments and why are they used?
23. What is MRO in Python?
24. How does `super()` work?
25. What is monkey patching?
26. What is the difference between a static method and a class method?
27. Does Python enforce type hints?
28. What does negative indexing for a sequence mean?
29. What is `asyncio` used for?
30. What methods must an object have to be a context manager?
31. What methods are required for an object to be an iterator?
32. What is pickling and unpickling?
33. What is the walrus operator `:=`?
34. What is the output of this code?
35. Is Python an interpreted or compiled language?
36. What is PEP 8?
37. What is the `pass` statement?
38. What is the `@property` decorator?
39. What makes an object "hashable"?
40. When would you use `threading` vs. `multiprocessing`?
41. What is string interning?
42. What is `__slots__`?
43. What is the difference between an iterator and an iterable?
44. What are docstrings?
45. How can you merge two dictionaries?
46. What was `xrange` in Python 2?
47. What is the output?
48. What is duck typing?
49. What are descriptors?
50. What is Cython?
51. What are Abstract Base Classes (ABCs)?
52. What is the purpose of the `else` block in a `try/except` statement?
53. What does this code output?
54. What is the output of this code?
55. What does this print?
56. How do you fix the previous lambda loop issue?
57. What does `f"{my_var=}"` do?
58. How do you create a tuple with a single item?
59. What does it mean that functions are "first-class citizens" in Python?
60. What is the difference between a module and a package?
61. What is the Zen of Python?
62. Are exceptions expensive?
63. Explain EAFP vs. LBYL coding styles.
64. Explain the `global` and `nonlocal` keywords.
65. What is the output?
66. Name a key difference between Python 2 and Python 3.
67. What is the output?
68. What are the different ways to format strings in Python?
69. What will this code do?
70. How do you create "private" attributes in a Python class?
71. How can you reverse a list?
72. What is the output?
73. What is the output of this code?
74. What is the output of this?
75. How can you remove duplicates from a list?
76. What is the output of this?
77. What is `collections.Counter`?
78. What is `collections.deque` used for?
79. Give an example of using the `itertools` module.
80. What is printed?
81. When would you use an Enum?
82. What is the output?
83. What are positional-only arguments?
84. What is the output of this?
85. What is the output?
86. What is the output?
87. What does this code print?
88. What is the output?
89. What is the output?
90. What will be printed?
91. What is the output?
92. What will be printed?
93. What is the output?
94. What is the output?
95. What does this code print?
96. What is the output?
97. What is the output?
98. What is the output?
99. What does this code print?
100. What is the output?
Toggle Sidebar
Code Playground
Loading Terminal...