Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

56 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🐍 Python Practice Arena

Sharpening logic. Cracking interviews. One problem at a time.

Python Problems Solved Focus Level


"First, solve the problem. Then, write the code." — John Johnson


🧭 What Is This?

This repository is my personal Python problem-solving journal — a dedicated space where I practice programming challenges to strengthen logical thinking and prepare for technical interviews. Every file here is a step forward in becoming a sharper, more confident developer.

Whether it's a pattern puzzle, a recursion riddle, or a classic interview brainteaser — it lives here, broken down and solved with clarity.


🎯 Goals of This Repo

  • 🧠 Build strong programming logic from the ground up
  • 💼 Prepare for technical interviews at top product companies
  • 📈 Track consistent progress over time
  • 🔄 Revisit and optimize solutions as skills grow
  • 📖 Write clean, readable code with comments for learning

🗂️ Repository Structure

│
├── 📂 01_Logic_Building
│   ├── Numbers
│   ├── Strings
│   ├── Lists
│   ├── Dictionaries
│   ├── List_Comprehension
│   └── Basic_Problems
│
├── 📂 02_DSA
│   ├── Arrays
│   │   ├── Traversal
│   │   ├── Two_Pointers
│   │   ├── Hashing
│   │   ├── Sorting
│   │   └── Prefix_Sum (later)
│   │
│   ├── Strings
│   │   ├── Hashing
│   │   ├── Two_Pointers
│   │   └── Sliding_Window (later)
│   │
│   ├── HashMap_Set
│   ├── Math
│   └── Patterns
│
└── README.md

📚 Topics Covered

# Category Description Status
01 🔤 Basics Syntax, loops, conditionals, I/O ✅ In Progress
02 🔡 Strings Manipulation, formatting, pattern matching ✅ In Progress
03 📋 Lists & Arrays Iteration, slicing, searching ✅ In Progress
04 🔁 Recursion Base cases, recursive breakdown ✅ In Progress
05 🗃️ Dicts & Sets Hashing, lookup optimization 🔄 Upcoming
06 🏛️ OOP Classes, inheritance, encapsulation 🔄 Upcoming
07 ⚙️ Sorting & Searching Bubble, merge, binary search 🔄 Upcoming
08 🌟 Patterns Logic-based print patterns ✅ In Progress
09 🔢 Math & Logic Number theory, mathematical problems 🔄 Upcoming
10 💼 Interview Questions Classic and FAANG-style problems 🔄 Upcoming

▶️ How to Run

Clone the repository:

git clone https://github.com/MandarK07/Python-Logic-Building.git
cd Python-Logic-Building

Run any problem file:

python 01_basics/hello_patterns.py

Requirements:

# No external dependencies needed — pure Python 3.x
python --version  # Ensure Python 3.6+

💡 Problem Format

Each solution file follows a consistent, clean structure:

# ============================================================
# Problem   : Find the Second Largest Number in a List
# Category  : Lists & Arrays
# Difficulty: Medium
# Date      : YYYY-MM-DD
# ============================================================

# 🔍 Approach:
# Iterate through the list, tracking the largest and second largest.

def second_largest(nums):
    first = second = float('-inf')
    for num in nums:
        if num > first:
            second = first
            first = num
        elif num > second and num != first:
            second = num
    return second if second != float('-inf') else None

# 🧪 Test Cases
print(second_largest([10, 5, 8, 20, 3]))   # Output: 10
print(second_largest([5, 5, 5]))            # Output: None

🚀 Progress Tracker

Total Problems Solved : ██░░░░░░░░  Growing...
Strings               : ████░░░░░░  In Progress
Arrays & Lists        : ████░░░░░░  In Progress
Patterns              : ██████░░░░  Good Progress
Recursion             : ███░░░░░░░  In Progress
Interview Questions   : █░░░░░░░░░  Just Started

Updated regularly as new problems are added!


🔥 Featured Problems

Problem Category Difficulty
Two Sum Arrays 🟢 Easy
Palindrome Check Strings 🟢 Easy
Fibonacci (Recursive + Iterative) Recursion 🟡 Medium
Find All Duplicates Arrays 🟡 Medium
Balanced Parentheses Stack / Logic 🟡 Medium
Anagram Groups Strings / Hashing 🟡 Medium
Binary Search Searching 🟢 Easy
Merge Sort Sorting 🔴 Hard

🧠 Why Python?

reasons = {
    "Readable Syntax"    : "Focus on logic, not syntax noise",
    "Interview Friendly" : "Used widely in coding rounds",
    "Rich Ecosystem"     : "Great for DSA and scripting both",
    "Fast Prototyping"   : "Solve and iterate quickly",
}

for reason, value in reasons.items():
    print(f"✅ {reason}: {value}")

📌 Learning Resources I Follow

  • 📘 Python Docs — Official documentation
  • 💻 LeetCode — Interview problem bank
  • 🧩 HackerRank — Python challenges
  • 📺 CS Dojo — Beginner-friendly DSA
  • 📗 Cracking the Coding Interview — Book by Gayle Laakmann McDowell

🤝 Contributing

This is a personal learning repository, but suggestions are always welcome!

If you spot a bug, have a better approach, or want to suggest a new problem:

  1. Fork the repo
  2. Create a new branch: git checkout -b suggest/better-solution
  3. Commit your changes: git commit -m "Add optimized approach for XYZ"
  4. Open a Pull Request 🎉

📬 Connect With Me

GitHub LinkedIn Email


⭐ If this repo inspires you, give it a star! ⭐

"The journey of a thousand lines of code begins with a single print('Hello, World!')"

Python

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages