Friday, 26 April 2024

Top Linux Interview Questions With Answer

 

1. What is Linux?

Linus Torvalds developed Linux, a Unix-like, free, open-source, and kernel operating system. Mainly it is designed for systems, servers, embedded devices, mobile devices, and mainframes and is also supported on major computer platforms such as ARM, x86, and SPARC.

2. Explain the basic features of the Linux OS.

Some basic features of Linux are:

  • Linux is free and easily available.
  • It is more secure than other operating systems because it uses security auditing and password authentication features.
  • Linux has its personal software repository.
  • It includes multiple languages throughout the world. Hence Linux supports different language keyboards.
  • It offers CLI and GUI to use different commands and applications such as Firefox, VLC, etc.

3. Name some Linux Distros

There are various Linux distros but the following are the most commonly used:

  • Ubuntu
  • Debian
  • CentOS
  • Fedora
  • RedHat

4. What are the major differences between Linux and Windows?

The following table will help in understanding the differences between Linux and Windows:

Comparison Factor

Linux

Windows

Free/Paid

It is a free and open-source OS.

It is not open-source and is free to use.

Security

Linux is highly secure.

Windows is less secure compared to Linux.

Path separator

As a path separator, it uses a forward slash.

Windows uses a backward slash between the directories.

Efficiency

Linux is more efficient than Windows.

Windows is less efficient.

Kernel type

It uses a monolithic kernel.

It uses a microkernel.

File system

Linux file systems are case-sensitive.

Its file system is case-insensitive.

5. Define the basic components of Linux.

Majorly there are five basic components of Linux:

  • Kernel: Linux kernel is a core part of the operating system that works as a bridge between hardware and software.
  • Shell: Shell is an interface between a kernel and a user.
  • GUI: Offers different way to interact with the system, known as the graphical user interface (GUI).
  • Application programs: It is designed to perform a bundle of tasks through a bundle of functions.
  • System Utilities: It is the software functions through which users manage the system.

6. Elaborate all the file permission in Linux.

There are three types of file permissions in Linux:

  • Read: Users open and read files with this permission.
  • Write: Users can open and modify the files.
  • Execute: Users can run the file.

7. What is the Linux Kernel? Is it legal to edit it?

It is known as a low-level software system. The Linux kernel tracks the resources and provides a user interface. This OS is released under GPL (General Public License). Hence every project is released under it. So, you can edit the Linux kernel legally.

8. Explain LILO

LILO, i.e., Linux Loader and is a Linux Boot loader. It loads the Linux operating system into memory and starts the execution. Most operating systems like Windows and macOS come with a bootloader. While in Linux, you need to install a separate boot loader, and LILO is one of the Linux boot loaders.

9. What is Shell in Linux?

In Linux, five Shells are used:

  • csh (C Shell): This shell offers job control and spell checking and is similar to C syntax.]
  • ksh (Korn Shell): A high-level shell for programming languages.
  • ssh (Z Shell): This shell has a unique nature, such as closing comments, startup files, file name generating, and observing logout/login watching.
  • bash (Bourne Again Shell): This is the default shell for Linux.
  • Fish (Friendly Interactive Shell): This shell provides auto-suggestion, web-based configuration, etc.

10. What is a root account?

The root is like the user’s name or system administrator account in Linux. The root account provides complete system control, which an ordinary user cannot do.

11. Describe CLI and GUI in Linux.

CLI, i.e., command line interface. It takes input as a command and runs the tasks of the system. The term GUI refers to the Graphical User Interface or the human-computer interface. It uses icons, images, menus, and windows, which can be manipulated through the mouse.

12. What is Swap Space?

Linux uses swap space to expand RAM. Linux uses this extra space to hold concurrently running programs temporarily.

13. What is the difference between hard links and soft links?

Here is the table that shows the difference between soft links and hard links:

Hard Links

Soft Links

It includes original content.

It includes the original file location.

Hard links are faster as compared to soft links.

Soft links are slower.

It shares similar inode numbers.

It shares different inode numbers.

There is no relative path for hard links.

Relative paths are used for soft links.

It didn’t link the directories.

It links the directories.

Any change in this link reflects other files directly.

Every change in this link reflects its hard link and the actual file directly.

It uses less memory.

It uses more memory.

14. How do users create a symbolic link in Linux?

Symbolic links, symlink, or soft links are shortcuts to files and directories. Users can create the symbolic link in Linux through the’ ln’ command. The general command to create a symbolic link is as follows:

ln -s <existing_source file> <optional_symbolic link>








15. What do you understand about the standard streams?

Output and input in Linux OS are divided into three standard streams: 

  • Stdin (standard input)
  • stdout(standard output)
  • stderr (standard error)

Under Linux, these standard streams channel communication of output and input between programs and their environment.

Intermediate-Level Linux Interview Questions

The next 15 questions are the best suitable for those who have an intermediate level of experience in Linux:

16. How do you mount and unmount filesystems in Linux?

In this case, you can use the ‘mount’ and ‘umount’ commands.

For mounting:

  • First, identify the partition through the fdisk -l command. You can also use the lsblk command for it.
  • After identifying the partition, create the directory which will work as the mount point. For example, running the mkdir /mnt/mountpnt will create the mountpnt directory as the mount point.
  • Finally, you can run sudo mount <partition> <mount_point_directory> to complete the mounting.

For Unmounting:

Once you check if the specific filesystem is in use, you can run the `sudo umount <mount_point_directory>` for unmounting. If you want to learn more about the mount command in Linux, check out this brief guide.

17. How do you troubleshoot network connectivity issues in Linux?

There are multiple ways to troubleshoot the network connectivity and find the issue correctly:

Check the Internet Connectivity:

First of all, please check if the internet connection option is on and also check the cables to find if there is any issue with it.

Verify the Network Configuration:

  • Please check that your network is configured correctly and the network interface has your IP address. You can check it by running the ip addr or ifconfig commands.
  • You can also run the ip route command to check if the default gateway is set properly.
  • Finally, verify the DNS server configuration in the /etc/resolv.conf file.

Check the Firewall:

Sometimes, firewall rules block the internet connection for the system’s security. Hence, you can run the ufw or iptables command to modify the firewall rules.

Network Interface:

You can restart your network interface through the ifup and ifdown commands. Once you restart the network interface, please reboot the system to make changes successful.

18. How do you list all the processes running in Linux?

You can list the currently running process in Linux through various commands such as:

ps Command:

The ps command displays brief information about the running processes. You can use the ps -f or ps -f command because the -f option shows the full-format result, and the -e option displays all processes. Moreover, you can use the ps auxf command to get a detailed list of processes.

