I know it's not really what you're looking for be it's my opinion: projects. You should practice using something in a situation where it is relevant. OOP shines best in complicated programs with a certain complexity/intricacy, or to simplify the code you're writing. Exercises don't help practice that because they tend to be short. In python, you'll almost never have to write over 50 lines for a simple exercise. Let alone 200, and that's about the length where turning to OOP starts being advantageous. So find yourself a project. It doesn't even have to be explicitly object oriented: a game, a simulation, things with entities in general beg for OOP, but it can be used anywhere. On this sub, I once proposed a implementation of rock-paper-scissors using a class. The point is to make something, and at some point to use OOP to simplify it. This may be at the very start, or later, when you find that your code is very copy pasty and you use classes to reduce that. You may even revisit an older project and try to rewrite it with OOP, maybe expand upon it. The important thing is to dive into something and get working on it. It may be 150 lines or 700. The point is you'll only be able to do it if you know OOP: if it feels easy and intuitive, then you're good, otherwise, keep going. That will get you the practice you want: a real application of the concepts you learn. Answer from themateo713 on reddit.com
🌐
Reddit
reddit.com › r/learnpython › where can i find problems to practice oop?
r/learnpython on Reddit: Where can I find problems to practice OOP?
August 26, 2020 -

Here's what I have tried so far: Codewars - The problems labelled classes were either too complex to understand for me, or I found no actual need for implementing OOPS. None of the problems required you to create a class anyways.

