👨‍💻

Programming

Python, JavaScript, Java, C++, and more

25
Total Problems
23
Solved
15
Contributors

Programming Problems

When to use class vs function in Python?

As a beginner, I'm confused about when I should use a class vs just functions. What are the guidelines?...

👤 Robert Brown beginner 👁️ 657 views 💬 0 solutions ✓ Solved

Debounce vs Throttle - What's the difference?

I keep seeing debounce and throttle functions in JavaScript libraries. What's the difference between them? When should I use debounce vs throttle? Can someone provide simple implementations of both w...

👤 David Miller intermediate 👁️ 1205 views 💬 0 solutions ✓ Solved

Understanding Python decorators

I see @decorator syntax in Python code but I don't understand how decorators work. Can someone explain with examples?...

👤 Jennifer Lee intermediate 👁️ 758 views 💬 0 solutions ✓ Solved

What is Object-Oriented Programming?

I keep hearing about OOP but I don't understand encapsulation, inheritance, and polymorphism. Can someone explain?...

👤 James Wilson beginner 👁️ 1105 views 💬 0 solutions ✓ Solved

How does garbage collection work?

How does garbage collection work in languages like Java and Python? How does it know when to free memory?...

👤 Tom Harris advanced 👁️ 407 views 💬 0 solutions

SQL JOIN types explained with examples

I always mix up the different types of SQL JOINs. Can someone explain with clear examples: - INNER JOIN - LEFT JOIN - RIGHT JOIN - FULL OUTER JOIN - CROSS JOIN What's the difference and when would I...

👤 Patricia Johnson beginner 👁️ 1651 views 💬 0 solutions ✓ Solved

Understanding Promise.all vs Promise.allSettled

I'm confused about when to use Promise.all() vs Promise.allSettled() in JavaScript. From what I understand: - Promise.all() fails fast if any promise rejects - Promise.allSettled() waits for all prom...

👤 Jennifer Lee intermediate 👁️ 955 views 💬 0 solutions ✓ Solved

What is *args and **kwargs in Python?

I see *args and **kwargs in Python function definitions but I don't understand what they mean. ```python def my_function(*args, **kwargs): pass ``` Can someone explain with examples?...

👤 James Wilson beginner 👁️ 1307 views 💬 0 solutions ✓ Solved

Multithreading vs Multiprocessing

What's the difference between multithreading and multiprocessing? When should I use each?...

👤 Sarah Chen advanced 👁️ 603 views 💬 0 solutions ✓ Solved

Understanding pointers in C

Pointers in C are confusing me. What exactly is a pointer and why do we need them?...

👤 Lisa Park intermediate 👁️ 475 views 💬 0 solutions

How to reverse a string in JavaScript?

I need to reverse a string in JavaScript. For example, "hello" should become "olleh". I've tried using a for loop but my code isn't working: ```javascript function reverseString(str) { let reverse...

👤 Mike Johnson beginner 👁️ 1643 views 💬 0 solutions ✓ Solved

Python list comprehension vs map/filter

When should I use list comprehension vs map() and filter() in Python? For example, these seem to do the same thing: ```python # List comprehension squares = [x**2 for x in range(10)] # map squares ...

👤 Emma Wilson intermediate 👁️ 940 views 💬 0 solutions ✓ Solved

Understanding recursion with examples

I'm struggling to understand recursion. Can someone explain it with simple examples like factorial?...

👤 David Miller intermediate 👁️ 923 views 💬 0 solutions ✓ Solved

How to optimize slow SQL queries?

My SQL query is running very slow on a large table (millions of rows). The query: ```sql SELECT * FROM orders WHERE customer_id = 12345 AND created_at > '2024-01-01' ORDER BY created_at DESC; ``` ...

👤 Lisa Park intermediate 👁️ 950 views 💬 0 solutions ✓ Solved

Understanding Docker basics

What is Docker and why is it useful? How is it different from virtual machines?...

👤 Rachel Martinez beginner 👁️ 878 views 💬 0 solutions ✓ Solved

Understanding async/await in Python

How does async/await work in Python? When should I use it instead of regular synchronous code?...

👤 Mike Johnson intermediate 👁️ 627 views 💬 0 solutions ✓ Solved

Deep copy vs Shallow copy in JavaScript

I need to copy an object in JavaScript, but changes to the copy affect the original object. What's happening? ```javascript const original = { name: 'John', address: { city: 'NYC' } }; const copy = {...

👤 Lisa Park intermediate 👁️ 1052 views 💬 0 solutions ✓ Solved

Understanding Python generators and yield

I'm confused about Python generators. What's the difference between: ```python def get_numbers(): return [1, 2, 3, 4, 5] def get_numbers_gen(): yield 1 yield 2 yield 3 yield 4 ...

👤 Daniel Kim intermediate 👁️ 820 views 💬 0 solutions ✓ Solved