top and htop Command:

  • The top command displays the real-time details about the system process and the complete resource usage.
  • The htop command is the improved version of the top command because it displays the color-coded list with additional features such as sorting, filtering, sorting, etc.

19. What is the chmod command in Linux, and how do you use it?

You can use the chmod command to change the file permissions of the directories. It offers a simple way to control the read and write permissions. For instance, if you want to change the permission of the ABC.sh script and give it the write and executable permission, you can run the below command:

chmod u+wx ABC.sh

The chmod command is not limited to the write (w), read (r), and executable (x) permissions because there are symbolic modes and numeric modes, which you can learn from this guide.

20. How do you check disk space usage?

There are some simple commands you can use to check disk space usage, such as:

df Command:

The df or disk-free command shows the used and the available disk space. You can use the additional options to check disk space differently. For instance, you can use the df -h command to check the disk usage in the human-readable format.

du Command:

The du or disk usage command estimates and shows the disk space usage, so running the du command with no option shows the disk usage of your current directory. However, you can run the following command to check the disk usage of a specific directory:

du -sh ~/<directory> 

ncdu Command:

The NCurses Disk Usage, or ncdu command, displays more interactive disk usage. Similar to the du command, the ncdu command also requires the path of the specific directory to check its space.

21. How do you find the process ID (PID) of a running process?

You can use the following command to find the Process ID or PID of the currently running process:

pgrep Command:

The pgrep command shows the PID of a process through its name or other different attributes. For example, you can find the PID of process_1 using the below command:

pgrep <process_1>

ps Command:

ps command not only displays the currently running process but also shows the process’s PID. However, if you want to check the PID of a specific process, you can combine the ps with the grep command:

ps -e | grep -i <process_1> 

22. What is the rsync command, and how do you use this command for synchronization?

The rsync command is used to synchronize and transfer the files in Linux. It synchronizes files between two local systems, directories, or a network. The basic rsync command contains the following:

rsync <options> <source> <destination>

For example, let’s synchronize between Documents and the Downloads directory. For this, you need to run the following command:

rsync -av ~/Documents ~/Downloads

If you want to go one step further, then you can use the below command:

rsync -avz --delete ~/Documents ~/Downloads

In the above command:

  • The -a option preserves all the permissions and other attributes
  • The -v option displays the detailed output of the synchronization
  • The -z allows compression that decreases the bandwidth use.
  • The –delete option removes the file in the Downloads that do not exist in the Documents directory.

23. How do you create a user account?

You can use adduser and useradd commands to create a user for the system.

useradd Command:

Let’s create a username, “Ron,” and provide a password for accessing the system:

useradd Ron 
passwd Ron

You can also explore the useradd command’s additional options to modify the new user’s permissions and privileges.

adduser Command:

The adduser command is similar to the useradd command, so let’s create a username “Shawn”:

adduser Shawn
passwd Shawn

24. How do you format a disk in Linux?

The mkfs or make file system command helps format the disk in the Linux system. All you need to do is use the following method to format the disk:

First, run the lsblk command to list the available partitions and identify which disk you want to format.

If the selected disk is mounted, then unmount it through the following command:

umount <partition>

Now, find the file system type of the disk, like EXT4, NTFS, or XFS. Once you are done then, run one of the following commands according to the file system type:

mkfs.ext4 <partition>
mkfs.xfs <partition>
mkfs.ntfs <partition>

Finally, mount the disk again through the mount command after the successful format. Moreover, please ensure that you have created a complete disk backup to eliminate the chances of data loss.

25. How do you change the password for a user account?

Changing the password of a user account is simple because all you need to do is use the passwd command:

passwd username 

For example, let’s change the password of a user “Ron” through the below command:

passwd Ron 

Once you run the command, the system will ask you to enter and confirm the new password.

26. What is the difference between a process and a thread?

In Linux, processes are the independent program, while a thread is the unit of execution. So here are the complete differences between process and thread:

Comparison Factors

Process

Thread

Creation time

Creation time is higher

Creation time is less.

Dependency

It is independent because it does not share memory.

It depends on other threads because they share some memory with other threads.

Resource

Resource use is higher

Requires lesser resources

Termination time

The termination time is higher

The termination time is less.

27. What is the ulimit command, and how do you use it?

The ulimit command controls the resource limit for the user process. You can use the ulimit command to set the limit on the system resource to prevent consuming the higher resources. This command contains multiple options to set the limit. For example, you can use the u option to set a maximum number of processes to 50:

ulimit -u 50 

You can explore more options of the ulimit command by following this guide.

28. What is the find command, and how do you use it?

The find command searches for files based on different factors such as name, size, permissions, etc. Here is the basic command:

find <directory> <file>

For example, let’s find a Linux.txt file located in the Downloads directory through the below command:

find ~/Downloads -name Linux.txt

Once you run the above command, the find command will start finding the Linux.txt in the Downloads directory and subdirectories.

29. What is RAID in Linux?

The full form of RAID is the Redundant Array of Independent Disk that allows the system to combine the different physical disk drives into a logical unit. RAID is used to improve the system’s disk performance and data integrity. There are different RAID levels you can configure according to the requirements. Here is the detailed information about the RAID levels:

RAID Level

Description

RAID 0

It is called striping, which allows you to split the data into multiple disks without redundancy.

RAID 1

It is called mirroring, which allows you to create a complete copy of data on multiple disks.

RAID 5

It distributes the parity information and data on multiple disks.

RAID 6

It is the improved version of RAID 5 as it uses two sets of parity information to provide higher data redundancy.

RAID 10

It combines RAID 0 and RAID 1 to generate the set of mirror disks to improve performance and redundancy.

30. What are the challenges of using Linux?

There are numerous challenges that a user faces while using Linux:

  • Linux shows hardware compatibility issues in certain devices because manufacturers prioritize Windows compatibility.
  • Learning Linux is not easy because the configuration and commands require proper knowledge.
  • Although Linux supports Steam, it still needs to be impressed regarding game compatibility and availability.
  • Sometimes users face driver and firmware-related issues.

Advanced-Level Linux Interview Questions

These 15 questions will revolve around your experience and help you in preparing for the advanced-level Linux interview:

31. What is the /proc file system?

/proc (Proc File System) is the virtual file system that shows information about the system and the Kernel data structures. It is the essential interface to access the system, perform debugging tasks, check the Kernel functioning, find process-related information, and many more.

Therefore, you can use /proc file system in Linux to get information about the system and modify the particular Kernel parameters at the runtime.

