interview
说下个人的外企面试经历感受,老外面试并没有像国内问得很深入或问很难的题,但会通过一些简单的问题来了解你处理问题的逻辑和思路是否清晰,即使你没能很完美地回答出来,有答到点上老外还是会认可你的,然后老外也会比较多的鼓励,让你尝试回答,对待面试者比较亲和。接下来分享些面试题吧。
1、what is SSH?
SSH standards for Secure Shell. It's a way to remotely connect to a server via command line over an encrypted connection. The basic syntax for ssh'ing into a server is: ssh username@servername
2、I get “command not found” when I run ifconfig -a. What can be wrong?
It can mean a handful of things: a. The program is not installed. b. The executable is not found anywhere in the PATH. c. The program was configured by the System Administrator to only be executable by root. So a non-sudo user will not be able to execute it.
3、What happens if I type TAB-TAB?
The first TAB press will attempt to autocomplete whatever command is being written in the terminal. On the second TAB press, if the command cannot be further autocompleted due to more than one possible matching command, a prompt will appear on the terminal to list all possibble suggestions. If no autocomplete is possible at all, then the second TAB press will do nothing.
4、What does the permission 0750 on a file mean?
This permission list will set full permissions to the owner of a file, read and execute permissions to those in the group of the file, and no permissions for other users. The prepended 0 means that there is no sticky bits set.
5、What does the permission 0750 on a directory mean?
This permission list will allow the owner of a directory to do whatever operation they want within it, grant read and execute permissions to files within the directory to members of the group of the directory, and no permissions to other users.
6、How to add a new system user without login permissions?
There are a couple of ways to do this: a. Create a user with the default shell set to /bin/false b. Create a system user
7、What is a bash alias?
A bash alias is a way to reference an executable file in a different (usually shorthand) notation. A common alias is to set an alias on ls -l to map to ls -al as the two flags are almost never used without one another.
8、What does CTRL-c do?
Interrupt the process currently being run by sending a SIGINT to the process.
9、How to redirect STDOUT and STDERR in bash? (> /dev/null 2>&1)
STDOUT goes to output 1. STDERR goes to output 1. So one can run a command like cat file.txt 1> output.txt to redirect the standard output of the cat command to output.txt. Running cat file.txt > output.txt does the same thing. If one wants to ignore an errors their command may throw, they can do something like command 2> /dev/null to not see any errors printed out. Interestingly, STDERR can be redirected into STDOUT using 2>&1. That notation will take some explaining. What 2>&1 means, is to make a copy of file descriptor 1 using file descriptor 2. So whenever the command outputs to STDERR the user will receive it in STDOUT. The example shows a clever way to get STDERR and STDOUT to swap.
10、What is the difference between UNIX and Linux.
Linux is built on top of an older operating system called UNIX by a bloke by the name of Linus Torvalds. With the combined efforts of Richard Stallman, and Linus Torvalds, Linux was created as an open source alternative to UNIX.
11、Walk me through the steps you’d take to troubleshoot a 404 error on a web application you administer.
It depends on the type of content being served, and the type of web application being run. If it is simple HTML files, or other static content, behind an Apache/NGiNX webserver, then I will simply see if the file exists in the directory being requested, and that the permissions are readable. If it is a web application written in an interpretted language like PHP or Python, it is often the same problem of files not existing or being readable, but it introduces the complexity of code which includes other code. If the webserver is acting as a reverse proxy to an application listening elsewhere on a TCP port, such as a Java of Go web program, then the best thing to do is to go into the application logs to see what resource it was trying to access and was unable to do. Status code 1xx stands for informational responses, advanced stuff we won't cover today 2xx is for successful requests 3xx is for redirections 4xx is for client errors: problems in your request 5xx is for server errors: problems inside the webserver 301 permanently moved302 temporarily moved 400 Bad Request Generic client error (e.g. bad syntax in request). 401 Unauthorized User is not authenticated. 403 Forbidden The user is recognized but has no privilege to perform this request. 404 Not Found You are requesting a resource that does not exist. 500 Internal Server Error Generic server-side error. 501 Not Implemented This page or feature is not yet available. 502 Bad Gateway You are using a proxy or a CDN, and it cannot connect to the server where the website actually is. 503 Service Unavailable The website is temporarily unavailable.
12、What is ICMP protocol? Why do you need to use?
ICMP stands for Internet Control Message Protocol. It is mostly used to send error messages and operational information between network devices. I use it to ping and traceroute servers.
13、What are request methods in HTTP?
Following are the request methods: GET- It is used to send data in url. HEAD- It only transfers status line and header section as a request. POST- It is used to send data to the server. PUT- It is used to send entire updated data to the server. DELETE. Delete method sends a request to the server to perform delete operation. CONNECT- It is used to establish connection to the server. OPTIONS- Option method describes communication options for target resource. TRACE- It performs message loop-back test along the path to the target resource.
14、What happens behind the scenes when we type google.com in a browser?
这个问题大概率是会被问到,大家自己baidu/google答案吧。
其他收集到的问题:
General Questions:
What did you learn yesterday/this week? Talk about your preferred development/administration environment. (OS, Editor, Browsers, Tools etc.) Tell me about the last major Linux project you finished. Tell me about the biggest mistake you've made in [some recent time period] and how you would do it differently today. What did you learn from this experience? Why we must choose you? What function does DNS play on a network? What is HTTP? What is an HTTP proxy and how does it work? Describe briefly how HTTPS works. What is TP? Give the basic scenario of how a mail message is delivered via TP. What is RAID? What is RAID0, RAID1, RAID5, RAID10? What is a level 0 backup? What is an incremental backup? Describe the general file system hierarchy of a Linux system. Which difference have between public and private SSH key? Simple Linux Questions: What is the name and the UID of the administrator user? How to list all files, including hidden ones, in a directory? What is the Unix/Linux command to remove a directory and its contents? Which command will show you free/used memory? Does free memory exist on Linux? How to search for the string "my konfu is the best" in files of a directory recursively? How to get all environment variables and how can you use them? What command will show the available disk space on the Unix/Linux system? What commands do you know that can be used to check DNS records? What Unix/Linux commands will alter a files ownership, files permissions? What does chmod +x FILENAME do? How to add/remove a group from a user? What is a bash alias? How do you set the mail address of the root/a user? What does CTRL-d do? What does CTRL-z do? What is in /etc/services? What is the difference between Telnet and SSH? Explain the three load averages and what do they indicate. What command can be used to view the load averages? Can you name a lower-case letter that is not a valid option for GNU ls? What is a Linux kernel module? Walk me through the steps in booting into single user mode to troubleshoot a problem.
Medium Linux Questions:
What does an & after a command do? What does & disown after a command do? What is a packet filter and how does it work? What is Virtual Memory? What is swap and what is it used for? What is an A record, an NS record, a PTR record, a CNAME record, an MX record? Are there any other RRs and what are they used for? What is a Split-Horizon DNS? What is the sticky bit? What does the immutable bit do to a file? What is the difference between hardlinks and symlinks? What happens when you remove the source to a symlink/hardlink? What is an inode and what fields are stored in an inode? How to force/trigger a file system check on next reboot? What is SNMP and what is it used for? What is a runlevel and how to get the current runlevel? What is SSH port forwarding? What is the difference between local and remote port forwarding? What are the steps to add a user to a system without using useradd/adduser? What is MAJOR and MINOR numbers of special files? Describe the mknod command and when you'd use it. Describe a scenario when you get a "filesystem is full" error, but 'df' shows there is free space. Describe a scenario when deleting a file, but 'df' not showing the space being freed. Describe how 'ps' works. What happens to a child process that dies and has no parent process to wait for it and what’s bad about this? Explain briefly each one of the process states. How to know which process listens on a specific port? What is a zombie process and what could be the cause of it? You run a bash script and you want to see its output on your terminal and save it to a file at the same time. How could you do it? Explain what echo "1" > /proc/sys/net/ipv4/ip_forward does. Describe briefly the steps you need to take in order to create and install a valid certificate for the site https://foo.example.com. Can you have several HTTPS virtual hosts sharing the same IP? What is a wildcard certificate? Which Linux file types do you know? What is the difference between a process and a thread? And parent and child processes after a fork system call? What is the difference between exec and fork? What is "nohup" used for? What is the difference between these two commands? myvar=hello export myvar=hello How many NTP servers would you configure in your local ntp.conf? What does the column 'reach' mean in ntpq -p output? You need to upgrade kernel at 100-1000 servers, how you would do this? How can you get Host, Channel, ID, LUN of SCSI disk? How can you limit process memory usage? What is bash quick substitution/caret replace(^x^y)? Do you know of any alternative shells? If so, have you used any? What is a tarpipe (or, how would you go about copying everything, including hardlinks and special files, from one server to another)? How can you tell if the httpd package was already installed? How can you list the contents of a package? Can you explain to me the difference between block based, and object based storage?
DevOps Questions:
Can you describe your workflow when you create a script? What is GIT? What is a dynamically/statically linked file? What does "./configure && make && make install" do? What is puppet/chef/ansible used for? What is Jenkins/TeamCity/GoCI used for? What is the difference between Containers and VMs? How do you create a new postgres user? What is a virtual IP address? What is a cluster? How do you print all strings of printable characters present in a file? How do you find shared library dependencies? What is Automake and Autoconf? ./configure shows an error that libfoobar is missing on your system, how could you fix this, what could be wrong? What are the advantages/disadvantages of script vs compiled program? What's the relationship between continuous delivery and DevOps? What are the important aspects of a system of continuous integration and deployment? Are you familiar with CI tools? Which ones? Describe your experience implementing continuous deployment How do you setup an end-to-end pipeline from dev to deployment? (long answer) How can Docker help in this case? How frequently have you been deploying? Have you been able to improve the frequency of deployments? If so, how? How to save only last 5 builds of jenkins job? Have you worked on Jenknsfile? can we use docker container as a node in Jenkinsfile? Who will handle docker container creation and deletion? If i am building a maven project always docker container is fresh instance it will try to download dependency from repository, what measures you will take to reduce build time? Why we need multi branch pipeline? If you forget Jenkins password, how would you login back?