Hackerrank - Just two problems in the OOP/ classes section ( don't remember what they exactly call them) and they two were hard math problems, so I need to first of all understand the complex maths concepts before I can get to programming.

Leetcode - Can't actually filter out problems based on OOP.

Top answer
1 of 21
80
I know it's not really what you're looking for be it's my opinion: projects. You should practice using something in a situation where it is relevant. OOP shines best in complicated programs with a certain complexity/intricacy, or to simplify the code you're writing. Exercises don't help practice that because they tend to be short. In python, you'll almost never have to write over 50 lines for a simple exercise. Let alone 200, and that's about the length where turning to OOP starts being advantageous. So find yourself a project. It doesn't even have to be explicitly object oriented: a game, a simulation, things with entities in general beg for OOP, but it can be used anywhere. On this sub, I once proposed a implementation of rock-paper-scissors using a class. The point is to make something, and at some point to use OOP to simplify it. This may be at the very start, or later, when you find that your code is very copy pasty and you use classes to reduce that. You may even revisit an older project and try to rewrite it with OOP, maybe expand upon it. The important thing is to dive into something and get working on it. It may be 150 lines or 700. The point is you'll only be able to do it if you know OOP: if it feels easy and intuitive, then you're good, otherwise, keep going. That will get you the practice you want: a real application of the concepts you learn.
2 of 21
28
Congrats! You now know enough to be dangerous. As others have suggested: search for beginner python projects if you're not yet sure what you want to create. Another general suggestion that I wish someone had given to me after I could grok the basics of OOP is: start becoming familiar with OOP 'design patterns'. There's lots of examples for basic patterns (lookup factory, builder or facade patterns). Sometimes you will find examples that include actual code and other times you may find conceptual descriptions that accompany UML diagrams for a toy example. refactoring.guru has a nicely organized site to browse around. The site map provides a nice orientation to design patterns in general and in the Code Examples section in the sidebar, you can find python-specific implementations . IMO, learning about how different things may be constructed out of OOP concepts will be hugely helpful for developing proficiency. When starting out with OOP, it's tempting to shove everything into a class without thinking about it too much -- and most of the stuff you encounter when starting out is simple enough that there's typically no dire consequences that challenge you to re-think your design. But there's a lot of clever ways to construct classes to accomplish goals and being able to recognize them will pay huge dividends in the future. Other suggestions: get comfortable with debuggers and breakpoints if you're not already familiar. It will make it so much easier to step through issues when you don't have to print("everything") just to inspect state. Lastly, look up "TDD" if you're not already familiar with the idea of writing tests. I'm not suggesting that you become too preoccupied with writing tests right away but once you begin to create more complicated projects, you may appreciate why "debugging sucks; testing rocks." TLDR: I wish that I had a larger vocabulary/proficiency for design patterns when starting out. You won't immediately need to know how to write tests or implement design patterns but becoming familiar with these ideas and embracing them early on will help you immensely down the road.
Discussions

Why does LeetCode use solution class? Does the class ever help?
This is LeetCode question #1. I was wondering why LeetCode likes to use a solution class. I reformat the solution to a function without a class and call it: def twoSum2(nums, target): hashmap = {} for i in range(len(nums)): complement = target - nums[i] if complement in hashmap: return [i, ... More on discuss.python.org
🌐 discuss.python.org
0
February 24, 2022
OOP
Search for books and videos with keywords like "object oriented programming guide" or "how to" or "beginner guide to object oriented programming". I searched Youtube and got a bunch of recommendations for short videos that would give a good intro to the subject. Most interviews around OOP will involve designing a class. Maybe "Design a parking lot as a set of classes, tell us how they interact" or "Design a deck of cards as a class". You'd be asked to write or design the classes representing a Deck of cards, each individual Card object, a Hand, and to write methods like "write a shuffle or deal method for the Deck". Here's one: https://www.youtube.com/watch?v=pTB0EiLXUC8&ab_channel=ProgrammingwithMosh Here's another: https://www.youtube.com/watch?v=SiBw7os-_zI&ab_channel=freeCodeCamp.org More on reddit.com
🌐 r/leetcode
4
12
December 5, 2023
Using Java for whiteboard OOP design, Python for HackerRank/Leetcode?

It's not common because most people know one language the best and it can be hard to be constantly switching between syntax.

It's not bad, per-say.

More on reddit.com
🌐 r/cscareerquestions
5
6
May 5, 2016
Where can I find problems to practice OOP?
I know it's not really what you're looking for be it's my opinion: projects. You should practice using something in a situation where it is relevant. OOP shines best in complicated programs with a certain complexity/intricacy, or to simplify the code you're writing. Exercises don't help practice that because they tend to be short. In python, you'll almost never have to write over 50 lines for a simple exercise. Let alone 200, and that's about the length where turning to OOP starts being advantageous. So find yourself a project. It doesn't even have to be explicitly object oriented: a game, a simulation, things with entities in general beg for OOP, but it can be used anywhere. On this sub, I once proposed a implementation of rock-paper-scissors using a class. The point is to make something, and at some point to use OOP to simplify it. This may be at the very start, or later, when you find that your code is very copy pasty and you use classes to reduce that. You may even revisit an older project and try to rewrite it with OOP, maybe expand upon it. The important thing is to dive into something and get working on it. It may be 150 lines or 700. The point is you'll only be able to do it if you know OOP: if it feels easy and intuitive, then you're good, otherwise, keep going. That will get you the practice you want: a real application of the concepts you learn. More on reddit.com
🌐 r/learnpython
77
204
August 26, 2020
🌐
LeetCode
leetcode.com › discuss › study-guide › 3060677 › List-of-OOP-Problems
List of OOP Problems - Discuss
I learned OOP while preparing for the exam and I wanted to solve a few problems about this topic on leetcode.com. Unfortunately Problems on the site are a bit weak in categorization (or I can't use the site).
🌐
LeetCode
leetcode.com › problems › maximum-product-of-word-lengths › solutions › 2087057 › easy-to-understand-oop-solution-in-python
Maximum Product of Word Lengths - LeetCode
Can you solve this real interview question? Maximum Product of Word Lengths - Given a string array words, return the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters.
🌐
Blind
teamblind.com › tech › the leetcode for object oriented programming
The leetcode for object oriented programming | Tech Industry - Blind
January 6, 2024 - Anyone know where to practice oop interview questions like letcode? 43142 · Hide company name0 credits left · Post · Sort by : Cognizant pSvQ25 Jan 6, 2024 · Check out https://leetcode.com/tag/design/ and https://github.com/prasadgujar/low-level-design-primer/blob/master/solutions.md WGMI ·
🌐
Real Python
realpython.com › python3-object-oriented-programming
Object-Oriented Programming (OOP) in Python – Real Python
December 15, 2024 - In this tutorial, you'll learn all about object-oriented programming (OOP) in Python. You'll learn the basics of the OOP paradigm and cover concepts like classes and inheritance. You'll also see how to instantiate an object from a class.
🌐
Medium
medium.com › acing-the-software-engineer-interview › leetcode-systems-questions-a67b654f15ec
Leetcode Object Oriented Programming System Questions | by LiveRunGrow | Acing the Software Engineer Interview | Medium
August 3, 2024 - The format of a path is one or more concatenated strings of the form: / followed by one or more lowercase English letters. For example, "/leetcode" and "/leetcode/problems" are valid paths while an empty string "" and "/" are not.
Find elsewhere
🌐
GitHub
github.com › chenqi0805 › OOP-in-Python › blob › master › Leetcode.ipynb
OOP-in-Python/Leetcode.ipynb at master · chenqi0805/OOP-in-Python
Object Oriented Programming in Python. Contribute to chenqi0805/OOP-in-Python development by creating an account on GitHub.
Author   chenqi0805
🌐
LeetCode
leetcode.com › discuss › study-guide › 1368302 › python-oop
Python OOP - Discuss
Write the Director class with the required methods to give the following outputs as shown. # Write your codes here. # Do not change the following lines
🌐
LeetCode
leetcode.com › problems › my-calendar-i › solutions › 1474303 › python-object-oriented-design-approach
[python] Object Oriented Design approach - My Calendar I
September 20, 2021 - Can you solve this real interview question? My Calendar I - You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking. A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.). The event can be represented as a pair of integers startTime and endTime that represents a booking on the half-open interval [startTime, endTime), the range of real numbers x such that startTime
🌐
Python.org
discuss.python.org › python help
Why does LeetCode use solution class? Does the class ever help? - Python Help - Discussions on Python.org
February 24, 2022 - This is LeetCode question #1. I was wondering why LeetCode likes to use a solution class. I reformat the solution to a function without a class and call it: def twoSum2(nums, target): hashmap = {} for i in range(len(nums)): complement = target - nums[i] if complement in hashmap: return [i, hashmap[complement]] hashmap[nums[i]] = i nums1 = [2,7,11,15] target1 = 9 sol2 = twoSum2(nums1, target1) print(sol2) Output: [1, 0] This is LeetCode’s solution ...
🌐
LeetCode
leetcode.com › discuss › general-discussion › 962321 › is-there-a-resource-for-oop-or-practical-coding-questions-andor-solutions
Is there a resource for OOP or "practical coding" questions ...
December 6, 2020 - I know there are questions tagged "design", but these are usually just asking to implement a few methods, and don't really test OOP or library usage of the program such as with Byteboard interviews. While people have posted some in the discussion here tagged "object-oriented design", several of them are actually systems design interviews, and very few have any decent solutions, and they are almost always in Java (nothing for Python).
🌐
LeetCode
leetcode.com › problems › sudoku-solver › discuss › 344712 › python-oop-solution-clean-code
Python OOP solution (clean code) - Sudoku Solver
Can you solve this real interview question? Sudoku Solver - Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules: 1. Each of the digits 1-9 must occur exactly once in each row. 2. Each of the digits 1-9 must occur exactly ...
🌐
LeetCode
leetcode.com › problems › count-items-matching-a-rule › discuss › 1709625 › python-oop-method
python OOP method - undefined
January 22, 2022 - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
🌐
LeetCode
leetcode.com › problems › score-of-parentheses › discuss › 170554 › Easy-to-understand-object-oriented-Python-Solution
Easy to understand object oriented Python Solution
September 15, 2018 - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
🌐
LeetCode
leetcode.com › discuss › interview-question › 3828150 › oops-cheatsheet-for-interviews-30-questions
OOPS Cheatsheet for Interviews | 30 questions - Discuss
July 28, 2023 - 16. Explain the "final" keyword. Answer: In OOP, the "final" keyword can be applied to a class, method, or variable.