Technical Questions¶
It's time to self asses your abilities and find out what you don't know. This will help place you somewhere on the road map in "The Basics" and help give you direction and focus.
Note
This part of the book is optional. If you want to go through the whole book anyway, then just skip over this. If you're confident you know enough about hardware, networking, programming, etc. then again just skip this section. If, however, you're new to the industry then I would recommend going through this entire section.
To achieve this I've provided some example questions and scenarios below. These explore performing tasks from an IT professional's perspective.
The questions are high level and are designed to just challenge you on simple concepts. If you struggle with these questions then I'd suggest skipping the scenarios and going straight to "The Basics" and looking over the road map. To complement these questions I've provided some scenarios for you to read over.
The scenarios are mainly from the lens of a developer. Each scenario is designed to test your understanding of certain concepts. If you read through the scenario's text and you find you don't know what the bold words mean then you might need to refresh your knowledge on a particular topic or study it from scratch.
These scenarios contain keywords, phrases, etc. which you should know the meaning of. For example if you see the term "compiling" you should know what it is to compile something.
Note
Don't be upset or ashamed if you don't know something. We all start somewhere and sometimes we study something and then go on to never use it, which means our knowledge in that area fades. It's OK if you're a bit of some networking concepts or forgot what HTTPS is.
I've also broken down each scenario into questions, which you should take your time to read and answer. These questions are designed to help you better understand which parts of the scenario's text you should understand.
The questions should be followed up by an honest self-evaluation of your current knowledge and skills. This will help you understand what you do and don't know, and what topics you should start studying first. It will also help you decide what you need to brush up on as you may have already covered some of these topics in the past.
Let's dive into the questions and scenarios.
High Level Questions¶
- "What is a CPU?"
- "What is RAM used for?"
- "Is a CPU the same as GPU?"
- "What does a NIC do?"
- "What is a process?"
- "What does a file system do?"
- "What is HTTP?"
- "Which service runs on TCP port 22?"
Answers¶
What is a CPU?
The term "CPU" means "Central Processing Unit". It's a general purpose processor that's very good at doing a lot of maths very quickly. The most common CPUs on the market are Intel, AMD and ARM.
What is RAM used for?
"Random Access Memory" or RAM is used for storing information that does not persist (stay around) after the computer as shutdown or reboot. RAM is extremely fast and is used (primarily) for storing information used by processes and threads (running programs.)
Is a CPU the same as GPU?
Yes and no. They're each serve a common goal: processing numbers really quickly. GPUs are exceptionally good at working with mathematical concepts that are focused on graphics processing and rendering. CPUs can do that work too, but they're not as good at it and as a result we install discreet GPUs into our computers when we need to do intensive graphics work.
So yes the end result is the same - processing numbers - but the capabilities are different.
What does a NIC do?
A NIC - a Network Interface Controller - is used to connect a computer to a network so that it can transmit data to and from other systems that are also attached to the same network (or even another network.) Without a NIC you're not going to be able to connect to the Internet.
NICs can be in the wired form factor, which take a Ethernet cable, or the wireless form factor, which transmits data using radio waves.
What is a process?
A process is an executable (binary/program) that is running on a processor. It has one or more threads, memory allocated to it, and more. It's the code that was written and compiled into an executable, but running on a computer.
What does a file system do?
A file system like NTFS, EXT, APFS, ZFS and (a lot) more are designed to manage the distribution of data across a storage device, or multiple devices, so that you can organise and use that data using human friendly concepts such as files, directories, meta data, tags, etc. When you download a video file and open it in your video player, you're interacting with a file system. The video player is also interacting with the file system too.
What is HTTP?
Hypertext Transfer Protocol is how we transfer resources over the public Internet when interacting with the Internet via a browser. It's used in other ways too, but we use HTTP via the browser mostly.
HTTP is used to request and receives data like HTML, JavaScript, CSS, images, videos, and more.
Which service runs on TCP port 22?
The SSH protocol runs on TCP/22. It's an extremely common protocol mostly used for administrating Linux and Unix like systems.
Scenario 1¶
"I want you to compile a Go source file into a binary. Using the Linux terminal, I want you to navigate to the executable and run it."
From this one scenario we can ask ourselves:
- Do you know what compiling code is?
- What is Go?
- What is a source file?
- What is a binary?
- What is Linux?
- How and why do we use a terminal?
- How do you navigate a file system in Linux, using the terminal?
- What is an executable?
- How do you run an executable?
Can you answer these questions with confidence?
Answers¶
Do you know what compiling code is?
Compiling code is the task of translating the human readable version of the code, the code we write, into a format that a processor (computer/CPU) can work with. Some programming languages, like Python are "interpreted", which just means they're compiled at the time you run the code and not before you run the code. A language like C or Go, however, is compiled ahead of time into a binary which you then execute.
What is Go?
Go is a programming language. There are many programming languages available for us to use. Popular languages you'll see mentioned a lot throughout your time in the industry include Python, JavaScript, Java, C, C++, TypeScript, etc.
A programming language is used to write out a source file containing instructions which are then compiled into an executable or just directly interpreted by the computer at run time.
What is a source file?
A source file is a file that contains source code which is then compiled into something the computer can understand and use. Or it's run directly in the case of an interpreted language.
What is a binary?
A binary is a special type of file that contains a program that you can execute. An example of a binary would be a .exe
file on Windows. This is an "executable" can be run and the results depend on the code that was written to produce the binary.
What is Linux?
Operating systems come in different varieties, and Linux is one of them. Linux is the most widely deployed operating system in the world due to its use in Android mobile devices.
How and why do we use a terminal?
Knowing how-to use a terminal (also known as a "shell") is important because a lot of modern IT tools, especially those in the DevOps and software development spaces, are "command line" based tools. This means you can only use them via a terminal because they're text based interfaces, not graphical. This is why it's important to know what a terminal is and how-to access it.
Accessing a terminal depends on the operating system we're using. On Windows this can mean a few things such, as such cmd.exe
, the PowerShell terminal, the newer terminal called "Windows 10 Terminal", and so on. In Linux the terminal is a well established and known part of the experience. You should review the following material on the command-line interface if you're unfamiliar with command-lines, shells or terminals.
How do you navigate a file system in Linux, using the terminal?
The primary way to move around a Linux file system, via a terminal (shell), is using the command cd
, which means "change directory". Other important commands help with this navigation such as pwd
and ls
(you should ideally know what these are.)
What is an executable?
An executable is a file that can be run as a program. This means it's not just a static file with data inside of it, like a photograph or a document, but instead is a special kind of file that "runs" when you access it. What happens after you run an executable depends entirely on the code that was written to produce (through compiling) the executable.
How do you run an executable?
To determine how-to run an executable you have to first understand a few key concepts about the executable. For example does the executable have a graphic user interface (GUI)? Or is a command-line interface? If it's a script or a binary? This is actually a bit of an advanced question and the answer is actually, "It depends." The simple version is, "You double click the executable or use ./executable
depending on the operating system." The more long winded answer requires better understanding the binary. If you at least know that running an executable requires knowing the context, then you've understood the concept of an executable well enough.
Scenario 2¶
"I need to determine the process id of my executable, how much CPU it's using, how much RAM has been allocated to the process, and what network port it's listening on. Is it listening for a TCP or UDP connection?"
Let's repeat the same process of breaking this question up into its components and the technologies it's asking you about:
- What is a process?
- What is a process id?
- What is CPU usage and how do we measure it?
- What is RAM?
- And why is RAM allocated? What does it mean to allocate RAM?
- What is a network port?
- And how do I know if it's listening or not?
- What is TCP and what is UDP? How are they different?
How confident are you with these questions?
Answers¶
What is a process?
A process is an executable (binary/program) that is running on a processor. It has one or more threads, memory allocated to it, and more. It's the code that was written and compiled into an executable, but running on a computer.
What is a process id?
A process id is the numerical identifier given to a running process on your system. This is a unique identifier and can be used to perform operations against the process like seeing how much RAM is allocated to it or even stopping it.
What is CPU usage and how do we measure it?
In a nut shell CPU usage represents the amount of time your computer's CPU is running processes (threads) and doing work. If your CPU utilisation is 90%, then 90% of its time is spent executing code.
What is RAM?
Random Access Memory (RAM) is used to store data that is used by a process or thread. The data does not persist a system shutdown or reboot.
And why is RAM allocated? What does it mean to allocate RAM?
RAM is finite and must be allocated to processes to allow them to use it. When a process starts it can request an allocation of RAM, which can grow and shrink as the process does its tasks. So essentially allocating RAM is "slicing" up what physical RAM the system has into "blocks" that a process (and its threads) can use to store data it needs to do its job.
What is a network port?
A network port is an endpoint presented by a number that you connect to. You connect to other systems on a network using IP addresses and port. Without a port an operating system cannot know what service it you want to connect to. That's what a network port does: it allows a process on one system to connect to another process on another system, over a network, on a specific port.
And how do I know if it's listening or not?
This depends on the operating system you're using. On a Windows and Linux systems you can use the netstat
command to see what open network ports you have on your local system. You'll get a list of processes that are running on your system and the network ports they're listening on (for connections over the network.)
What is TCP and what is UDP? How are they different?
They're networking protocols used to describe how data is transmitted over a network.
TCP is a connection-orientated protocol, which means it manages the connection between client and server to ensure packets are delivered successfully. TCP establishes connections using a handshake. It also has error checking and other mechanisms to make sure the data that reached the client or server was intact.
UDP is not connection-orientated, in fact it's the opposite: it's connectionless. With UDP a client sends the data to the server and then "hopes" that it gets there. The server then receives the data and although UDP does do error checking, it will simply discard any UDP packets that have errors. Unlike TCP, UDP won't attempt to do error recovery or request that the client/server re-send the UDP packet... it's simply lost.
TCP and UDP are complex topics, so for now simply understand that they're connection types that can be established between a client and a server (or a server and a server), with TCP providing control and guarantees, and UDP simply being a "fire and forget" like protocol. TCP connections are slower than UDP connections.
Scenario 3¶
"I've sent an HTTPS request to my process' port that requests the /random
URI, to request a random number. I need the HTTP response code. The response body will have a format that I will need to parse. I'll have to use a key in the JSON document so I can retrieve the random number."
And finally let's break this question down too:
- What is HTTPS? How is it different to HTTP?
- What is an HTTPS request?
- How do you determine what a URI is? What are they used for?
- What is an HTTP response code?
- What's a body in this context?
- Why is the format important? What is it?
- What is a JSON document?
- Why does a JSON document have a key?
How did you get on?
Answers¶
What is HTTPS? How is it different to HTTP?
The HTTP and HTTPS protocols are identical except the S in HTTPS means it's using TLS (Transport Layer Security) to encrypt and secure the HTTP traffic before it's sent over the network. The term HTTPS can also be written has HTTP/TLS or HTTPS+TLS which is to say that we're doing HTTP over TLS. So HTTPS is adding a layer of security to the HTTP communication.
What is an HTTPS request?
An HTTP(S) request is a message sent from your system to another system, over a network, that uses the HTTP protocol to ask for set of resources such as web pages, images, and more. When your browser loads a website, it makes HTTP(S) requests to the remote web server (which is talking HTTP back to your browser) asking for specific elements of a website. This is called a request.
How do you determine what a URI is? What are they used for?
A Uniform Resource Identifier or URI is how we ask for a specific resource on a remote server. It's most commonly used with HTTP(S) requests and it tells the remote web server (which talks the HTTP protocol) what resources we want to retrieve. A URI is like a path to the resource, such as /images/cat.jpg
or /dashboard/account
.
What is an HTTP response code?
The HTTP protocol uses status codes to define the success or fail of a request. HTTP requests don't use status code, but responses do. So if you make a HTTP GET
to the resource located at at URI /images/cat.jpg
and the image does NOT exist, you'll get an HTTP 404
status code back which which the image could not be found. If the image did exist you'd get an HTTP 200
, which means "success".
What's a body in this context?
An HTTP body refers to the data you send with or receive from an HTTP request or response, respectively. HTTP requests let you send information to the server, such as a file to upload. HTTP responses can return data too, like an image or HTML document.
Why is the format important? What is it?
The format of an HTTP request/response body defines what the data is, such as a JPG, JSON, HTML, etc. It's important that the data format is defined in the request/response because it enables the client/server to know how-to work with the data.
What is a JSON document?
JSON is an example of a format. It stands for JavaScript Object Notation. It's used as a way of defining information, data, and transporting it over a network. It's an extremely common format which is used by APIs (Application Programming Interface) across the globe, so it's worth getting familiar with it. Here's an example JSON document:
1 2 3 4 5 6 7 |
|
Why does a JSON document have a key?
JSON as a format or data type presents information in documents ({}
) and those documents have keys which are used to "address" or look up the data inside the document. Here's a simple document:
1 2 3 |
|
Getting the value "world" would mean looking up the key "hello" in this document.
Conclusion¶
If you can confidently say you're able to move on beyond these basics then feel free to continue to the next section of the book, "DevOps".
If not then don't panic! Let's keep going with a road map that covers the basics you'll need to continue on.