Loading...
Linux Interview Questions

Interview questions phase 2

1) How do you fix a corrupted file system using fsck?
Ans:- To fix a corrupted filesystem, unmount it first(umount /dev/sda1), then run fsck -y /dev/sdXN to check and repair errors. After completion, remount and verify(mount /dev/sda1 /mountpoint)

2) What is inode exhaustion, and how do you resolve it?
Ans:- All inodes used → can’t create files. Check df -i, remove unnecessary files, or reformat with more inodes

3) You need to copy a huge file across servers. What’s the fastest way?
Ans:- Use rsync -avP for large files, or tar | ssh / nc for high-speed transfers in LAN

4) Your df -h and dush show different disk usage. Why?
Ans:- df = filesystem usage, du = visible files.Differences appear due to open/deleted files, sparse files, or hidden system files.

5)How do you find out which directory is consuming the most in /var?
Ans:- du -sh /var/* | sort -h → shows which directory uses most space

📌 Switching & VLANs

 
6) What is the difference between a hub, switch, and router?
Ans:- A hub broadcasts all traffic to every device, a switch sends data to the correct port using MAC addresses, and a router connects different networks using IP addresses.

7) What is a VLAN?
Ans:-VLAN is a virtual LAN that segments a physical network into multiple logical networks, improving isolation, security, and management

8) What is VLAN tagging?
Ans:- VLAN tagging adds a VLAN ID to Ethernet frames so switches know which VLAN the traffic belongs to, using IEEE 802.1Q standard

9) What is trunking in networking?
Ans:- Trunking allows a single link to carry multiple VLANs using VLAN tagging, unlike access ports which carry only one VLAN.

10) What is STP (Spanning Tree Protocol)?
Ans:- STP prevents loops in a switch network by blocking redundant paths and allowing a loop-free topology using BPDUs.

11) What is the difference between access and trunk ports?
Ans:- Access ports carry a single VLAN for end devices, while trunk ports carry multiple VLANs using 802.1Q tagging.

12) What is port security in switches?
Ans:-Port security restricts switch ports to allow only certain MAC addresses, preventing unauthorized access and enhancing LAN security

13) What is VTP and how does it work?
Ans:-  VTP automatically propagates VLAN information across switches in the same domain, reducing manual VLAN configuration.

14) What happens when two switches are connected in a loop?
Ans:- If two switches are connected in a loop without STP, it causes broadcast storms, MAC table instability, duplicate frames, and network outages.

15) What are broadcast storms?
Ans:- A broadcast storm is excessive broadcast traffic circulating endlessly in a network, usually caused by loops, leading to congestion and network failure

📌 Routing

16) What is routing?
Ans:- Routing is the process of sending data from one network to another using routers, which choose the best path based on routing tables or protocols.

17) What is the difference between static and dynamic routing?
Ans:- Static routing uses manually configured paths, while dynamic routing automatically learns paths and adapts to network changes using routing protocols

18) What is the difference between RIP, OSPF, and EIGRP?
Ans:-

  • RIP(Routing Information Protocol) is a simple distance-vector protocol using hop count,
  • OSPF(Open Shortest Path First) is a link-state protocol using cost for faster convergence,
  • EIGRP(Enhanced Interior Gateway Routing Protocol) is an advanced Cisco hybrid protocol using multiple metrics for efficient routing

19) What is a routing table?
Ans:- A routing table is a database in a router or host that stores information about network paths. It tells the device where to forward data packets based on the destination IP address.

20) What is administrative distance?
Ans:- Administrative Distance (AD) is a value that routers use to rank the trustworthiness of different routing sources. Lower AD means the route is more preferred

21) What is the difference between IGP and EGP?
Ans:-  IGP(Interior Gateway Protocol) is used for routing inside an autonomous system (like OSPF, EIGRP), while EGP(Exterior Gateway Protocol) is used for routing between autonomous systems, mainly BGP(Border Gateway Protocol)

22) What is the purpose of a routing protocol?
Ans:- The purpose of a routing protocol is to allow routers to automatically discover, share, and select the best paths for forwarding data across networks.

23)What is BGP and where is it used?
Ans:-BGP (Border Gateway Protocol) is an Exterior Gateway Protocol used to exchange routing information between different autonomous systems (AS) on the internet. It’s called the protocol of the internet because it decides how data travels between ISPs and large networks.

24) Explain the route summarization.
Ans:- Route summarization is the process of combining a group of continuous IP networks into a single summarized route. This reduces the size of the routing table and improves efficiency.

25) What is the difference between inter-VLAN and intra-VLAN routing?
Ans:- Intra-VLAN routing is communication within the same VLAN, while inter-VLAN routing is communication between different VLANs, which requires a router or Layer 3 switch.

Leave a Reply

Your email address will not be published. Required fields are marked *