Docsity

Advanced Problem Solving in Computer Science: Beyond Textbook Thinking, Study notes of Computer Science

Toggle sidebar
bg1
Computer Science Problem-Solving Series
Lesson 1: Learning How to Think Like a Real Problem Solver
Introduction
I have worked with many students over the years, and one pattern keeps repeating itself. Students
study concepts, watch lectures, and even solve a few standard problems — but the moment they face
something slightly different, they get stuck.
Not because they are weak. But because nobody really taught them how to think.
This lesson is designed differently. Instead of giving you textbook-style answers, I will walk you through
how a real person approaches difficult problems — the kind where Google does not help much and
where you have to rely on your own reasoning.
The goal is simple: by the end of this lesson, you should start seeing problems differently.
Problem 1: Ride-Sharing System Without Reliable GPS
Scenario
Imagine you are asked to design a ride-sharing system similar to Uber, but there is a serious limitation:
GPS is unreliable or often inaccurate
Internet connectivity is weak or unstable
Users still expect quick matching with drivers
At first glance, this sounds like a normal system design question. But once you remove accurate
location data, the usual solutions stop working.
Where Most Students Go Wrong
Most students immediately think about maps, coordinates, and shortest path algorithms.
That approach depends heavily on precise GPS data. If the data itself is unreliable, the entire logic
becomes weak.
So instead of forcing a broken method to work, we need to rethink the system from the ground up.
A Practical Way to Think About It
When technology becomes unreliable, humans fall back on something more stable — familiarity.
•
•
•
1
pf3
pf4
pf5

Partial preview of the text

Download Advanced Problem Solving in Computer Science: Beyond Textbook Thinking and more Study notes Computer Science in PDF only on Docsity!

Computer Science Problem-Solving Series

Lesson 1: Learning How to Think Like a Real Problem Solver

Introduction

I have worked with many students over the years, and one pattern keeps repeating itself. Students study concepts, watch lectures, and even solve a few standard problems — but the moment they face something slightly different, they get stuck. Not because they are weak. But because nobody really taught them how to think. This lesson is designed differently. Instead of giving you textbook-style answers, I will walk you through how a real person approaches difficult problems — the kind where Google does not help much and where you have to rely on your own reasoning. The goal is simple: by the end of this lesson, you should start seeing problems differently.

Problem 1: Ride-Sharing System Without Reliable GPS

Scenario

Imagine you are asked to design a ride-sharing system similar to Uber, but there is a serious limitation: GPS is unreliable or often inaccurate Internet connectivity is weak or unstable Users still expect quick matching with drivers At first glance, this sounds like a normal system design question. But once you remove accurate location data, the usual solutions stop working.

Where Most Students Go Wrong

Most students immediately think about maps, coordinates, and shortest path algorithms. That approach depends heavily on precise GPS data. If the data itself is unreliable, the entire logic becomes weak. So instead of forcing a broken method to work, we need to rethink the system from the ground up.

A Practical Way to Think About It

When technology becomes unreliable, humans fall back on something more stable — familiarity.

Instead of exact coordinates, we can rely on well-known locations such as: markets hospitals schools popular roads or intersections If you have ever used local transport apps or even traditional ride systems, you might have noticed people describing locations like: “near the main bazaar” or “in front of the hospital.” This is not inefficient — it is actually very practical.

Step 1: Divide the City into Zones

Rather than tracking exact positions, divide the city into logical zones. Each zone represents a known area. Drivers and users both select their current zone instead of sharing precise coordinates. Now the system does not depend on GPS accuracy.

Step 2: Match Within Nearby Zones

Instead of calculating exact distance, the system looks for: drivers in the same zone or drivers in nearby zones This reduces complexity and still keeps matching effective.

Step 3: Estimate Time Using Past Data

Instead of calculating distance in meters, use historical averages. For example: travel from Zone A to Zone B usually takes around 10 minutes This type of estimation is surprisingly reliable in real-world systems.

Step 4: Add Human Confirmation

Because the system is working with approximations, it should allow drivers to confirm availability. For example: “Pickup will take approximately 5–10 minutes. Confirm?”

When such an element reaches the top of the heap, only then do we actually remove it. This avoids unnecessary operations and keeps performance efficient.

Balancing the Heaps

To maintain correctness: both heaps should remain balanced in size the difference should not exceed one element

Getting the Median

Once the heaps are balanced: if both heaps are equal in size, take the average of their top elements otherwise, take the top of the larger heap

What You Should Learn Here

The real lesson is not the data structure itself. It is understanding that sometimes you don’t need a completely new solution — you just need to slightly modify an existing one to handle real-world constraints. Problem 3: Detecting Bias in a Black-Box AI System

Scenario

You are given an AI system that approves or rejects loan applications. However: you cannot see how the model works internally you do not have access to the training data Still, you are asked to determine whether the system is biased.

Why This Is Challenging

Students often assume that to analyze a system, they must see its internal logic. In reality, many systems are closed and cannot be inspected directly.

So the question becomes: how do you judge something you cannot see?

Observing Behavior Instead of Code

When internal access is not available, the only reliable method is to study how the system behaves.

Step 1: Create Controlled Test Cases

Design inputs where everything is the same except one factor. For example: same income same job same credit history only change one attribute

Step 2: Compare the Outputs

If the decision changes significantly when only one attribute changes, that is a strong signal of bias.

Step 3: Repeat at Scale

One or two tests are not enough. Run many such comparisons and observe patterns. If a certain group consistently gets worse outcomes, the system is likely biased.

Step 4: Document the Findings

Even without internal access, you can create a clear report showing: input variations output differences observed patterns This is often how real-world audits are conducted.

Key Insight

You do not always need to look inside a system to understand it.