32. How do you secure a Linux server?

There are multiple methods to secure the Linux server and protect it from data breaches, security threats, and unauthorized access. Here are some of these methods:

  • Create a strong password
  • Update the server and apply security patches.
  • Use secured protocols like SSH and configure it to use key-based authentication for higher security.
  • Use the intrusion detection system (IDS) to monitor network traffic and prevent malicious activities.
  • Configure the firewall to limit the inbound and outbound traffic on the server.
  • Disable all unused network services.
  • Create regular backups.
  • Review logs and perform regular security audits.
  • Encrypt network traffic and enable monitoring.

33. What is strace command?

The strace command is the diagnostic utility by which you can trace and monitor the system calls generated by the process. It allows you to find how programs interact with Kernel and can be used for debugging and troubleshooting. For example, let’s find the system calls generated by the ls command:

strace ls

Once you run the above command, the system will start tracing the list command and show the system calls generated by it. Output from the above command includes information like call name, argument, and return values.

34. How do you optimize Linux system performance?

You can optimize the Linux performance through various strategies to improve resource usage and efficiency. So some of the strategies are:

  • Updates the system as per the latest one available.
  • Optimize the disk, enable the caching, and optimize the access pattern.
  • Manage memory and CPU usage.
  • Disable the necessary services and use lightweight alternatives of the tools.
  • Monitor the system resources regularly.
  • Perform the Kernel parameter tune-up.
  • Use tools like Performance Co-Pilot (PCP) to monitor system-level performance.

35. How to administer Linux servers?

Administering a Linux server requires different strategies and management to maintain the overall functionalities. Here are some major strategies you can follow:

  • Handle user account management and assign appropriate access permissions.
  • Configure the system to optimize the performance, improve the security and maintain the network connectivity.
  • Implement the backup strategy to perform regular backups of the server.
  • Implement the monitoring tools to track resource usage, system performance, and network.
  • Set up monitoring tools to track system performance, resource usage, and network activity.
  • Configure firewall, set up intrusion detection, manage user permissions and configure the SSH.
  • Create a proper recovery planning that must include regular backup, critical configuration documentation, recovery process testing, and offsite storage.

36. What is a Linux virtual memory system?

Virtual memory is a great memory management utility in any OS. You can use the virtual memory system as secondary memory. This memory is used by both software and hardware in Linux so that your system can cope with the lack of physical memory. Moreover, virtual memory is also used to compensate for the RAM usage by transferring the data temporarily from RAM to disk storage.

37. What do you understand about process scheduling in Linux?

Process scheduling is the mechanism that identifies the order of processes running on the system. In other words, process scheduling determines the order and execution time of multiple processes running on the system concurrently. This process scheduler of Linux is priority-based and uses a preemptive algorithm. It allocates CPU time for different processes to ensure efficient CPU resource usage. These processes are dynamic, and their order can change depending on many factors, such as resource usage, process behavior, and scheduling policies.

38. What are the most important Linux commands?

There are a ton of useful commands in Linux, and here are some of the commonly used commands:

  • ls: Display directory contents such as folders and files.
  • mkdir: Used to create a new directory.
  • pwd: Shows the current directory.
  • top: Display system running processes and resource usage.
  • grep: Search a specific pattern in a file.
  • cat: Through this command, users can add multiple files and also display the content of the files.
  • tar: Archives directories and files into a tarball.
  • wget: Download files from the browser or web.
  • free: Shows memory usage.
  • df: Shows disk space usage.
  • man: Gives a manual page for a specific command that displays instructions and details.

39. What is the iptables command, and how to use it for network filtering?

The iptables command configures Netfilter firewall rules providing the network address translation, packet filtering, etc. iptables inspects the network packet and then manages them according to the defined rules. Here is how you can use the iptables command for network filtering: 

Run the below command to display the current iptables rules, including policies, chains, and other actions for the network:

iptables -L

The iptables configuration uses the predefined set of chains to process the network packages at different stages. So you can define rules to these chains for manipulating the network packets:

iptables -A <chain> <options> -j <target>

In the above command:

  • <chain>: Specifies the chain where you want to define a new rule.
  • <options>: Defines the conditions for the rule, like ports, protocols, etc.
  • -j <target>: Defines the target action when the packet matches the rule.

By default, iptables rules get automatically removed after the system reboot, but you can use the following command to make the rules persistent:

iptables-save > /etc/iptables/rules.v4

40. How do you troubleshoot a Linux OS that fails to boot?

In case of the system boot failure, you can follow various approaches such as:

  • Check the warning and error messages you get during the boot process because it can help you diagnose the issues.
  • Check the boot logs to find the exact reason behind the boot error.
  • Open the GRUB bootloader and check the boot options to solve the booting problems.
  • Check the hardware connections like cables, RAM, cooling fan, etc.
  • If the system shows an error message related to the Kernel, try to boot it with the older Kernel version from GRUB.
  • Identify the last changes you made in the system before the boot.

41. What is the init process in Linux?

The init or also called the initialization process is the first process that begins during the system boot. It is responsible for initializing and processing the system in its functional state. Hence, init works as the parent process because its process ID is 1. Originally Linux systems used to have SysV init, but now it is developed as the systemd init (an improved version of SysV).

42. What is SMTP?

SMTP stands for Simple Mail Transfer Protocol. This set of communication guidelines allows the software to transmit electronic mail online. The main aim of SMTP is to set communication rules between servers. There are two models of SMTP:

  • End-to-end model: This model is used to connect different organizations.
  • Store-and-forward model: This model is used within an organization.

43. What is LVM in Linux?

The full form of LVM is Logical Volume Manager, which provides an advanced disk management approach in Linux. It is a subsystem that allows a user to efficiently allocate the disk space on the physical storage device.

You can use the LVM to create the logical volume for easy storage management through various features like resizing, volume mirroring, and snapshots. LVM is a powerful utility for disk management where you need dynamic storage allocations.

44. What is the difference between UDP and TCP?

The following table shows the difference between UDP and TCP:

Factors

UDP

TCP

Connection-oriented

UDP does not establish a proper connection.

TCP is connection-oriented because it establishes a connection between the sender and receiver.

Reliability

UDP does not provide a reliability mechanism.

It guarantees reliable data delivery by retransmitting corrupt packets or lost packets.

Usage

It is used in low overhead, speed, and real-time communication applications.

It is used where ordered data is delivered, and reliable data must be delivered.

Applications

Video/voice conferencing, DNS, online gaming, streaming media, etc.

File transfers, email, web browsing, database transactions, etc.

45. What is /etc/resolv.conf file

