Backend возможно Flashcards

1
Q

Provide few examples of HTTP methods?

A

content-length, content-type, cookie, authorization, user-agent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are HTTP status codes?

A

HTTP status codes…
From 100 to 199 are reserved for informational status codes.
From 200 to 299 there are success codes
From 300 to 399 there are redirect codes
From 400 to 499 are frontend error codes
From 500 to 599 there are backend error codes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is proxy?
What is reverse-proxy?
What is difference between them?

A

Proxy is a server that stands between client and destination server and act on behalf of client.
The purpose of proxy-server can be different.
It can be used to hide real client IP address and another information, or to act like VPN, or just to do some caching in order to improve performance.

The reverse-proxy is a server that stands between server and clients and act on behalf of destination server. It takes requests from clients and then re-send them to real server or servers.
It can be used for multiple purposes. First of all, in order to protect real servers from direct access and improve safety, but it also can be used as traffic balancer and requests router, or, again, be used to cache some data in order to improve performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What actions have you personally taken on recent projects to increase maintainability of your code?

A

Okay… At first, I am trying to keep same code style, because this makes code reading much easier. This was implemented as on my current workplace, same in my pet projects. This touches indentation, naming, etcetera.

Second, is splitting code into small functional blocks, each of what contains only certain information, and I am trying to avoid code mixing, following first SOLID principle.

All in all, I am trying always remember about SOLID and KISS principles and follow them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is DNS and what it needed for?

A

DNS or Domain Name System, is a system used in Internet to transform human-readable domain names, like youtube.com, into IP addresses, which are used by computers for identification and interaction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is TDD (Test Driven Development)?

A

Test Driven Development is a development, where when you want to add new functionality into your application, you write tests, covering this functionality, first, and only then write code for this functionality itself.

This approach makes your code more covered with tests, so it makes it more reliable. Also, when you are writing tests, you have time to think about, for example, what your function should return in what cases, and what are edge cases, etcetera, so this is easier to write man functionality after writing tests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain the difference between mutable and immutable objects. What is an example of an immutable object in JavaScript? What are the pros and cons of immutability? How can you achieve immutability in your own code?

A

Mutable objects can be changed, while immutable objects is not possible to change.

About pros and cons. From one side, immutability makes states easier to manage, because you are always sure, that if you somewhere used any value, it won’t be accidentally changed somewhere else, and program is more predictable.
From another side, in case of immutability, if you want to somehow modify string, for example, then you create another new object, containing all changes, and this takes additional memory and time.

About how to achieve immutability. For simple things like number or string, we can just use const word when declaring variables with these values. But for more complex things like arrays and objects you need to use special libraries, which provide this immutability functional, or write your own code which will allow you to interact with arrays and objects like if they were immutable too.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Domain Driven Design?

A

Domain Driven Design is a design, where we rely on business processes to define our project structure. The idea is to separate business processes into domains, which are minimally connected to other domains, and then based on these domains needs we create separate project modules, each responsible only for one domain. All data and algorithms needed for each separate domain are placed inside this certain domain module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between a process and a thread within an operating system?

A

Process is an instance of executable program. This instance includes program code itself, memory, required for code execution, and environment variables. Address space of each process is isolated, so that means that memory that this process uses can’t be directly accessed by other process.
But this isolation and process context itself is quite heavy and requires a lot of resources when creating new one or switching between processes.

Thread is execution unit, that exists inside process scope. Process can have multiple threads that work on its execution. Threads share same resources and address space inside process, and make it possible for process to do some work in parallel, using multiple threads.

To sum up, processes are isolated from each other, but threads share same memory space inside process scope.
Process creation is more complicated and takes more resources that creation of new thread.
Communication between processes is complicated and slow, but threads can communicate quickly.
Errors in one process won’t affect other processes, but error in one thread can crash whole process it belongs to.
Processes are good for things, that should be isolated from each other and be more reliable, while threads are good for splitting process work into multiple parts in order to do it quickly, for example in video redactors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly