Computer Science challenge, let's make it interesting!!
Tags: computerscience, discuss, softwareengineering, learning
Published: 2024-06-13 19:11:32

If you haven’t checked it out yet, [dev.to](https://dev.to) has introduced [First Computer Science Challenge](https://dev.to/devteam/introducing-our-first-computer-science-challenge-hp2) in honor of [Alan Turing](https://en.wikipedia.org/wiki/Alan_Turi.ng). The challenge is to explain a computer science concept in 256 characters or less.

Let's make it even more exciting!

It's really interesting to look at these videos where an expert explains a concept at five levels of difficulty.

{% embed https://www.youtube.com/watch?v=fOGdb1CTu5c %}


Let's do the same thing in this challenge too\. [As per the challenge rules](https://dev.to/challenges/cs), it is allowed to "submit multiple submissions per prompt but you’ll need to publish a separate post for each submission".

Why not submit 5 submissions, for explanations at 5 levels of difficulty? It's fun. And to make it more interesting, let's pitch our explanations to people with varying levels of expertise and see how they interpret and re-explain our explanations. We'll then submit their interpretations in 256 characters or less.

To start with, I explained [how to use Lock in Google App Script](https://dev.to/sauravshah31/using-google-apps-script-create-a-todo-web-app-4cah#using-lock-service). Here’s my attempt to explain "Lock / Mutex" at five different levels of difficulty:

## **Level 1:**
- **My Explanation**
Imagine you're in an exam hall where only one student can go to the restroom at a time using a pass. When they return, the pass goes to the next student. Similarly, computers use locks to let only one app access a resource at a time while others wait.

- **People's Interpretation**
_(will update)_


## **Level 2:**
- **My Explanation**
Locks prevent issues when multiple entities access a resource simultaneously (like multiple apps writing to a file), which can cause unexpected behavior (like overwritten writes). Google Docs uses it to avoid overwritten edits during collaboration.


- **People's Interpretation**
_(will update)_


## **Level 3:**
- **My Explanation**
A mutex blocks access to a critical section until the current thread is done, preventing race conditions but potentially causing performance hits. The GIL in CPython restricts access to shared resources to one thread at a time, impacting multi-threading.

- **People's Interpretation**
_(will update)_


## **Level 4:**
- **My Explanation**
A mutex uses architecture-specific atomic instructions (uninterruptible) until successful, allowing thread access to a critical section. For non-atomic architectures, complex logic involving disabling interrupts and continuously checking flags is used.

- **People's Interpretation**
_(will update)_


## **Level 5:**
- **My Explanation**

Damn! I’m not a mutex maestro, and I’ve dug through every corner of my brain and read more articles than a bored cat on the internet. But guess what? I still can't explain mutexes to an expert without turning into one myself.

One day, this section will be so expertly explained it’ll make your head spin!

Any experts here? Drop your wisdom in the comments, and I'll update this section.

- **People's Interpretation**
_(will update)_


Now, my challenge is to present this to individuals at these five levels and share their takes on it. I'll update with the most relevant responses as I receive them.

Join me in this challenge! If you have a better explanation, comment below. Or, explain the concept to those around you and share their interpretations. I will include the top three dev handles with most appropriate response in my submission (you can work on teams of up to four people). 

Or, go ahead and participate on your own. Explain any computer science topic in 256 characters or less. Remember, [no plagiarism](https://dev.to/challenges/cs).

> 
By the way, I still have some buddy passes to [nights and weekends s5](https://dev.to/sauravshah31/this-is-for-you-lets-build-some-cool-stuff-15kn). [Click on this invitation link](https://sage.buildspace.so/buddy/saurav-rNlBvQC) and you will be directly accepted to the s5 cohort. First kick off starts on 15th June. Let’s build something amazing together!



**Cheers🎉** ~ [sauravshah31](https://x.com/sauravshah31)