The /etc/resolv.conf is the config file used for the DNS server resolution process. This config file is used to specify the DNS server, set up the search directive for domains, and configure the resolver options.

46. What is the difference between absolute and relative paths in Linux?

Absolute path = It specifies the exact location of a file or directory from the root directory (“/”). We will notice that they always start with a forward slash (“/”).

For Example: `/home/user/jayesh/geeksforgeeks.txt`

Relative paths = It specifies the location relative to the current working directory. In this we do not start with a forward slash (“/”).

For Example: `documents/file.txt`

47. What is the grep command used for in Linux?

The grep command is used to search for specific patterns within files or input streams. It allows us to find and print lines that we give to match the pattern.

For example: If we want to search `test` in a text file name “file.txt”. We use the following command

grep "test" file.txt

This command will search for the word `test` in the file named “file.txt” and print the matching lines.

48. How do you check the status of a service or daemon in Linux?

To check the status of a service or daemon, we can use the `systemctl` command followed by the service name.

For example: If we want to display the status of the Apache Web server. We use the following command.

systemctl status apache2

It will show whether the service is running, stopped, or in an error state.

49. What is the difference between /etc/passwd and /etc/shadow files?

The /etc/passwd file stores essential user information like usernames, user IDs, home directories, and default shells. Each line in the file represents a user account.

The /etc/shadow file contains encrypted passwords and other security-related information. It is only accessible by the root user or privileged processes

50. How do you compress and decompress files in Linux?

To compress files in Linux, you can use the tar command along with gzip compression.

For example: If we want to create a file name “jayesh” with gzip compression. We use the following command.

tar -czvf jayesh.tar.gz files

This command will create a compressed archive file containg the specified “files”

To decompress the same, we use the following command.

tar -xzvf jayesh.tar.gz

51. What is the difference between a process and a daemon in Linux?

A process is an executing instance of a program. It can be a foreground process that interacts with the user or a background process started by a user or another process.

A daemon is a background process that runs independently of user sessions. It is typically started at system boot time and performs system tasks or provides services. Daemons often have no user interaction and continue running even when users log out.

52. How do you schedule recurring tasks in Linux?

We can use `crontab` command for performing recurring tasks in Linux. By adding entries to the crontab file, we can specify when and how frequently a command or script should be executed

For Example: If we want to execute a script name “geeks.sh” every day at 3:30 AM. We use the following command.

crontab -e

This command opens the crontab file in an editor.

30 3 * * * /path/to/geeks.sh

53. What is the sed command used for in Linux?

The sed command is used to perform text transformations on files. It can search for specific patterns and replace them with desired text.

For Example:

sed `s/foo/bar/g` file.txt

This command replaces all occurrences of “foo” with “bar” in the file name “file.txt”

54. What are runlevels in Linux?

Runlevels in Linux define different system states, such as single-user mode or multi-user mode with or without a GUI. They determine which services start or stop during system startup and shutdown. The default runlevel is often set to a multi-user mode with a GUI (runlevel 5). Runlevel 3 is commonly used for a multi-user mode without a GUI.

Bonus Linux Interview Questions

The next 5 Linux interview questions are the most common ones recruiters ask.

55. What is sudo in Linux?

The word “sudo” is the short form of “Superuser Do” that allows you to run the command with system privileges. With this command, you can get the system’s administrative access to perform various tasks. The sudo command requires a password before the execution to verify the user’s authorization.

56. What is umask?

It is used for user file creation mode. When a user creates any file, then it has default file permission. Umask specifies restrictions for these permissions on the file, i.e., controls the permissions.

57. How to find and kill a process in Linux?

You can use different commands to kill a process, but first, you must find the PID of that specific process. So, please run the below command:

ps aux | grep <process>

Once you get the PID of the process then run the kill command to end it:

kill <PID>

If you don’t want to find the PID, then you can use the pkill command to kill a process by its name:

pkill <process>

The pkill command sends a signal (by default, SIGTERM) to the matched processes, causing them to terminate.

58. What is network bonding in Linux?

Network bonding is the process of creating a single network by combining two or more network interfaces. This combination of networks improves redundancy and performance by increasing bandwidth and throughput. The major benefit of network bonding is that the overall network works fine even if a single network in the bonding does not work properly.

59. What is SELinux?

SELinux or also known as Security-Enhanced Linux, is the security framework. It offers an additional layer of security to improve access control and strengthen security. SELinux was developed to improve the security policies to prevent unauthorized access and exploitation. However, learning about SELinux is essential before working on it can create serious security issues.

60. What is the purpose of the SSH protocol in Linux, and how do you securely connect to a remote server using SSH?

The Secure Shell (SSH) is a protocol in Linux which is used to establish a secure encrypted connection between a local and remote machine. It allows to securely access and manage remote servers. If we want to connect to a remote server using SSH. We can use the following command.

ssh username@remote_ip

Here replace the `username` with the desired username of the remote server and replace the `remote_ip` with the IP address of the remote server.

61. How do you check the contents of a file without opening it in Linux?

In Linux we can use the `cat` command to view the content of a file without opening it in an editor form.

For example: If we want to check content of a file with file_name = `geeks.txt`

cat geeks.txt

62. What is the purpose of the crontab file in Linux, and how do you schedule recurring tasks using cron jobs?

The crontab file in Linux is used to schedule recurring tasks or cron jobs. It contains a list of commands or scripts that are executed at specified time intervals. To edit the crontab file, you can use the crontab -e command. 

For example: If we want to run a script name `jayesh.sh` every day at 5 AM, we can use the following procedure.

First, we need to open the crontab in editorial format.

crontab -e

Secondly, add the entries in the crontab file.

0 5 * * * /path/to/jayesh.sh

63. How do you find and replace text in a file using the sed command in Linux?

The sed command (stream editor) can be used to find and replace text in a file. The basic syntax is sed ‘s/pattern/replacement/g’ filename.

 For example: to replace all occurrences of “true” with “False” in a file

sed 's/true/False/g' file_name

64. What is the purpose of the sudoers file in Linux, and how do you configure sudo access for users?

The sudoers file in Linux controls the sudo access permissions for users. It determines which users are allowed to run commands with superuser (root) privileges. To configure sudo access, you can edit the sudoers file using the visudo command. 

For example:

sudo visudo

Now add this line anywhere in the file. For instance, if we want to grant a user full sudo access.

user_name ALL=(ALL) ALL

65. How do you change the ownership of a file or directory in Linux using the chown command?

In Linux, you can change the ownership of a file or directory using the chown command. The basic syntax is chown new_owner: new_group filename. 

