Linux Admin Interview Preparation with a Checked Exercise

Prepare for a Linux administrator interview by rehearsing short answers, testing one bounded example and explaining the limits of its result. Start with the job’s actual responsibilities, then practise a definition, a demonstration and a follow-up question for each relevant topic. This guide uses a checked hard-link exercise in a new temporary directory.

Aug 28, 2024 - 10:35
Updated: 
102.1k

Linux Administration in IT Infrastructure · Interview preparation

Linux Admin Interview Preparation with a Checked Exercise

Quick answer: Prepare for a Linux administrator interview by rehearsing short answers, testing one bounded example and explaining the limits of its result. Start with the job’s actual responsibilities, then practise a definition, a demonstration and a follow-up question for each relevant topic. This guide uses a checked hard-link exercise in a new temporary directory. It gives you something specific to explain without changing services, users, disks or network settings.

Key takeaways

  • Choose practice topics from the role’s responsibilities and named platform.
  • Predict output before running a small exercise.
  • Explain what the result establishes and what it leaves untested.
  • Rehearse follow-up questions that change one assumption.
  • Label lab work accurately when discussing experience.

Table of Contents

Which questions should you rehearse first?

Turn the job description into a short set of tasks. If the role handles scheduled batch services, practise service states, failed-run evidence and retention decisions before studying an unrelated cluster product. Ask the recruiter which distribution and interview format are relevant when those details are missing.

The NICE Framework overview describes work through tasks, knowledge and skills. You can use that distinction to organise your own preparation: name a task, explain the knowledge behind it and identify an exercise that demonstrates part of the skill. It does not prescribe a Linux interview question list.

For example, a candidate called Meera picks file identity as one rehearsal topic. Her practice question is: “If two names refer to the same file, do I have two independent copies?” She writes her answer before checking it.

How would you answer the hard-link question in one minute?

A hard link is another directory entry for the same underlying file. Within one filesystem, the names share the file’s inode. A symbolic link instead contains a pathname reference, which can cross filesystem boundaries and can refer to a missing target. The GNU ln manual explains these distinctions.

Meera’s opening answer is: “Two hard-link names do not provide an independent backup of the content. I would check the filesystem context and file identity before treating two paths as separate copies.” She then waits for the follow-up instead of reciting every option of the link command.

A useful follow-up asks whether matching inode numbers on unrelated filesystems prove identity. They do not: inode numbers are interpreted with their filesystem or device context. Our exercise keeps both names in the same newly created directory.

What should you predict before the exercise?

Predict that both names will have the same inode in this directory and that each status report will show a link count of two. The GNU stat manual documents the inode and hard-link-count fields used by the format options. A matching content hash alone would answer a different question: separate files can contain identical bytes.

Record the command implementation as well as the shell. BusyBox’s manual explains that its utilities are compact implementations and that included features depend on the build. This exact exercise was checked using an existing Linux BusyBox /bin/sh environment. That check does not establish behaviour for every filesystem or a full GNU installation.

PredictionExpected observationMeaning
File identitySame inode hereBoth names refer to the same file
Link countTwo for each nameTwo hard-link directory entries exist
Backup independenceNot demonstratedNo separate content copy was created

How can you demonstrate the idea without touching existing files?

The script creates a unique directory beneath /tmp and writes one invented note there. It makes a second hard-link name, reads status fields and retains the tiny fixture. Setup and status-read failures stop the script before it reports later results. The GNU mktemp manual explains why creating the directory is preferable to merely predicting an unused name.

The displayed source is the exact checked script. Its changing temporary directory name is intentionally absent from the deterministic output. No existing files are read or removed.

#!/bin/sh
practice_dir=$(mktemp -d /tmp/webasha-440.XXXXXX) || exit 1
printf '%s\n' 'Invented interview practice note' > "$practice_dir/source.txt" || exit 1
ln "$practice_dir/source.txt" "$practice_dir/alias.txt" || exit 1
source_inode=$(stat -c '%i' "$practice_dir/source.txt") || exit 1
alias_inode=$(stat -c '%i' "$practice_dir/alias.txt") || exit 1
if [ "$source_inode" = "$alias_inode" ]; then
    printf '%s\n' 'Same inode in this directory: yes'
