FANG Interview Question | Process vs Thread

FANG Interview Question | Process vs Thread

ByteByteGo

1 год назад

275,013 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Sogol Yazdanmadad
Sogol Yazdanmadad - 11.09.2023 10:29

Thanks for the great video!🎉

Ответить
Moho Khachai
Moho Khachai - 09.09.2023 00:15

So how many process can 4 ram handle

Ответить
Moho Khachai
Moho Khachai - 08.09.2023 23:58

Teaching them plz

Ответить
Ramazan Üstün
Ramazan Üstün - 31.08.2023 17:20

This 4-minute video explains what my professor could not do in an entire semester.

Ответить
Yaseen Gouse Samudri
Yaseen Gouse Samudri - 22.08.2023 12:25

I think your animator is overdoing it, am having trouble focusing on the content. Also, could you pause and take breaks, because it feels like you're rushing. Thank you for the content though.

Ответить
Barıs Balli
Barıs Balli - 13.08.2023 14:28

This video helped me, thank you 😊

Ответить
michael hernandez
michael hernandez - 11.08.2023 16:43

Best video on this subject by far

Ответить
Saadman Sakib
Saadman Sakib - 29.07.2023 09:24

I like how he’s a fan of witcher 3

Ответить
Vikas Sangwan
Vikas Sangwan - 17.07.2023 15:29

Code in a program, loaded into memory and executed by the processor, it becomes a process❤

Ответить
Soumya Pattanaik
Soumya Pattanaik - 29.06.2023 17:46

powerful concepts within just 4 minutes. Thanks

Ответить
Mohamed Muzammil Yacoob
Mohamed Muzammil Yacoob - 25.06.2023 23:33

Analogy for understanding process and thread
• In essence a program/process/thread is executing a job(a set of instructions). So, in that context, it’s no different than physical labour work where one executes a bunch of instructions from his/her brain and uses the required tools to complete a job
• Imagine you hire a fitter to mount your newly bought TV and you have already bought a TV mount. Here, the fitter represents a program. He has skills required to mount the TV(Set of instructions) and required tools(Data, library, plugins)
• Hiring a fitter is equivalent to installing a program. You have got commitment from him/her to work on your job. And he brings himself and loads the tools in your space ready to do the job. But, You have yet to extract the job from him. For this, you need to prepare some physical space near your TV and also give him the authorization to work at your home. This is the equivalent of creating a process where you allocate CPU and ram memory for the program to execute its job
• Just as a program can spin up multiple process, a fitter can bring multiple fitters to execute the same job. All of them work independently in their own physical space and with required authorization
• So, what's the analogy for threads? A fitter usually breaks the job into sub tasks. Here, mounting a TV can be broken in tasks like punching holes in the wall, preparing the Mount frame, adjusting the tilt etc. These subtasks represent individual threads. These threads are executed in the same memory/heap space just as the fitter performs his subtasks on his original physical space.
•Threads can be executed in parallel saving time. You can imagine this to be fitter performing tasks at the same time using his two hands. For example, one hand used to punch holes in the wall and other hand used to prepare the mount frame. This might sound like a stretch but there are some crazy people who could multitask with both hands

Ответить
Tye
Tye - 22.06.2023 17:52

This is a brilliant video.

Ответить
Rammehar
Rammehar - 06.06.2023 12:06

Love you Sir, please keep it up. and Thank you very much

Ответить
Haneul Kim
Haneul Kim - 26.05.2023 02:44

Thanks for great video. Two questions,
1. So to run K programs embarassingly parallel via multi-processing you have to have K CPU? If number of CPU < K then it would have to switch context, correct?
2. when we are talking about multi-processing python basically two of same script is copied to each process memory?

Ответить
Tanya Charan Pahadi
Tanya Charan Pahadi - 22.05.2023 21:12

This 4 minute video sums up your years of coding experience.

Ответить
Allen Tsai
Allen Tsai - 12.05.2023 13:06

超讚得

Ответить
Matthew C
Matthew C - 10.05.2023 07:05

All information that I knew but would be hard-pressed to scoop out of my brain on demand - it's great to have clear and succinct refreshers like this to keep the neurons fresh

Ответить
no
no - 05.05.2023 16:38

This is high quality content, but I'm also curious if you could do a video on how you make your videos? :)

Ответить
Assad Khan
Assad Khan - 16.04.2023 23:05

This should not be a fang interview question 💁

Ответить
Rahul Singh
Rahul Singh - 05.04.2023 21:08

Man you're dope, thanks a lot

Ответить
Rahul Singh
Rahul Singh - 05.04.2023 21:04

Can you please explain about fibres & co-routines?

Ответить
Jenn W.
Jenn W. - 18.03.2023 04:51

Also, would love to see videos on "heap" and "serialization / encoding" (some visuals on why in-memory representation is different from byte sequence would be super super helpful ). Thanks again for these great videos!!!!

Ответить
Jenn W.
Jenn W. - 18.03.2023 04:48