For example: If we want to change the ownership of a file to user “Jayesh” and group “users”.

chown jayesh:users file_name

66. What is the purpose of the ping command in Linux, and how do you test network connectivity to a remote host?

Ping command is used to test the network connectively between the local and remote hosts. It basically sends an ICMP echo request packet to the remote host and waits for the corresponding echo reply packet.

For example: If we want to check the connectivity to a remote host, we use the following command.

ping remote_host_ip

Here replace `remote_host_ip` with the Ip address of the host

67. How do you recursively copy files and directories in Linux using the cp command?

In linxux we can simply use `-R` option with the `cp` command to recursively copy the file and directories.

For example: 

cp -R sourece_durectory destination_directory

68. What is the purpose of the netstat command in Linux, and how do you view network connections and listening ports?

The netstat command in Linux is used to display active network connections, routing tables, and listening ports. To view network connections and listening ports, use the netstat command with appropriate options. 

For example: If we want to display all listening TCP ports, we can use the following command.

netstat -tuln

69. How do you set up a static IP address in Linux using the command-line interface?

To set up a static IP address in Linux using the command-line interface, you need to modify the network configuration file. The location and name of the file may vary depending on the Linux distribution, but commonly it is /etc/network/interfaces. Open the file with a text editor and modify the configuration to set a static IP address, subnet mask, gateway, and DNS servers.

For example: 

iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4

Save the file and restart the network service or reboot the system for the changes to take effect.

70. How to copy a file to multiple directories in Linux?

We can copy a file to multiple directories in Linux by these methods and command xargs, find, tee and shell loop.

  • xargs command on Unix/Linux operating system converts input from standard input into an argument list for a specified command.
  • The command find initiates a search and allows actions to be performed based on the search results.
  • The tee command reads standard input and copies it to both standard outputs and to one or more files.

Linux Admin Interview Questions

71.How are files organized in Linux?

Linux follows a hierarchical file system structure. The root directory is denoted by “/”, and files are organized in directories or folders within the root directory.

72.How can you find the IP address of a Linux system?

The ‘ifconfig’ or ‘ip addr show’ command can be used to display the IP address of a Linux system.

73.What is the distinction between a hard link and a symbolic link in Linux?

A hard link is a direct reference to a file, whereas a symbolic link is a reference to the file’s path. Deleting a hard link does not affect the file, but deleting a symbolic link breaks the link between the file and its path.

74.How do you check the amount of disk space being used in Linux?

The ‘df’ command displays information about the disk space usage on Linux, including the total, used, and available space on filesystems.

75.How do you start and stop a service in Linux?

The ‘systemctl start <service>’ command is used to start a service, and ‘systemctl stop <service>’ is used to stop a service in Linux.

76.What are common causes of file permission issues in Linux?

Common causes of file permission issues in Linux include incorrect ownership, improper permissions set for users or groups, and conflicts between different users’ permissions.

77.How do you troubleshoot a Linux system that cannot connect to a remote server?

Possible troubleshooting steps include checking network connectivity using tools like ‘ping’, verifying firewall rules, checking DNS settings, and examining relevant log files for error messages.

Linux Troubleshooting Interview Questions:

78.What steps would you take to fix a network connectivity issue in Linux?

Steps would include checking physical connections, verifying IP configuration, checking firewall settings, ensuring DNS resolution is working, and using network troubleshooting tools like ‘ping’, ‘traceroute’, or ‘tcpdump’.

79.How do you check the system logs in Linux?

System logs can be checked using the ‘tail’ or ‘less’ command to view the contents of log files located in the ‘/var/log’ directory, such as ‘syslog’, ‘messages’, or ‘auth.log’.

80.What are the possible reasons for a Linux system running out of memory?

Possible reasons include memory leaks in applications, excessive memory usage by running processes, inadequate memory allocation, or high memory demands from large datasets.

81.How would you troubleshoot a slow-performing Linux server?

Troubleshooting steps might involve checking system resource usage with tools like ‘top’ or ‘htop’, monitoring disk I/O, analyzing network traffic, identifying memory or CPU bottlenecks, and reviewing application logs.

82.What are common causes of a Linux system running out of disk space?

Common causes include large log files, excessive data storage, uncontrolled growth of temporary files, improper cleanup of old files, or runaway processes generating excessive output.

83.How can you identify and terminate a process that is using a lot of CPU in Linux?

The ‘top’ or ‘htop’ command can display the processes using the most CPU. To terminate a process, the ‘kill’ command followed by the process ID (PID) can be used.

84.How would you troubleshoot a Linux system that cannot boot up?

Troubleshooting steps might include checking hardware connections, verifying BIOS/UEFI settings, booting into a recovery mode or live system, analyzing boot logs, and diagnosing disk or file system errors.

Linux Networking Interview Questions:

85.What does the ‘ifconfig’ command do in Linux?

The ‘ifconfig’ command is used to configure or display network interfaces in Linux. It can be used to view or modify IP addresses, netmasks, and other network interface parameters.

86.How do you set up a fixed IP address in Linux?

A fixed IP address can be set up in Linux by editing the network configuration file (e.g., ‘/etc/network/interfaces’ or ‘/etc/sysconfig/network-scripts/ifcfg-<interface>’) and assigning the desired IP address to the interface.

87.How do you configure a DNS server in Linux?

DNS server configuration involves editing the ‘/etc/named.conf’ (BIND) or ‘/etc/named/named.conf.options’ (ISC BIND) file to specify the server’s zone information, name resolution options, and defining forwarders or root hints.

88.What is a firewall in Linux, and how do you set it up?

A firewall is a network security system that filters and controls network traffic. In Linux, ‘iptables’ or newer ‘nftables’ can be used to set up firewall rules by defining filtering criteria, network zones, and desired actions.

89.How do you check the network connectivity between two Linux systems?

Network connectivity between two Linux systems can be checked using tools like ‘ping’ or ‘traceroute’, which send packets to the target system and report on the round-trip time and the path taken.

90.What is the purpose of the ‘route’ command in Linux?

The ‘route’ command is used to view or modify the IP routing table on a Linux system. It displays information about the network routes and allows adding or deleting routes.

91.How do you configure a Linux system to act as a router?

To configure a Linux system as a router, IP forwarding must be enabled by setting the appropriate value in the ‘/proc/sys/net/ipv4/ip_forward’ file. Additionally, network interfaces and routing tables need to be configured accordingly.

Thursday, 25 April 2024

TOP 30 AWS Interview Questions And Answers

1) What is the Amazon Web Service?

