My answer to some common Linux/Unix&SA questions

in programming •  7 years ago  (edited)

Context

These questions come from a form, which determines whether I can receive the invitation to a job interview, but unfortunately, they decided not give me the offer after I attended that job interview😞.
Due to some reason, I just can't post the last two questions' answer of mine,

  • Why do you want to join XXX? What can you bring to XXX?
  • Ask us some questions

And Initially and actually I posted these answer in here(You can also find some possible revise, like the typo or some other mistake after 24 hours), which is like Medium in China, a very user-friendly for personal writing and recording.

Coz these answer I wrote in English, obviously, no one to comment to share their own opinion with me, so I try to repost to be here to expect something happening😊.

Linux/Unix questions

Some basic *nix knowledge will come in handy here

1. Why does “kill -9” work when “kill” doesn’t? Why is “kill -9” typically not a good idea to use? *

  • Q1: By default, the command of kill will send the signal of SIGTERM to expect the process to exit in a normal way, unfortunately, at the most time some process will be totally unresponsive, so kill won't work in this case, then have to use the command set of "kill -9" which represented that force the process to immediately exit which cannot be caught, blocked or ignore, so kill -9 will work in this case.

  • Q2: As no giving the process some time to stop what it's processing, and the result is such rude behavior will cause the process leave some broken file onto the file system, also might cause some files are in an intermediate status when next time this process restart, some weird exception will occur which also maybe cause the corresponding application suddenly crash.

2. What are some possible ways two processes communicate with each other? Provide examples.

  • For argument sake, first just focus on the local and single host.
    The common ways I am familiar with are,

    • Pipeline e.g. cat /etc/hosts |grep local
    • Signal e.g. the previous question
  • Below is for both local and remote,

    • Message queue e.g. the notable msg middleware, RabbitMQ

3. Elaborate the concept of “everything is a file” in linux/unix with examples

  • Initially, I immediately thought of the similar slogan in Java, everything is an object, come back to this question, first of all, thanks giving me such chance to go further discovering&thinking it instead of stopping on knowing this feature of Unix-like OS. Furthermore, which also make me deeply go ahead a little bit via Wikipedia on these basic concepts in computer science like file system, finally to 'file', additionally, which also gives me a surprise, I eventually see an example of a statement, which is most modern terminology of computer science derives from Latin root, and this example is exactly, file.

  • Uhmm, go back to this question again :P, I saw two kind of more accurate opinions, everything is a stream of bytes, and everything is a file descriptor, I agree with both, also what I agree more is, everything is accessible resources, and the most important thing is it gives us an easy way, a simplified API to access these resources, which can easily use many what are already very familiar also classical Unix-oriented tool chain to process some complex tasks. Finally, about some typical examples, like /dev/sda1, /proc/cpuinfo, etc.

4. Why is it a bad idea to have “.” in your $PATH?

It's an unignorable security issue, especially to the root user, also in particular, the "." in the first position of $PATH, if, due to some reason, a bad boy or a cracker, put a script just named as 'ls' with the content of "rm -rf /" also along with the x permission, a disaster will happen. Luckily, I've heard about most modern Linux distros have a kind of protection mechanism to avoid this happening.

5. Sometimes less is more. Why?

I've reposted a weibo, https://m.weibo.cn/status/4134939937080845, which was a past thought of mine.

General sysadmin questions

6. What is a tiered architecture, and what are some benefits and downsides to this type of architecture?

  • Q1: Thanks again to let me rethink over this question a little bit, at this moment I have a more clear understanding of the difference between layer and tier after checking the Wiki page, what I agree with is a tier is a physical structuring mechanism for the system infrastructure, and back to this question itself, a tiered architecture is a client–server architecture in which presentation, application processing, and data management functions are physically separated, forgive me to directly refer this description, coz I cannot organize my own words very well to precisely describe it.

  • Q2: For the most common 3 tier arch, the two biggest benefits I think are

    • a): it increased the scalability of the business, relatively easy to handle the peak of business, especially for our case a small website may face a huge network traffic, like a singer, suddenly released an online live video on her personal web page hosted on our server.
    • b): it improved the ability of re-usage, whereas some business logic deployed on the server side, so some change can just happen on the server side instead of building a new package to make all end users upgrade their APP client.
  • Q3: About the downsides for a tiered arch regardless of 2, 3, or n, the common and abstract downsides are the decreased perfermance and the increased complexity of application development and
    daily operation work, generally speaking, due to the involving of some necessary middleware, which further increased the complexity of things, and in the final, what a perspective I can't agree more is the core of software development is managing complexity, which I saw in our 2017 tech prospect.

7. Why is server clustering a good idea? What are the downsides, if any?

  • Q1. Generally speaking, the advantages are,

    • a): easy to failover, namely, high availability
    • b): easy to scale to join more resources in order to face some special case
    • c): can be used to build a load balancer
    • d): can be used to organize a massively parallel computing network
  • Q2. It increased the cost of both maintenance and hardware.

8. A server behind a load balancer is failing. How does the load balancer know?

  • The load balancer has a mechanism, health check, it'll periodically send request to each server via specified port&protocol to see whether the server is healthy, if not, it'll remove the unhealthy one from the server pool and then lead the traffic to the healthy ones until it responds to the health checks normally again.

9. What is the cloud? What is the difference between the cloud and a datacenter?

  • Q1. I just saw a kind of statement via Google search about the definition of cloud in computer science, “Cloud” is a buzzword that vaguely suggests the promise and convenience of being able to access files from anywhere. But the reality is that the cloud is hardly floating like mist above our heads — it’s a physical infrastructure, its many computers housed in massive warehouses all over the world. And usually, when talk about the "cloud" in computer science, the context also commonly involves the word of computing, cloud computing, speaking of cloud computing, I saw a very good&accurate explanation in Wikipedia, which says, Cloud computing is a form of Internet-based computing that provides shared computer processing resources and data to computers and other devices on demand.

  • Q2. About the difference between the modern cloud-computing center and the traditional datacenter, I suddenly thought of some explanation in one chapter of the AWS white paper of AWS Cloud Best Practices, though AWS doesn't explicitly indicate it's the difference compared to the traditional one, which says,

    • IT Assets Become Programmable Resources
    • Global, Available, and Unlimited Capacity
    • Higher Level Managed Services
    • Security Built In

10. Why is monitoring important? What tools and metrics would you use to monitor (a) a cluster of web servers, (b) database

  • Q1. Coz a good monitoring has several common benefits,

    • Usually, the most important thing is to know the system issues the very first time, after all, sometimes these issues will gradually become a disaster, and hence the monitoring gives a chance to avoid the disaster happening.
    • Know the system bottleneck via analyzing the data metrics
    • Based on the previous step, which is a very good reference for the plan of future resources scalability.
    • Sometimes it's also often used to know about the specific inventory of hardware.
  • Q2. For the tool to monitor both a cluster of web servers and database, can try to use the popular open source project, zabbix, whereas it's free to use, no limits of nodes, many organizations are using for many years, many issues have the corresponding solution already. And the common physical metrics for servers can use like, the network traffic of the in&out, the system load, and the usage of hard disk and memory, and so on, for the database, what I can imagine is the performance of query and write as I'm not very familiar with DB.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

could someone tell me why I cannot find this tag/topic, linux in the right side of Tags and Topics, also in the new page of show more topics, a little weird...

I think the list just shows the most popular topics.

yep, I also just realized that.

Congratulations @sudosu! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You published your First Post
You got a First Vote
You made your First Vote
You made your First Comment
Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

"11. Why is sudo su nonsense?"

could you point out its nonsense at which aspect?