else
    printf '%s\n' 'Same inode in this directory: no'
    exit 1
fi
source_links=$(stat -c '%h' "$practice_dir/source.txt") || exit 1
alias_links=$(stat -c '%h' "$practice_dir/alias.txt") || exit 1
printf 'Source link count: %s\n' "$source_links"
printf 'Alias link count: %s\n' "$alias_links"
printf '%s\n' 'Tiny training fixture retained.'

Checked output:

Same inode in this directory: yes
Source link count: 2
Alias link count: 2
Tiny training fixture retained.

Which follow-up questions make the rehearsal worthwhile?

Ask whether changing the content through one name would affect what is seen through the other. Because both names refer to the same file, an in-place content change would be shared. An application that replaces a pathname with a new file can behave differently, so describe the operation before predicting the outcome. We do not perform either change here.

Then change the premise: what if the second item is a symbolic link, or lies on another filesystem? Explain which part of the earlier answer no longer applies. The objective is to practise reasoning through changed conditions, not to memorise the printed numbers.

Meera’s reviewer asks her why two matching hashes would be insufficient. She corrects her earlier worksheet to separate content equality, file identity and backup independence. That correction becomes the next rehearsal target.

How do you extend this method to services and scheduled work?

Use a question that forces you to distinguish two related ideas. For services, ask: “Does enabled mean running?” The systemctl manual distinguishes unit-file enablement from runtime activity. Your answer should name the state being asked about and avoid treating an enablement report as a health check.

For a scheduled task, ask: “Does a timer prove the application completed successfully?” The systemd timer manual describes timer activation of a unit; completion evidence belongs to the triggered work. No service or timer is changed in this rehearsal.

Rehearsal questionAnswer cueUseful follow-up
Is the service enabled?Discuss activation configurationWhat proves it is healthy now?
Did the timer fire?Separate activation from completionWhere is the job result recorded?
Are these independent backups?Check copy and recovery propertiesHave you tested a restore?

How should you review a mock interview?

Use a partner to ask the original question and one changed-condition follow-up. Allow a short opening answer, then record the exact point at which you became uncertain. A list such as “revise Linux” is too broad; “explain inode scope before comparing numbers” gives the next session a clear purpose.

Keep a compact practice note containing the question, prediction, actual result, correction and source. If an exercise used BusyBox, say so. If you only read the service documentation, do not describe that as operating a production service.

Before the interview, prepare your own questions about access boundaries, change review and supervision. The answers help you judge whether the advertised responsibilities match the work you are ready to perform. Rehearsal improves your explanation; it cannot guarantee a particular question or hiring outcome.

Related reading: Everyday Linux operator interview questions; Linux behavioural interview answers.

References

Frequently Asked Questions

Use the role’s tasks and named platform, then select small exercises that let you explain a relevant concept and its limits.

It demonstrates two names for the same file, so it provides no independent content copy or tested recovery capability.

A unique directory keeps the invented note separate from existing files and gives both hard-link names the same filesystem context.

The script retains its tiny training fixture and performs no removal, service change, disk operation or network activity.

The exact script ran in an existing Linux BusyBox /bin/sh environment; it was not a RHEL or full GNU validation.

Compare inode numbers within the correct filesystem or device context, because the same number can appear on different filesystems.

Learn the relevant concepts and one platform well, then check the installed tools and documentation when distribution details differ.

Describe it as a bounded lab exercise, explain the checked result, and reserve production claims for work you actually performed.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Anjali

I am passionate about technology, invention and big challenging tasks on my to- do list. In terms of the work I am doing also at Bunnyshell, I am most passionate about the technologies that we are using., I'm devoted to delivering content that not only informs but also inspires. Whether you need in- depth analysis pieces, educational attendants, or study- provoking opinion pieces, I draft content that resonates with tech suckers and professionals likewise.