Answer: Amazon Web Service (AWS) is a public cloud or a server farm managed and maintained by Amazon. The storage and computing power of these servers are offered on a lease as a managed service for pay per use basis.

Q #2) What is cloud computing?

Answer: Cloud computing is IT resources such as infrastructure, platform, or software as their services are used over the Internet with a pay-per-use basis. Cloud service providers are the companies that have public cloud or data centers who offer services like compute, storage, database, operations, migration, messaging, and analytics services.

The leading cloud service providers are AWS, Microsoft Azure, Google Cloud Platform, IBM Cloud, Rackspace, Verizon Cloud.

Cloud service providers

Q #3) What are the different types of cloud computing?

Answer: There are three main types of cloud computing offered as services by the service providers.

These are as follows:

  • Infrastructure as a Service (IaaS) provides basic building blocks such as virtual or dedicated hardware in the form of computers, data storage space as well as networking access in the form of IT infrastructure on a pay as per use basis to customers eliminating initial and ongoing expenses after purchasing infrastructure, space, and maintenance, but only to focus on business improvement and improving applications built by these companies.
  • Platform as a Service (PaaS) offers managing hardware and operating systems for the customers and focusing on deploying their products, eliminating initial and ongoing expenses after purchasing infrastructure, space, and maintenance.
  • Software as a Service (SaaS) offers complete management of end-user applications along with management of infrastructure supporting these applications, for the companies as their service offerings.

Q #4) What benefits organizations will have in moving to cloud computing?

Answer: Organizations moving their infrastructure and applications to the public cloud will have the following benefits:

  • Scalability: Cloud allows scale up or down based on usage, you only need to pay per use for the computing and storage perspective.
  • Reliability: Cloud providers offer the reliability of their infrastructure up to 99.999999%, with provision for multiple levels of redundancy and backups in case it is needed.
  • Security: Most cloud providers are compliant with industry-level security protocols like HIPAA, PCI, offer access restrictions to applications and systems at multiple levels and monitoring services at a very granular level to trigger alarms.
  • Cost Efficiency: Moving to the cloud for startup companies offers benefits of cost savings by differing from investing in expensive servers, managing, and maintaining them. Every month, companies have to pay only for the computing power and storage that are utilized by them during the month.

Q #5) What are the main features of Amazon Web Services (AWS)?

Answer: Main features of AWS are listed below:

  • Data Management and Data Transfer
  • Compute & Networking
  • Storage
  • Automation and Orchestration
  • Operations and Management
  • Visualization
  • Security and Compliance

Q #6) Explain the main components of Amazon Web Services.

Answer: Main components of AWS are described below:

  • Route 53: It is a highly scalable Domain Name System (DNS) web service. It helps to route end users to Internet applications by masking names like www.portalname.com to its numeric IP address like 192.168.0.1.
  • Simple Storage Service (S3): It is a highly scalable, fast, inexpensive, and reliable data storage interface from Amazon web services used by many large organizations.
  • Simple E-mail Service (SES): This is a hosted email service that uses Restful API call or via SMTP, for sending the notification, marketing, and transaction-related messages.
  • Identity and Access Management (IAM): It is Identity and security management services for AWS account holders. It allows us to create and manage users, user groups thereby allow or deny access to AWS resources.
  • Elastic Compute Cloud (EC2): It is the central ecosystem of AWS, responsible for on-demand and flexible computing resources. EC2 will help to configure security, networking, and storage and launch virtual servers as per need.
  • Elastic Block Store (EBS): It offers a continuous storage system, which can be viewed in the instance as a hard drive. EBS helps create storage volumes and attach to Amazon EC2 instances.
  • CloudWatch: It gathers key metrics and sets a series of alarms to inform users, in case there is trouble. Using CloudWatch, administrators can monitor multiple resources and instances from a single console such as virtual instances in EC2, Databases in RDS, Data stored in S3, Elastic Load Balancer, and Auto Scaling groups.


Q #7) What are the differences between Amazon S3 and EC2?

Answer: Differences between Amazon S3 and EC2 are described in the below table:

Elastic Compute Cloud (Amazon EC2)Simple Storage Services (Amazon S3)
EC2 is a cloud hosting toolS3 is a cloud storage tool
EC2 is pay per use web service that deploys applications on Amazon public cloud servers for their compute power.S3 is a storage with massive capacity to store anything from documents, movies, applications, images, objects (BLOB)
Amazon EC2 allow selection of multiple instances, operating system, software, configuration of memory, CPU, storage and boot partition as well as commissioning of thousands of server instances within minutes if required to scale up or scale down the application load.Amazon S3 allows storage of objects. Objects are stored in a bucket that can be retrieved by developer-assigned key; This bucket can be stored in one of several regions across the globe.

Q #8) What are the main features of the Amazon EC2 instance?

Answer: Various Amazon EC2 features are described below:

  • Elastic Compute Cloud (EC2) provides virtual computing environments in the form of a virtual server known as instances, requested in the form of a web server for computing in AWS public cloud.
  • EC2 allows pre-configured templates, Amazon Machine Images (AMIs) for instances, that allow package information needed like operating system and additional software for configuring your cloud server.
  • Various instance types like CPU, memory, storage, and networking capabilities can be configured with EC2.
  • EC2 offers secured login information in key pair form, where AWS stores public key as an identity for customers, whereas customers will save the private key for securely logging in the AWS cloud server.
  • Instance store volumes for temporary data, which gets deleted when an instance is stopped or terminated.
  • Persistent storage volume for our data for storage and computing purpose using Elastic Block Store by Amazon known as Amazon EBS volume.
  • Regions and Availability zones give multiple physical locations for resources such as instances and Amazon EBS volumes.
  • Protocols, ports, and source IP ranges to reach the instances can be configured in the form of a firewall.
  • Elastic IP addresses are static IPv4 addresses for dynamic cloud computing.
  • Metadata can be created and assigned to Amazon EC2 resources.
  • Virtual Private Clouds (VPCs) are virtual networks isolated from the rest of the AWS cloud and can be connected to our private network if needed.

Q #9) List possible storage options for Amazon EC2 instance.

Answer: Storage options for Elastic Compute Cloud (EC2) are listed below:

  • Amazon Elastic Block Store (EBS)
  • Amazon EC2 Instance Store
  • Amazon Elastic File System (EFS)
  • Amazon Simple Storage Service (S3)
  • Amazon Glacier


Q #10) What security practices should be followed for Amazon EC2 instance?

