Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Potential answer: I'd need to look that up since I never needed it in 10 years of web dev.
magicMirror973761dMake the interview as short as possible, and go to the next one.
If they want to continue with you, repectfully decline.
And the answer is - they are are similar: they both create a new process with a new PID, with the fork/exec calling process as the parent. The difference is that the exec starts up a completly new binary, and allows for communication with it via stdin, while fork duplicate the state of the parent, and continues execution from the fork statement.
@magicMirror The question may not be intended to get an actual answer, just for checking the reaction to a question that the applicant isn't even supposed to handle.
It does happen in practice that you get questions e.g. from the customer, and you can't answer right away. You don't want your dev to say "I have no idea", but rather some sort of "I'll take note and get back to you later."
fork(): Make a clone of the current process. To be more specific: A clone with the least amount of shared memory. On Linux, the clone() syscall is also used for clones with more shared memory, aka threads.
exec(): Replace the current process with one that runs a (different*) executable.
*You can exec() the same executable as the current process, similar how you can run bash inside bash.
That isn't that hard.
@Fast-Nop But you should understand some basics of the underlying layers. Similar how you as a software developer should be able to tell what logic gates are, how you can combine transistors to make them and how you can combine logic gates to build a very simple processor. Not that i ever needed that, but as a professional you have to know the basics of your platform.
@happygimp0 You may need to know what processes are in general, but not how to launch them on specific operating systems. Windows for example doesn't even have fork/exec.
Today's tech stacks are so complex that you can't expect detailed knowledge that are completely irrelevant to the scope of work.
@Fast-Nop You server probably runs on Linux, so yes, he should know this things.
"Today's tech stacks are so complex that you can't expect detailed knowledge that are completely irrelevant to the scope of work."
The complexity is a huge problem. If you don't understand the fundamentals you are not suited for the task, an no this is not irrelevant. Your software wouldn't work without the underlying operating system, so you need a general idea about the OS, syscalls, processes and so on. This is just a one layer down the stack, he didn't ask about how CPUs works, about Verilog, about gates, transistors nor the principle of semiconductors.
Look how bad, big, slow and insecure web software has become, this wouldn't be the case if developer would understand their basics.
@happygimp0 Just because the web application runs on Linux doesn't mean the dev needs OS specific low level knowledge how to start processes.
The bloat of modern websites has nothing to do with OS level knowledge and would already be massively improved if web devs saved images in proper formats and didn't scale huge images down in the browser - something that is totally within their scope of work.
Also, websites usually aren't hacked at server level, something that isn't even the scope of the web dev, but the admin. Instead, it's rather at web application level itself, such as lousy WP installations - and that's within the scope of a web dev.
PaperTrail925261d@Fast-Nop > "Just because the web application runs on Linux doesn't mean the dev needs OS specific low level knowledge how to start processes."
@Fast-Nop This is not low level. Something like fork+exec is absolute basics. Low level would be something like: "what is the difference between execv, execve and execvp". It is like a car mechanics that doesn't know how a Otto engine works.
@happygimp0 There is no need for fork/exec knowledge in a web app because JS is mostly single-thread anyway. The exception are web workers, and a web dev should know about that, but they aren't fork/exec.
Like it or not, but the specialisation has reached a level where people don't have C/C++ under the belt when they do web programming because if they did, they'd be at a disadvantage competing against others who instead have invested that time in anything even remotely web related.
TeachMeCode333160dThat’s useless trivia unless you’re going into a hardcore linux role
PaperTrail925260d@happygimp0 > "It is like a car mechanics that doesn't know how a Otto engine works"
Its more like my mom doesn't need to know how to rebuild a carburetor in order to drive me to little league practice.
You guys are all missing the point. The point is I was prepared for web / frontend questions, not system level Linux questions. Obviously I can look it up and learn the answer afterword 🙄
PaperTrail925258d@fullstackchris > "You guys are all missing the point."
I get it. I also know I'm doomed if I ever have to look for a job. My interview answers will include any/all of the following:
"I don't know"
"I don't care"
"If I need to know that information, I would look it up"
"Good Lord that's a stupid question"
"My social justice score? What the <bleep> is that?"