http://mithuntechnologies.com/
http://mithuntechnologies.co.in/
Method 2
sudo yum install nginx
systemctl start nginx.service
To check the version we will use below command
nginx -V
Method 2
To check the version we will use below command
nginx -V
Ansible Interview Questions
Describe each of the following components in Ansible, including the relationship between them:
Task
Module
Play
Playbook
Role
Ans)
How Ansible is different from other Automation tools?
Ans)
What kind of automation you wouldn't do with Ansible and why?
Ans)
What is an inventory file and how do you define one?
Ans)
Subscribe our YouTube channel for more Free DevOps videos.
https://www.youtube.com/channel/UC-Jr307MbEREy8bG6McwD6w
What is a dynamic inventory file? When you would use one?
Ans)
How do you list all modules and how can you see details on a specific module?
Ans)
Write a task to create the directory ‘/tmp/new_directory’
Ans)
You want to run Ansible playbook only on specific minor version of your OS, how would you achieve that?
Ans)
What the "become" directive used for in Ansible?
Ans)
What are facts? How to see all the facts of a certain host?
Ans)
What would be the result of the following play?
Ans)
Subscribe our YouTube channel for more Free DevOps videos.
https://www.youtube.com/channel/UC-Jr307MbEREy8bG6McwD6w
What would be the result of running the following task? How to fix it?
- hosts: localhost
tasks:
- name: Install zlib
package:
name: zlib
state: present
Ans)
Which Ansible best practices are you familiar with?. Name at least three
Ans)
Explain the directory layout of an Ansible role
Ans)
What 'blocks' are used for in Ansible?
Ans)
How do you handle errors in Ansible?
Ans)
You would like to run a certain command if a task fails. How would you achieve that?
Ans)
Write a playbook to install ‘zlib’ and ‘vim’ on all hosts if the file ‘/tmp/mario’ exists on the system.
Ans)
Write a single task that verifies all the files in files_list variable exist on the host
Ans)
Write a playbook to deploy the file ‘/tmp/system_info’ on all hosts except for controllers group, with the following content
The variable 'whoami' defined in the following places:
role defaults -> whoami: mario
extra vars (variables you pass to Ansible CLI with -e) -> whoami: toad
host facts -> whoami: luigi
inventory variables (doesn’t matter which type) -> whoami: browser
According to variable precedence, which one will be used?
For each of the following statements determine if it's true or false:
A module is a collection of tasks
It’s better to use shell or command instead of a specific module
Host facts override play variables
A role might include the following: vars, meta, and handlers
Dynamic inventory is generated by extracting information from external sources
It’s a best practice to use indention of 2 spaces instead of 4
‘notify’ used to trigger handlers
This “hosts: all:!controllers” means ‘run only on controllers group hosts
Explain the Diffrence between Forks and Serial & Throttle.
Ans)
Subscribe our YouTube channel for more Free DevOps videos.
https://www.youtube.com/channel/UC-Jr307MbEREy8bG6McwD6w
What is ansible-pull? How is it different from how ansible-playbook works?
Ans)
What is Ansible Vault?
Ans)
Demonstrate each of the following with Ansible:
Conditionals
Loops
Ans)
What are filters? Do you have experience with writing filters?
Ans)
Write a filter to capitalize a string
Ans)
You would like to run a task only if previous task changed anything. How would you achieve that?
Ans)
What are callback plugins? What can you achieve by using callback plugins?
Ans)
What is Ansible Collections?
Ans)
File '/tmp/exercise' includes the following content
Goku = 9001
Vegeta = 5200
Trunks = 6000
Gotenks = 32
With one task, switch the content to:
Goku = 9001
Vegeta = 250
Trunks = 40
Gotenks = 32
How do you test your Ansible based projects?
Ans)
What is Molecule? How does it works?
Ans)
You run Ansibe tests and you get "idempotence test failed". What does it mean? Why idempotence is important?
Ans)
Subscribe our YouTube channel for more Free DevOps videos.
https://www.youtube.com/channel/UC-Jr307MbEREy8bG6McwD6w
How to check Memory stats and CPU stats as a Linux admin?
Ans)
How to reduce or shrink the size of LVM partition?
Ans)
How can you enhance the security of password file?
Ans)
What is the difference between Cron and Anacron?
Ans)
What command is used to check the number of files, disk space and each user’s defined quota?
Ans)
How can you manage memory in linux machines?
Ans)
What is the name and path of the main system log?
Ans)
How to manage logical volumes?
Ans)
Explain /proc filesystem?
Ans)
What are the fields in the/etc/passwd file?
Ans)
Subscribe our YouTube channel for more Free DevOps videos.
https://www.youtube.com/channel/UC-Jr307MbEREy8bG6McwD6w
How do you terminate an ongoing process?
Ans)
How can you know the execution time of a command?
Ans)
How can you append one file to another in Linux?
Ans)
How you can run a Linux program in the background simultaneously when you start your Linux Server?
Ans)
Difference in soft link and hard link?
Ans)
How to find a particular word from a file?
Ans)
What is stop command?
Ans)
How to stop particular process using Linux command?
Ans)
Can we delete content in a file by using SED command? How to do?
Ans)
How to rename the name of a file or a directory?
Ans)
Using mv command
What is stored in each of the following paths?
/bin, /sbin, /usr/bin and /usr/sbin
/etc
/home
/var
/tmp
Ans)
What is special about /tmp directory when compared to other directories?
Ans)
Explain each field in the output of `ls -l` command
Ans)
It shows a detailed list of files in a long format. From the left:
file permissions, number of links, owner name, owner group, file size, timestamp of last modification and directory/file name
What are hidden files/directories? How to list them?
Ans)
Explain piping. How do you perform piping?
Ans)
Running the command df you get "command not found". What could be wrong and how to fix it?
Ans)
Subscribe our YouTube channel for more Free DevOps videos.
https://www.youtube.com/channel/UC-Jr307MbEREy8bG6McwD6w
How do you schedule tasks periodically?
Ans)
How to check which commands you executed in the past?
Ans)
How to change the permissions of a file?
Ans)
What does the following permissions mean?:
777
644
750
Ans)
What this command does? chmod +x Bhaskar.txt
Ans)
Explain what is setgid and setuid?
Ans)
What is the purpose of sticky bit?
Ans)
What the following commands do?
chmod
chown
chgrp
Ans)
You try to delete a file but it fails. Name at least three different reason as to why it could happen
Ans)
What is systemd?
Ans)
On a system which uses systemd, how would you display the logs?
Ans)
Describe how to make a certain process/app a service
Ans)
Where system logs are located?
Ans)
How to follow file's content as it being appended without opening the file every time?
Ans)
What are you using for troubleshooting and debugging network issues?
Ans)
What are you using for troubleshooting and debugging disk & file system issues?
Ans)
What are you using for troubleshooting and debugging process issues?
Ans)
What are you using for debugging CPU related issues?
Ans)
Explain iostat output
Ans)
How to debug binaries?
Ans)
What kind of information one can find in /proc?
Ans)
Can you create files in /proc?
Ans)
What is the difference between CPU load and utilization?
Ans)
How you measure time execution of a program?
Ans)
What is a kernel, and what does it do?
Ans)
How do you find out which Kernel version your system is using?
Ans)
What is a Linux kernel module and how do you load a new module?
Ans)
Explain user space vs. kernel space
Ans)
What are system calls? What system calls are you familiar with?
Ans)
What virtualization solutions are available for Linux?
Ans)
What is KVM?
Ans)
What is SSH? How to check if a Linux server is running SSH?
Ans)
Why SSH is considered better than telnet?
Ans)
What is stored in ~/.ssh/known_hosts?
Ans)
You try to ssh to a server and you get "Host key verification failed". What does it mean?
Ans)
What is the difference between SSH and SSL?
Ans)
What ssh-keygen is used for?
Ans)
Subscribe our YouTube channel for more Free DevOps videos.
https://www.youtube.com/channel/UC-Jr307MbEREy8bG6McwD6w
What is SSH port forwarding?
Ans)
What is Globbing?
Ans)
What are wildcards? Can you give an example of how to use them?
Ans)
Explain what will ls [XYZ] match
Ans)
Explain what will ls [^XYZ] match
Ans)
Explain what will ls [0-5] match
Ans)
What each of the following matches
?
*
Ans)
What do we grep for in each of the following commands?:
grep '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' some_file
grep -E "error|failure" some_file
grep '[0-9]$' some_file
Ans)
Which line numbers will be printed when running `grep '\baaa\b'` on the following content:
aaa bbb ccc.aaa aaaaaa
Ans)
What is the difference single and double quotes?
Ans)
What is escaping? What escape character is used for escaping?
Ans)
What is an exit code? What exit codes are you familiar with?
Ans)
Tell me everything you know about the Linux boot process
Ans)
What is GRUB2?
Ans)
What is Secure Boot?
Ans)
What can you find in /boot?
Ans)
How to check which disks are currently mounted?
Ans)
You run mount command but you get no output. How would you check what mounts you have on your system?
Ans)
What is the difference between a soft link and hard link?
Ans)
True or False? You can create an hard link for a directory
Ans)
True or False? You can create a soft link between different filesystems
Ans)
What happens when you delete the original file in case of soft link and hard link?
Ans)
Can you check what type of filesystem is used in /home?
Ans)
What is a swap partition? What is it used for?
Ans)
How to create a * new empty file * a file with text (without using text editor) * a file with given size
Ans)
You are trying to create a new file but you get "File system is full". You check with df for free space and you see you used only 20% of the space. What could be the problem?
Ans)
How would you check what is the size of a certain directory?
Ans)
What do you know about LVM?
Ans)
Explain the following in regards to LVM:
PV
VG
LV
Ans)
What is NFS? What is it used for?
Ans)
What RAID is used for? Can you explain the differences between RAID 0, 1, 5 and 10?
Ans)
Describe the process of extending a filesystem disk space
Ans)
What is lazy umount?
Ans)
What is tmpfs?
Ans)
Idenfy the wrong in below commands?
sed "s/1/2/g' /tmp/myFile
find . -iname *.yaml -exec sed -i "s/1/2/g" {} ;
Ans)
What is stored in each of the following logs?
Ans)
True or False? both /tmp and /var/tmp cleared upon system boot
Ans)
How to check what is the current load average?
Ans)
You know how to see the load average, great. but what each part of it means? for example 1.43, 2.34, 2.78
Ans)
How to check process usage?
Ans)
How to check disk I/O?
Ans)
How to check how much free memory a system has? How to check memory consumption by each process?
Ans)
How to check TCP stats?
Ans)
How to list all the processes running in your system?
Ans)
How to run a process in the background and why to do that in the first place?
Ans)
How can you find how much memory a specific process consumes?
Ans)
What signal is used by default when you run 'kill *process id*'?
Ans)
What signals are you familiar with?
Ans)
What kill 0 does?
Ans)
What kill -0 does?
Ans)
What is a trap?
Ans)
Every couple of days, a certain process stops running. How can you look into why it's happening?
Ans)
What happens when you press ctrl + c?
Ans)
What is a Daemon in Linux?
Ans)
What are the possible states of a process in Linux?
Ans)
How do you kill a process in D state?
Ans)
What is a zombie process?
Ans)
How to get rid of zombie processes?
Ans)
How to find all the
Processes executed/owned by a certain user
Process which are Java processes
Zombie Processes
Ans)
What is the init process?
Ans)
How to change the priority of a process? Why would you want to do that?
Ans)
Can you explain how network process/connection is established and how it's terminated?
Ans)
What strace does? What about ltrace?
Ans)
Find all the files which end with '.yml' and replace the number 1 in 2 in each file
Ans)
You run ls and you get "/lib/ld-linux-armhf.so.3 no such file or directory". What is the problem?
Ans)
How would you split a 50 lines file into 2 files of 25 lines each?
Ans)
What is a file descriptor? What file descriptors are you familiar with?
Ans)
What is NTP? What is it used for?
Ans)
Explain Kernel OOM
Ans)
Linux Security
Ans)
What is chroot? In what scenarios would you consider using it?
Ans)
What is SELiunx?
Ans)
What is Kerberos?
Ans)
What is nftables?
Ans)
What firewalld daemon is responsible for?
Ans)
Do you have experience with hardening servers? Can you describe the process?
Ans)
Linux Networking
Ans)
How to list all the interfaces?
Ans)
What is the loopback (lo) interface?
Ans)
What the following commands are used for?
ip addr
ip route
ip link
ping
netstat
traceroute
Ans)
What is a network namespace? What is it used for?
Ans)
How to check if a certain port is being used?
Ans)
How can you turn your Linux server into a router?
Ans)
What is a virtual IP? In what situation would you use it?
Ans)
True or False? The MAC address of an interface is assigned/set by the OS
Ans)
Can you have more than one default gateway in a given system?
Ans)
Which port is used in each of the following protocols?:
SSH
SMTP
HTTP
DNS
HTTPS
Ans)
What is telnet and why is it a bad idea to use it in production? (or at all)
Ans)
What is the routing table? How do you view it?
Ans)
How can you send an HTTP request from your shell?
Ans)
What are packet sniffers? Have you used one in the past? If yes, which packet sniffers have you used and for what purpose?
Ans)
How to list active connections?
Ans)
How to trigger neighbor discovery in IPv6?
Ans)
What is network interface bonding and do you know how it's performed in Linux?
Ans)
What network bonding modes are there?
Ans)
What is a bridge? How it's added in Linux OS?
Ans)
How to check what is the hostname of the system?
Ans)
What the file /etc/resolv.conf is used for? What does it include?
Ans)
What commands are you using for performing DNS queries (or troubleshoot DNS related issues)?
Ans)
Do you have experience with packaging? (as in building packages) Can you explain how does it works?
Ans)
How packages installation/removal is performed on the distribution you are using?
Ans)
RPM: explain the spec format (what it should and can include)
Ans)
How do you list the content of a package without actually installing it?
Ans)
How to know to which package a file on the system belongs to? Is it a problem if it doesn't belongs to any package?
Ans)
Where repositories are stored? (based on the distribution you are using)
Ans)
What is an archive? How do you create one in Linux?
Ans)
How to extract the content of an archive?
Ans)
Why do we need package managers? Why not simply creating archives and publish them?
How to look for a package that provides the command /usr/bin/git? (the package isn't necessarily installed)
Ans)
Linux Applications and Services
Ans)
What can you find in /etc/services?
Ans)
How to make sure a Service starts automatically after a reboot or crash?
Ans)
You run ssh 127.0.0.1 but it fails with "connection refused". What could be the problem?
Ans)
How to print the shared libraries required by a certain program? What is it useful for?
Ans)
What is CUPS?
Ans)
What types of web servers are you familiar with?
Ans)
What is a "superuser" (or root user)? How is it different from regular users?
Ans)
How do you create users? Where user information is stored?
Ans)
Which file stores information about groups?
Ans)
How do you change/set the password of a user?
Ans)
Which file stores users passwords? Is it visible for everyone?
Ans)
Do you know how to create a new user without using adduser/useradd command?
Ans)
What information is stored in /etc/passwd? explain each field
Ans)
How to add a new user to the system without providing him the ability to log-in into the system?
Ans)
How to switch to another user? How to switch to the root user?
Ans)
What is the UID the root user? What about a regular user?
Ans)
What can you do if you lost/forogt the root password?
Ans)
What is sudo? How do you set it up?
Ans)
What is /etc/skel?
Ans)
How to see a list of who logged-in to the system?
Ans)
Explain what each of the following commands does:
useradd
usermod
whoami
id
Ans)
Where can you find information on the processor?
Ans)
How can you print information on the BIOS, motherboard, processor and RAM?
Ans)
How can you print all the information on connected block devices in your system?
Ans)
Give 5 commands which are two letters long
Ans)
What ways are there for creating a new empty file?
Ans)
How `cd -` works? How does it knows the previous location?
Ans)
List three ways to print all the files in the current directory
Ans)
How to count the number of lines in a file? What about words?
Ans)
You define x=2 in /etc/bashrc and x=6 ~/.bashrc you then login to the system. What would be the value of x?
Ans)
What is the difference between man and info?
Ans)
Explain "environment variables". How do you list all environment variables?
Ans)
How to create your own environment variables?
Ans)
What a double dash (--) mean?
Ans)
What the awk command does? Have you used it? What for?
Ans)
How to print the 4th column in a file?
Ans)
How to print every line that is longer than 79 characters?
Ans)
What the lsof command does? Have you used it? What for?
Ans)
What commands you can use for searching files and/or directories?
Ans)
How can you check what is the path of a certain command?
Ans)
Explain the fork() system call
Ans)
Explain the exec() system call
Ans)
What system call is used for listing files?
Ans)
What system call is used for creating a new process?
Ans)
What are the differences between exec() and fork()?
Ans)
Why do we need the wait system call?
Ans)
What execve() does?
Ans)
What is the return value of malloc?
Ans)
Explain the pipe() system call. What does it used for?
Ans)
What happens when you execute ls -l?
Ans)
What happens when you execute ls -l *.log?
Ans)
What readdir() system call does?
Ans)
What exactly the command alias x=y does?
Ans)
Linux Filesystem & Files
Ans)
How to create a file of a certain size?
Ans)
Can you describe how processes are being created?
Ans)
What does the following block do?:
open("/my/file") = 5
read(5, "file content")
Ans)
Describe three different ways to remove a file (or its content)
Ans)
What is the difference between a process and a thread?
Ans)
What is context switch?
Ans)
You found there is a server with high CPU load but you didn't find a process with high CPU. Ans)
How is that possible?
Ans)
When you run ip a you see there is a device called 'lo'. What is it and why do we need it?
Ans)
What the traceroute command does? How does it works?
Ans)
What is network bonding? What types are you familiar with?
Ans)
How to link two separate network namespaces so you can ping an interface on one namespace from the second one?
Ans)
What are cgroups?
Ans)
Explain Process Descriptor and Task Structure
Ans)
What are the differences between threads and processes?
Ans)
Explain Kernel Threads
Ans)
What happens when socket system call is used?
Ans)
You executed a script and while still running, it got accidentally removed. Is it possible to restore the script while it's still running?
Ans)
What is the difference between MemFree and MemAvailable in /proc/meminfo?
Ans)
What is virtual memory?
Ans)
What is the difference between paging and swapping?
Ans)
Explain what is OOM killer
Ans)
What is a Linux distribution?
Ans)
What Linux distributions are you familiar with?
Ans)
What are the components of a Linux distribution?
Ans)
Wildcards are implemented on user or kernel space?
Ans)
If I plug a new device into a Linux machine, where on the system, a new device entry/file will be created?
Ans)
Why there are different sections in man? What is the difference between the sections?
Ans)
Subscribe our YouTube channel for more Free DevOps videos.
https://www.youtube.com/channel/UC-Jr307MbEREy8bG6McwD6w
Mithun Technologies +91-9980923226 devopstrainingblr@gmail.com ...