Answer: Following security practices are followed for Amazon EC2 instance:

  • Least Access: Managing access to AWS resources and APIs using identity federation, IAM users, and IAM roles.
  • Least Privilege: Implementation of least permissive rules for security groups.
  • Configuration Management: Patch, update, and secure the operating system and applications on an instance regularly.

Q #11) What are the components of AWS Databases?

Answer: AWS Database is mainly composed of the following components:

  • Amazon Relational Database Service (RDS) is a managed service to set up, operate, and scale a relational database in the cloud server. Relation database services have Aurora, PostgreSQL, MySQL, Oracle, SQL Server, and MariaDB as database engines for cloud customers to select as their database. RDS also provides AWS database migration services to migrate and replicate the existing database to Amazon RDS.
  • Amazon Aurora is a distributed, fault-tolerant, self-healing storage system managed by Amazon RDS.
  • Amazon ElasticCache allows seamless setup, run, and scale open source in-memory data stores in the cloud. The features offered by ElasticCache are Caching, Session Stores, Gaming, Geospatial Services, Real-Time Analytic, and Queuing.
  • Amazon DocumentDB: With Amazon DocumentDB it becomes easy to store, query, and index data in JSON format.
  • Amazon DynamoDB is a key-value document database, selected for mobile, web, gaming, ad tech, IoT, and low-latency data access at any scale, for mission-critical workloads.
  • Amazon Keyspaces is database services compatible with Apache Cassandra, scalable, highly available, and serverless.
  • Redshift: It is a cloud data warehouse.
  • Neptune: It is fully managed, highly available, point-in-time recovery graph database services with continuous backup with Amazon S3.
  • Quantum Ledger Database: It is a fully managed ledger database SQL-like API, flexible document data model, with full support for transactions. It is serverless similar to a keyspace.


Q #12) Explain AWS DevOps tools to build and deploy software in the cloud.

Answer: To build and deploy software in the AWS cloud DevOps team uses the following tools:

  • AWS Cloud Development Kit: It is an open-source software development framework for modeling and provisioning cloud application resources with popular programming languages.
  • AWS CodeBuild: It is a continuous integration service that processes multiple builds and tests code with continuous scaling.
  • AWS CodeDeploy: It helps to automate software deployments to any of the on-premises servers to choose from such as Amazon EC2, AWS Fargate, AWS Lambda, etc.
  • AWS CodePipeline: It automates code received through continuous delivery for rapid and accurate updates.
  • AWS CodeStar: It is a user interface that helps the DevOps team to develop, build, and deploy applications on AWS.
  • AWS Device Farm: It works as a testing platform to test applications on different mobile devices and browsers.


Q #13) What is Amazon CloudFront and what does it offer?

Answer: Amazon CloudFront is a highly scaled and globally distributed Content Delivery Network service (CDN), which securely delivers APIs, applications, data, and videos to customers globally. To utilize CDN, various AWS tools such as APIs, AWS management console, AWS CloudFormation, CLIs, and SDKs are used.

Q #14) What do you mean by AWS Global Cloud Infrastructure?

Answer: AWS offers cloud infrastructure to customers across the globe. It is popularly called IaaS (Infrastructure as a service) which offers the customer to use services such as compute, networking, storage, and virtualization services over Amazon’s servers on pay per use basis.

The terms used in global cloud infrastructure are Region, Availability zones, and Edge location. These are explained below:

  • Region: It is geographical subcontinent or region where Amazon has two or more than two availability zones that offer its resources to customers. Customers located across that particular region can avail of Amazon’s cloud services.
  • Availability Zones: These are the city or locations in the region where Amazon has their fully operational, data center(s) that offer all offerings and cloud services to its customers in these zones.
  • Edge Location: This is the location where networking and content delivery resources are available along with other services to the Amazon cloud services such as compute, storage, database, and other services to the customers.

Q #15) What are Amazon’s offerings under AWS Network and Content Delivery Services?

Answer: Under AWS networking and content delivery, it helps connect privately AWS global network by isolating resources and encrypting data thereby delivers customer’s contents with high throughput, lowest latency, or delays.

Amazon offerings in networking and content delivery are listed below:

  • VPC or Virtual Private Cloud is a logically isolated section of Amazon web service, allowing clients to launch AWS resources in a virtual network, select their IP address range, configure subnet with access to Amazon EC2 instances in each subnet, route table, and network gateways.
  • Direct connect helps establish a private connection between the client’s data center and AWS, thereby providing the best bandwidth throughput, better network at reduced charges.
  • Route 53 is a highly scalable Domain Name System (DNS) web service. It helps the developer to set route end users to Internet applications by switching website names to corresponding IP addresses.

Q #16) What Amazon offers under its Compute services?

Answer: AWS compute is a feature of utilizing resources of computing power offered by Amazon in terms of a physical server within their data center by installing and running customer’s applications on a pay per use basis by accessing these resources over the Internet. There are various compute services offered by Amazon based on performance and benefits along with the consumption of these resources over a period.

These offerings are listed below:

  • Amazon’s Elastic Cloud Compute (EC2) allows deploying virtual server instances within the AWS environment. EC2 services can be further categorized based on Amazon Machine Images (AMI), User data, storage options, and security, Instance types, Instance purchasing options, and Tenancy.
  • EC2 Container Service (ECS) are the services that allow running applications that are packaged in the container by Docker (a tool that creates, deploy and run applications by using Linux containers) across a group of EC2 instances, with the help of AWS Fargate – the engine that enables ECS to run applications packed in containers.
  • AWS elastic beanstalk is a managed service that automatically deploys the required resources within AWS once web application code has been uploaded, making web application operational. It includes resources such as EC2, Autoscaling, elastic load balancing, and application’s health monitoring.
  • AWS Lambda is serverless compute service that runs the application without managing EC2 instances.
  • Amazon Lightsail is a web hosting service for simple and small applications or blogs. It can also be connected to other AWS resources as well as existing Virtual Private Cloud (VPC).

Amazon Compute Services

Q #17) Please elaborate on Analytics services offered by Amazon.

Answer: Amazon Analytics provides insights and analytical solutions from different data types that traditional data warehouses cannot provide.

Various analytics solutions offered by Amazon are listed as below:

  • Amazon Athena is an interactive query service that is serverless with no infrastructure to manage for analyzing data present in Amazon S3.
  • Amazon EMR is managed Hadoop framework for big data across Amazon EC2 instances along with other frameworks like Spark, HBase, Presto to interact with data stores such as S3 and DynamoDB.
  • Amazon data pipeline is web services for moving and processing data between computing and storage services of AWS.
  • Amazon Cloud Search is managed service for search, manage and scale searching feature such as highlighting, auto-complete and geospatial search for the web applications,
  • Amazon Elasticsearch services search, analyze, and visualize data in real-time by deploying elastic search API and analytics and integration with open source tools Kibana and Logstash for data ingestion and visualization for Amazon Elastic Search services.
  • Amazon kinesis collection, processing, and analyzing of streaming data such as video and audio, application logs, IoT telemetry data, etc. is done with Amazon Kinesis.
  • Amazon QuickSight is business intelligence services to publish interactive dashboards via browsers or mobile devices giving insights across the organization.