I really love these videos!!! The visuals are very helpful to build mental models and understand these complex concepts - thank you so much!!!

Ответить
Ravikumar Suvvari
Ravikumar Suvvari - 15.03.2023 19:12

Multi tasking and multi threading needs to be well known and especially where to use under what circumstances 🙏

Ответить
Tony Zhou
Tony Zhou - 14.03.2023 06:16

A process is a program executing by a processor. A process doesn't share memory with another process. It has a collection of threads: the main thread and the other threads if any.

A thread is an execution unit inside a process. It shares the same heap memory with the other threads in the same process. But it has its own stack memory.

Ответить
Hariom Yadav
Hariom Yadav - 06.03.2023 09:29

simply awesome

Ответить
AraAra
AraAra - 24.02.2023 09:35

pls upload more videos on operating systems concepts

Ответить
Franco
Franco - 24.02.2023 09:04

Great video. Thxs

Ответить
Tanner Barcelos
Tanner Barcelos - 10.02.2023 10:36

Building a house is a process, but the people doing the work to install the pipes, paint the walls and do the electrical work are all the working threads within the process of building the house.

I like to use threads synonymously with “unit of work” or “thing that executes a specific piece of work / action for the process to complete successfully.

So if I run chrome, and have 10 tabs open, I will have 10 processes running. Within each process are 1 or many units of work (called threads) responsible for memory management, access, logic, etc.

I believe the house analogy works well in a lot of cases

Also, I was asked this question in an interview during a Comp. Sci. Fundamentals round during the systems design portion of my interview process at a large, global company we all interact with daily. (Keeping vague for obvious reason)

Ответить
algu1984
algu1984 - 07.02.2023 13:48

The simplest explanation I would say that the Process is virtualization of memory and Thread is virtualization of CPU the rest is following cons

Ответить
neuroillusion
neuroillusion - 31.01.2023 12:14

It would be much more interesting to watch a video "fibers vs coroutines" :)

Ответить
Milad
Milad - 27.01.2023 21:50

Great channel. Simple, short and straight-forward

Ответить
Sampath Methuku
Sampath Methuku - 11.01.2023 07:02

what is the software used for animation

Ответить
LifeIsGreat
LifeIsGreat - 06.01.2023 12:15

Holy cow... so clear. So coherent. So neat. The graphics go perfectly with your explanation. Thank you for this.

Ответить
RickyTheBird
RickyTheBird - 26.12.2022 17:57

Many many thanks! This is a great video instruction!

Ответить
Amber
Amber - 26.12.2022 17:51

If adding coroutine comparison, that would be perfect!

Ответить
Sergei Kharchikov
Sergei Kharchikov - 25.12.2022 20:13

Brilliant channel

Ответить
fieryscorpion
fieryscorpion - 25.12.2022 05:39

This is how video lessons should be done; plenty of diagrams and animations instead of someone just talking.
Thanks!

Ответить
Pranay Pallav Tripathi
Pranay Pallav Tripathi - 24.12.2022 20:39

Please make more such videos on common interview questions explained so greatly

Ответить
Ricky Johnson
Ricky Johnson - 24.12.2022 15:43

Fantastic video - concise and clear explanations accompanied by extremely helpful visuals. Couldn't ask for a better description within 4 minutes of time. Subscribed!

Ответить
Sean Bergstedt
Sean Bergstedt - 23.12.2022 16:43

Do you feel like this same verbage is consistent when considering Erlang?

Ответить
Allez Venga
Allez Venga - 22.12.2022 23:18

Thanks for your sharing

Ответить
Demo
Demo - 22.12.2022 20:45

What app did you use to create that animated presentation graphics?

Ответить
TillI
TillI - 21.12.2022 16:39

can you or anybody from the comments provide a systematic overview of the relationship(technical,,,,not abstract concepts ///take x86, unix for example)bw mode bits(when exactly they are changed,,,,kindly try to be precise),kernel user mode(relating kernel stack ,,,ig both implementations ie per process,,,one for all)and virtual address spaces?

Ответить
Martin Gallauner
Martin Gallauner - 21.12.2022 13:31

The graphics and animations are so good!
(And the content of course 😄)

Thanks for sharing!

Ответить
hoàng Chu
hoàng Chu - 20.12.2022 19:05

Best explanation!!!

Ответить
Chetan Bommu
Chetan Bommu - 20.12.2022 09:15

Sir Alex, Please do in-depth videos. The content you post is so amazing but they are covered on a high level. Please go deep and explain things.

Ответить
NB Opus
NB Opus - 19.12.2022 00:43

YOu have a great way of explaining things. Keep the good work! Can't wait you get into subjects like Docker and Kubernetes.

Ответить
devictoribero
devictoribero - 18.12.2022 17:28

As always, incredible video! Real great work. I'm so impressed by the animations. How do you create them?

Ответить
BT20CSE083 Vaibhav
BT20CSE083 Vaibhav - 17.12.2022 21:38

animation is amazing

Ответить