AWS analytics Services

Q #18) What is offered under Migration services by Amazon?

Answer: Amazon migration services customers can make an exact copy of their data from their database system to Amazon’s databases by streaming data to Amazon S3, Aurora, DynamoDB, DocumentDB, or Redshift.

  • Amazon Database Migration Service (DMS) is a tool for migrating data extremely fast from an on-premise database to Amazon Web Services cloud. DMS supports RDBMS systems like Oracle, SQL Server, MySQL, and PostgreSQL in on-premises and the cloud.
  • Amazon Server Migration Services (SMS) helps in migrating on-premises workloads to Amazon web services cloud. SMS migrates client’s server VMware to cloud-based Amazon Machine Images (AMIs),
  • Amazon Snowball is a data transport solution for data collection, machine learning, and processing, and storage in low connectivity environments.


Q #19) What are the different service offerings provided by Amazon under Security Identity and compliance services?

Answer: Amazon Security Identity and compliance services help DevOps team members to have a single point of checkpoint for configuring and prioritizing security alerts, findings.

With Identity and Access Management, Amazon grants or restricts user permission, assign security credentials to individuals.

  • Amazon Identity and Access Management (IAM) help to create and manage secured access to AWS services and resources, granting or restricting user permission to AWS cloud services.
  • Amazon inspector improves security and compliance of applications deployed on Amazon web services on their cloud environment, provide automated security assessment services of any vulnerabilities.
  • AWS WAF is a firewall that allows monitoring (Allow, Block as well verify) HTTP and HTTPS requests sent to Amazon API Gateway API, CloudFront, or Application Load Balancer.
  • AWS certificate manager manages, deploys and provides public and private Secure Sockets Layer (SSL) and Transport Layer Security (TLS) certificates for use with AWS and internal connected resources.


Q #20) List AWS management tools used while using Amazon cloud services?

Answer: There are mainly four categories of management tools available to AWS cloud consumers.

These are:

  • Provisioning tools like Terraform, CloudFormation, RightScale.
  • Operations Management tools like Juju, Ansible, Rex.
  • Monitoring and Logging tools like CFEngine, Sumo Logic, CloudWatch.
  • Managed Services and Configuration tools like Chef, Puppet, NixOS.

Q #21) What is offered under Messaging services by Amazon?

Answer: Amazon messaging services allow cloud customers to communicate between their teams regarding notification, marketing messaging via the SMTP interface of Amazon messaging services.

Different offerings from Amazon include the following:

  • Amazon Simple Notification Service (SNS) is fully managed, secured, available messaging services by AWS that help decouple serverless applications, micro-services, and distributed systems. SNS can be started within minutes from either AWS management console, command-line interface, or software development kit.
  • Amazon Simple Queue Service (SQS) is a fully managed message queues for serverless applications, micro-services, and distributed systems. The advantage of SQS FIFO guarantees single time processing and exact order sent by this kind of messaging service.
  • Amazon Simple Email Service (SES) offers sending and receiving email services for informal, notify, and marketing correspondence via email for their cloud customers through SMTP interface.

Q #22) What facilities are provided under the AWS customer enablement program?

Answer: Various offerings from Amazon are provided under the customer enablement program.

These are explained below:

  • AWS Support offers technical help, guidance on configuration, and assist during installation and implementation thereby improve their performance, save time installing their applications on the cloud.
  • AWS Professional Services assist customers and discuss plans with them to fulfill their business outcomes with the AWS cloud move.
  • AWS IQ is a platform to build technical support from Amazon certified third-party experts for on-demand consultation during their project work.
  • AWS Training and Certification provide training on AWS and cloud-related skills as well as provide a learning platform to achieve the AWS certification program.
  • AWS Managed services operate customer’s cloud infrastructure on behalf of their enterprise customers and partners.

Q #23) What are Amazon Cloud solutions?

Answer: Amazon Cloud solutions are guidance or help to resolve common installation and commissioning difficulties or roadblocks that are encountered using the AWS platform by DevOps teams from Client. AWS team of experts provide deployment guide and instructions on manual as well as the automated deployment of their applications on Amazon’s cloud services.

Q #24) Startup company wishes to move to AWS cloud, has confidential and sensitive client data, for investigation in the application, what do you suggest to manage cloud architecture?

Answer: The company can go for hybrid cloud architecture, which is a combination of public cloud for shared resources and private cloud/server for confidential workloads.

Q #25) You are running on very low project budgets, what would you select as AWS storage solutions?

Answer: Amazon Glacier is of extremely low-cost storage and data archiving and backup services. So, it can be selected.

Q #26) A web application has been created with auto-scaling, the web traffic is highest on Wednesdays and Fridays between 9 AM and 7 PM, as there is the best deal offered on the portal. How would you handle the scaling?

Answer: The Auto-scaling policy can be configured to scale as per the predictable traffic patterns. Further AWS will scale in response to the traffic.

Q #27) Web application to assist the designer of clothing and apparel line is hosted on AWS, which allows users to render images and process computing to predict the number of clothes required. To route incoming user traffic, which one of the following services should you use?

  • Classic Load Balancer
  • Application Load Balancer
  • Network Load Balancer

Answer: The best choice to route incoming user traffic would be Application Load Balancer, as it supports

  • Path-based routing, thereby enhancing the performance of an application.
  • Requests made for rendering images can be directed to the servers whereas requests made for computing to the servers that are deployed for general computing such as EC2.

Q #28) What management tool you would use if you wish to access Amazon Simple storage buckets and utilize the information for access audits?

Answer: AWS Cloud Trail, designed for logging and tracking API calls can be used for such cases.

Q #29) What is the purpose of making subnets?

Answer: Subnets are designed to divide a large network into smaller networks. It will help reduce congestion by routing traffic which increases substantially.

Q #30) Subnet is created and an EC2 instance launched in the subnet with default settings, Explain, which options would be ready to use on EC2 instance as soon as it is launched?

  • Elastic IP
  • Private IP
  • Public IP OR
  • Internet Gateway

Answer: The best option would be Private IP which gets assigned as soon as it is launched.