Find a definition, example or interview question. Looking something up does not change your lesson draft.
648 matching entries
File
Named data kept so it can be found and used again.
Example: A saved note called packing.txt contains a packing list.
Common confusion and a question to try
The editor is the tool; the file is the data it opens.
Which part is the data in Trip/packing.txt?
Folder
A container used to organize files and other folders.
Example: Trip contains packing.txt and route.txt.
Common confusion and a question to try
A folder groups files; it is not the text inside a note.
In Trip/packing.txt, which component is the folder?
Application
A program used to perform a task, such as editing notes or viewing web pages.
Example: The virtual editor application opens a saved note.
Common confusion and a question to try
Closing an application does not ordinarily delete its saved files.
What is the tool in the note-editing example?
Browser
An application for retrieving and displaying web content.
Example: A browser displays this course.
Common confusion and a question to try
A browser can display local or remote content; its name alone does not locate data.
Does viewing a file in a browser establish where it is stored?
Editor
A tool for changing text, including notes and source code.
Example: Change Ready. inside a quoted string in the source editor.
Common confusion and a question to try
The text currently visible may include unsaved edits.
What could differ between the editor and a reopened file?
Terminal
A text interface commonly used to interact with a shell and programs.
Example: Later lessons use a terminal to enter shell commands.
Common confusion and a question to try
A terminal provides the interface; the shell interprets commands.
Which part is the interface and which part interprets a command?
Shell
A program that interprets commands and can launch other programs.
Example: A shell receives a command through a terminal.
Common confusion and a question to try
The shell is not the same thing as the terminal window or JavaScript runner.
Could different shells use a terminal interface?
Source code
Instructions expressed as text in a programming language.
Example: console.log("Hello!"); is source for a print instruction.
Common confusion and a question to try
Source is the instruction; Hello! is its output.
Which characters belong to the source but are absent from this printed value?
Output
Data or a result produced by an operation or program.
Example: Printing a Hello! string produces the output entry Hello!.
Common confusion and a question to try
An old result describes the source that produced it, not later edits.
What needs to happen after a source edit to obtain current output?
String
A value representing text, which may contain letters, spaces or punctuation.
Example: "Gate open" represents the text Gate open.
Common confusion and a question to try
Quotation delimiters describe a string in source; they are not automatically part of its value.
Is the space in Gate open part of the value?
Quotation mark
A character that can mark a string boundary in source code. Ordinary single or double quotes delimit the strings taught here.
Example: "Ready" and 'Ready' represent the same plain text.
Common confusion and a question to try
Matching straight quotes work here; curly presentation quotes are not equivalent delimiters.
Why must the opening and closing delimiter styles match?
Syntax
The rules governing how a valid instruction is written.
Example: A missing closing quote prevents the intended string call from parsing.
Common confusion and a question to try
Valid syntax can still print the wrong requested words.
Can a program run successfully and still fail its brief?
Statement
An instruction within a program. The supported print calls here are expression statements.
Example: Two console.log calls execute in their source order.
Common confusion and a question to try
Two words within one string are not two statements.
How many statements print Pack and Leave on separate output entries?
RAM
Random access memory holds active working data while a computer runs. Ordinary system RAM is temporary; it does not preserve unsaved work when power is lost.
Example: An open editor uses RAM for its working text.
Common confusion and a question to try
RAM use and free storage are different measurements. Closing an app can reduce RAM use without deleting files.
Which resource holds working data and which keeps the saved copy?
Storage
The place that keeps saved data so it can be read later, including after an application closes.
Example: A saved note remains on storage after its editor closes.
Common confusion and a question to try
A full storage device and high memory pressure are different problems.
What evidence would you check when a save reports storage full?
Local
On the computer or environment named as the reference point.
Example: A note saved on your laptop is local to that laptop.
Common confusion and a question to try
Local does not mean independently trusted; device owners can change local data.
Relative to your computer, where is a downloaded copy?
Remote
On another computer reached through a connection, relative to the stated computer.
Example: A note stored on a website server is remote to your laptop.
Common confusion and a question to try
Displaying remote data does not by itself prove a local saved copy exists.
Where does the supplied map say the data is held?
Backup
A separate saved copy kept to help recover data.
Example: A supplied backup restores a note’s earlier text.
Common confusion and a question to try
A backup can recover its captured content, not unsaved edits it never included.
What should you inspect before replacing a file with a backup?
Argument
A value supplied to an operation or function call.
Example: The string Hello! is the one argument in console.log("Hello!");.
Common confusion and a question to try
The call’s parentheses contain the argument; the printed value does not include those parentheses.
What value is supplied inside the call?
Error
A reported failure or problem during an operation.
Example: The runner reports a syntax error for an unterminated string.
Common confusion and a question to try
An error message is evidence to investigate; one failure does not prove every possible cause.
What exact message and source line would you record?
Path
A location expressed through a sequence of names. In this course, relative paths begin inside the virtual workspace.
Example: Practice/first-note.txt means that file inside Practice.
Common confusion and a question to try
A filename alone may not distinguish copies in different folders.
Why include the folder when describing a saved file?
Value
One piece of data a program works with: a number, a string of text, a boolean, or null.
Example: 4, "Muffin" and true are three values.
Common confusion and a question to try
A variable is a name; a value is what the name holds.
What is the value in const price = 4;?
Variable
A name that holds a value so the program can use it again by name.
Example: const price = 4; then price * 3 is 12.
Common confusion and a question to try
The variable name is not printed; console.log(price) prints the value it holds.
Why is price * quantity printed as 12 and not as the words price * quantity?
const
Declares a variable whose value is set once and cannot be reassigned.
Example: const price = 4; price = 5; fails: price was declared with const.
Common confusion and a question to try
const does not mean the value is secret or special; it means the name will not be reassigned.
When would you choose let instead of const?
let
Declares a variable whose value may be reassigned later.
orders is a list; orders[0] is a record; orders[0].name is a value. Read left to right.
What is orders[1].quantity in the example?
find
An array method that returns the first item for which the test function is true, or undefined when none matches.
Example: orders.find(order => order.name === "Rye") is the Rye record itself.
Common confusion and a question to try
find returns one item; filter returns a list. Reading .name on a filter result fails because it is a list.
What does find give back when nothing matches?
reduce
An array method that folds a list into one value by calling a function with the running result and each item, starting from a given value.
Example: [3, 5, 8].reduce((total, q) => total + q, 0) is 16.
Common confusion and a question to try
Without a starting value, reduce uses the first item as the running result; with records that causes an error when the function tries to add to it.
What are the two parameters of the function given to reduce?
Initial value
The starting value handed to reduce as its second argument, such as 0 for a total or orders[0] for a largest record.
Example: orders.reduce((total, order) => total + order.quantity, 0)
Common confusion and a question to try
Choose the initial value so the running result has the right type from the first pass: a number for totals, a record for a best record.
Why does a revenue reduce start at 0?
Conditional operator
A one-line if: test ? valueIfTrue : valueIfFalse. It is an expression, so it can sit inside a return or a reduce.
Example: order.quantity > best.quantity ? order : best
Common confusion and a question to try
It chooses one of two values; it does not run two blocks of statements the way if…else does.
Write a conditional expression that gives "large" when q is 10 or more and "small" otherwise.
Command line
A text interface: you type a command and its arguments, press Enter, and read what it prints.
Example: ls Documents lists the Documents folder.
Common confusion and a question to try
The terminal is the window; the shell is the program inside it that reads your commands.
What are the two parts of the line cat notes.txt?
Prompt
The text the shell shows while waiting: user, computer name and current folder, ending in $.
Example: sam@practice:~/logs$ means user sam on practice, inside ~/logs.
Common confusion and a question to try
The prompt is information, not something you type.
In sam@practice:~$, which part is the folder?
Home folder
Your own folder on the computer, /home/yourname on Linux. The shell writes it as ~.
Example: cd on its own returns to ~.
Common confusion and a question to try
~ is shorthand the shell expands; it is not a folder literally called ~.
What full path does ~ stand for when the user is priya?
Working directory
The folder you are currently in. pwd prints it; relative paths start from it.
Example: After cd logs, the working directory is /home/sam/logs.
Common confusion and a question to try
Reading a file does not change the working directory; only cd does.
What command prints the working directory?
Absolute path
A path that starts at the root /, such as /home/sam/logs/app.log. It means the same thing from any folder.
Example: cat /home/sam/notes.txt works from anywhere.
Common confusion and a question to try
A path starting with / is absolute; one without is relative to where you are.
Is Documents/plan.txt absolute or relative?
Relative path
A path measured from the working directory: Documents/plan.txt, or ../notes.txt for the parent folder.
Example: From /home/sam, cat Documents/plan.txt opens /home/sam/Documents/plan.txt.
Common confusion and a question to try
.. is the parent folder and . is the current one; both are relative.
From /home/sam/logs, what does ../notes.txt point to?
ls
Lists the names in a folder. ls -l adds sizes and permissions; ls -a includes hidden names that start with a dot.
Example: ls logs/archive
Common confusion and a question to try
ls shows names, not contents; cat shows contents.
Which flag makes ls show hidden files?
cd
Changes the working directory. cd folder goes in; cd .. goes up; cd alone goes home.
Example: cd Documents then pwd prints /home/sam/Documents.
Common confusion and a question to try
cd is case-sensitive: cd documents fails when the folder is Documents.
What does cd .. do?
cat
Prints the contents of one or more files to the screen.
Example: cat notes.txt
Common confusion and a question to try
cat prints the whole file; head and tail print the start or end.
How do you print two files one after the other?
mkdir
Creates a folder. mkdir -p also creates missing parents.
Example: mkdir logs/archive
Common confusion and a question to try
mkdir a/b fails if a does not exist unless you add -p.
What does mkdir -p do that mkdir does not?
touch
Creates an empty file, or updates the modified time of one that exists.
Example: touch Projects/todo.txt
Common confusion and a question to try
touch makes files; mkdir makes folders.
What does touch do to a file that already exists?
mv
Moves or renames: mv what where. The last argument is the destination; a trailing slash marks it as a folder.
Example: mv logs/app.log logs/archive/
Common confusion and a question to try
Reversing the arguments tries to move the folder to the file's name.
How do you rename report.txt to final.txt with mv?
cp
Copies a file: cp what where. The original stays. cp -r copies a folder.
Example: cp notes.txt Documents/notes-copy.txt
Common confusion and a question to try
cp keeps the source; mv removes it.
After cp a b, does a still exist?
rm
Deletes a file immediately and permanently. rm -r deletes a folder and everything inside it.
Example: rm Downloads/setup.log
Common confusion and a question to try
There is no recycle bin. ls before and after rm.
What is the safe habit around rm?
grep
Prints the lines of a file that contain a pattern. -c counts them, -i ignores case, -n shows line numbers.
Example: grep ERROR logs/app.log
Common confusion and a question to try
grep is case-sensitive: error does not match ERROR without -i.
Which grep flag prints a count instead of lines?
wc
Counts lines, words and characters. wc -l prints the line count followed by the file name.
Example: wc -l logs/app.log prints 8 logs/app.log.
Common confusion and a question to try
Reading from a pipe, wc -l prints the number alone with no file name.
What does wc -l print for a twelve-line file called x.log?
Pipe
The | character sends one command's output into the next command's input.
Example: cat app.log | grep ERROR | wc -l
Common confusion and a question to try
A pipe connects output to input; > sends output to a file instead.
Describe what each stage of cat log | grep WARN | wc -l does.
Redirection
Sending a command's output to a file: > replaces the file, >> appends to it.
Example: grep ERROR app.log > errors.txt
Common confusion and a question to try
> silently replaces an existing file; use >> to add.
What is the difference between > and >>?
Flag
An option that changes how a command behaves, written with a dash: ls -l, grep -c, wc -l.
Example: grep -i error app.log ignores case.
Common confusion and a question to try
Flags belong to the command they follow; -l means different things to ls and wc.
What does -c mean for grep?
Case sensitivity
Upper and lower case are different characters to the shell: Documents is not documents, ERROR is not error.
Example: cd documents fails when the folder is named Documents.
Common confusion and a question to try
Windows file names ignore case; Linux and the practice shell do not.
Why does grep error print nothing on a log that says ERROR?
Log line
One line of a log file, usually a level (INFO, WARN, ERROR), a source and a message.
Example: ERROR db-1 disk 91% full
Common confusion and a question to try
A log is a plain text file; every tool in this lesson reads it line by line.
Which part of a log line does grep ERROR match?
split
A string method that cuts text at every occurrence of a separator and returns an array of the pieces, without the separator.
Example: "web-1,ERROR,disk 91%".split(",") is [ 'web-1', 'ERROR', 'disk 91%' ].
Common confusion and a question to try
The separator is not kept, and the result is an array, so its pieces are read by index from 0.
How many items does "a,b,c".split(",") hold?
trim
A string method that returns the same text without the whitespace at its start and end.
Example: " error ".trim() is error.
Common confusion and a question to try
trim returns a new string; the original still has its spaces. It never removes spaces in the middle of the text.
What is " ok ".trim().length?
toUpperCase and toLowerCase
String methods that return the text with every letter as a capital, or every letter in lower case, leaving digits and punctuation as they are.
Example: "warn".toUpperCase() is WARN; "Disk 91%".toLowerCase() is disk 91%.
Common confusion and a question to try
They return a new string rather than changing the variable; use the result directly in the comparison or store it with level = level.toUpperCase().
Rewrite level === "ERROR" so it also matches error.
includes and startsWith
String methods that ask a yes-or-no question and return a boolean: does the text contain this piece anywhere, does it begin with this piece.
Example: "disk 91%".includes("disk") is true; "web-1".startsWith("db") is false.
Common confusion and a question to try
Both are case-sensitive, and both return true or false, not the position of the match.
What does "web-1,ERROR".startsWith("web") give?
Substring and slice
A piece of a string. slice(start, end) returns the characters from index start up to, but not including, end; with no end it runs to the end of the string.
Example: "web-1,ERROR".slice(0, 5) is web-1; "disk 91%".slice(5) is 91%.
Common confusion and a question to try
The end index is not included, and characters are counted from 0, so slice(0, 5) is five characters.
What does "ERROR".slice(1, 3) give?
Whitespace
Characters that show as empty space: the space, the tab and the newline. They count toward length and make two strings unequal.
Example: " error ".length is 7, not 5.
Common confusion and a question to try
Whitespace is invisible in output but real in the data; trim removes it from the ends of a string.
Why is "ERROR " not equal to "ERROR"?
Line
One row of a text, ended by a newline character. split("\n") turns a text into an array of its lines.
Example: "a\nb".split("\n") gives two lines, a and b.
Common confusion and a question to try
A line is still one string with its commas inside; splitting it into fields is a second split.
How many splits does it take to read the level of every line?
Newline
The character that ends a line. In a string it is written \n: a backslash and an n that together mean one character.
Example: "a\nb" prints as a on one line and b on the next.
Common confusion and a question to try
\n is one character, not two, and split("\n") removes it from the pieces. A text that ends with a newline splits into a final empty string.
What is the last item of "a\nb\n".split("\n")?
Field
One value inside a line, separated from the others by a delimiter. After split(",") the fields are the items of the array, counted from 0.
Example: In web-1,ERROR,disk 91% the fields are the host at index 0, the level at 1 and the message at 2.
Common confusion and a question to try
Fields count from 0 like any array, so the second field is fields[1]. Writing 2 for the second field is an off-by-one error.
Which index holds the level in host,level,message?
CSV
Comma-separated values: a plain-text format where each line is a record and commas separate its fields.
Example: web-1,ERROR,disk 91% is one CSV row with three fields.
Common confusion and a question to try
A real CSV file can contain quoted fields with commas inside; this chapter uses simple rows where every comma is a separator.
Why does splitting a CSV row on the comma give an array?
Delimiter
The character that separates pieces in a text: the comma between fields, the newline between lines.
Example: split(",") uses the comma as the delimiter; split("\n") uses the newline.
Common confusion and a question to try
The delimiter is dropped by split; it is never the first or last item of the result.
Which delimiter separates the lines of a log text?
continue
A statement inside a loop that ends the current pass at once and moves on to the next item.
Example: if (line === "") { continue; } skips a blank line before it is split.
Common confusion and a question to try
continue skips one pass; break would leave the loop entirely. Code after continue in the same block does not run for that item.
What happens to the lines after a blank one when the loop uses continue?
Object accumulator
An object used to keep one count per name met in a loop: start a missing slot at 0, then add to it.
It gives the names, not the counts; read each count with counts[host] inside a loop over the keys.
How do you print one report line per host from a counts object?
Report
Printed output that summarises data for a person: a heading, one line per group and often a total.
Example: Error report, then web-1: 2, then db-2: 1, then Total: 3.
Common confusion and a question to try
A report that runs without errors can still be wrong; check its numbers against the data before trusting it.
What are the two kinds of line a per-host report prints?
Utility
A small program that does one useful job from start to finish. This course builds 24 of them; utility 1 runs in the browser on fixed input.
Example: The log report reads fixed log text and prints how many ERROR lines each host wrote.
Common confusion and a question to try
Running in the browser on fixed text is the first step, not the whole job: a later version reads a real file and takes its input from outside.
What does utility 1 of 24 take as its input?
Hidden input
Input the checkpoint gives your function that you did not see while writing it. A function that reads its answer from the input works; one that copies the example does not.
Example: countErrors is checked with an empty log, a log that ends with a newline and a log whose levels are in lower case.
Common confusion and a question to try
Passing the example in the lesson proves the code works for that text; hidden input checks that it works for that shape of text in general.
Name two log texts that a countErrors function should handle without being shown them.
HTML
The language of web pages: text marked up with tags that say what each piece is, such as a heading, a paragraph or a link.
Example: <p>Fresh bread every morning.</p>
Common confusion and a question to try
HTML describes structure; CSS describes appearance. A page needs HTML first.
What does a tag tell the browser?
Element
One piece of a page: an opening tag, its content, and a closing tag. Some elements, like img, have no content and no closing tag.
Example: <h1>Corner Bakery</h1> is one element.
Common confusion and a question to try
The tags are not shown; the content is. A visible tag means it was typed wrong.
Name the three parts of <p>Hi</p>.
Tag
The marker in angle brackets that opens or closes an element: <ul> opens a list and </ul> closes it.
Example: <li>Rye</li> has an opening and a closing tag.
Common confusion and a question to try
A closing tag starts with a slash. Forgetting it makes the browser guess where the element ends.
Which tag closes an h1?
Attribute
Extra information written inside an opening tag as name="value", such as href on a link or alt on an image.
Example: <a href="menu.html">Full menu</a>
Common confusion and a question to try
Put values in quotes so spaces stay inside them. Attributes never go in the closing tag.
Which attribute holds a link's address?
Nesting
Placing elements inside other elements. An element opened inside another must be closed before the outer one closes.
Example: <p><strong>Fresh</strong> bread</p>
Common confusion and a question to try
<p><strong>Fresh</p></strong> is crossed: the inner element must close first.
Which closes first in <ul><li>Rye</li></ul>?
Heading
An h1 to h6 element that titles a section. h1 is the page's main heading; use one per page.
Example: <h1>Corner Bakery</h1>
Common confusion and a question to try
The title element names the browser tab; the h1 is shown on the page.
How many h1 elements should a page have?
Paragraph
A p element holding a block of running text.
Example: <p>Fresh bread every morning.</p>
Common confusion and a question to try
A paragraph holds text and inline elements like strong or a; it does not hold headings or lists.
Can a p contain an h2?
Unordered list
A ul element holding li items shown as bullets. ol is the numbered version.
Example: <ul><li>Rye</li><li>Bagel</li></ul>
Common confusion and a question to try
The ul is the list; each item needs its own li inside it.
What goes directly inside a ul?
List item
An li element: one entry in a ul or ol.
Example: <li>Sourdough</li>
Common confusion and a question to try
An li must sit inside a list element; on its own it is a mistake the browser tolerates.
Write a list item for Bagel.
Link
An a element with an href attribute. Its content is what the reader clicks; href is where the browser goes.
Example: <a href="menu.html">Full menu</a>
Common confusion and a question to try
The text and the address are independent; a link can say one thing and go somewhere else.
What is missing from <a>Full menu</a>?
href
The attribute on a link that holds the destination address, relative (menu.html) or absolute (https://example.com).
Example: href="signup.html"
Common confusion and a question to try
Without href, an a element is not a link at all.
Is href written on the opening or the closing tag?
Alt text
The alt attribute on an image: words that stand in for the picture for screen readers, text browsers and failed loads.
Example: <img src="loaf.png" alt="A loaf of rye bread">
Common confusion and a question to try
Describe what the image shows or does, not the word image. Decorative images get alt="".
Who reads alt text?
Title element
The title element inside head. It names the browser tab and the bookmark; it is not shown on the page.
Example: <title>Corner Bakery</title>
Common confusion and a question to try
title goes in head; h1 goes in body. They are often the same words but do different jobs.
Where does the title element live?
head and body
The two parts of html: head holds information about the page (title, style); body holds what is shown.
Nothing in head is displayed; everything visible goes in body.
Which part holds the style element?
Semantic element
An element whose name says what its region is for: header, main, footer, nav, article. They look plain but give tools the page's shape.
Example: <main>…</main>
Common confusion and a question to try
A div is a box with no meaning; main tells a screen reader where the content starts.
Name the three regions used in this lesson.
CSS
Cascading Style Sheets: rules that change how elements look, written in a style element or a separate file.
Example: h1 { color: navy; }
Common confusion and a question to try
CSS chooses elements with selectors and sets properties; it cannot add content or structure.
What does a CSS rule consist of?
CSS rule
A selector followed by a block of declarations in braces: h1 { color: navy; }.
Example: .price { font-weight: bold; }
Common confusion and a question to try
Each declaration ends with a semicolon; each rule ends with a closing brace.
Write a rule that makes every p blue.
Selector
The part of a rule that chooses elements: a tag name (h1), a class (.price) or an id (#menu), possibly combined (main p).
Example: .urgent selects every element with class urgent.
Common confusion and a question to try
A class selector needs the dot; price alone looks for an element named price.
How do you select elements with class note?
Declaration
One property and its value inside a rule: color: navy;
Example: font-size: 1.25rem;
Common confusion and a question to try
A colon separates property from value; a semicolon ends the declaration.
What separates the property from the value?
CSS property
The thing a declaration changes, such as color, font-size, font-weight or margin.
Example: font-weight: bold;
Common confusion and a question to try
Property names are fixed words; colour is spelled color in CSS.
Which property changes text size?
Class attribute
A label on an element, class="price", so a rule can select every element with that label using .price.
Example: <span class="price">3</span>
Common confusion and a question to try
Many elements can share a class; an id must be unique on the page.
What selector matches class="lead"?
Cascade
The order rules are applied. When rules of equal weight set the same property, the later one wins.
Example: h1 { color: navy; } h1 { color: red; } gives a red heading.
Common confusion and a question to try
Later wins only among equally specific rules; a more specific selector beats a later plain one.
Two identical selectors set color; which wins?
Style element
A style element in the head holding CSS rules for this page.
Example: <style>h1 { color: navy; }</style>
Common confusion and a question to try
style goes in head; a style attribute on one element is a different, narrower tool.
Where does the style element belong?
Table
Rows of the same shape stored under a name, such as tickets. Each row is one thing; each column is one fact about it.
Example: tickets has the columns id, host, level, opened_day and minutes.
Common confusion and a question to try
A table is not a spreadsheet tab: every row has the same columns and every column has one type.
What is one row of the hosts table?
Row
One record in a table: one ticket, one host. A query returns rows.
Example: 1 | web-1 | ERROR | 1 | 45 is one row of tickets.
Common confusion and a question to try
Rows have no fixed order until ORDER BY gives them one.
How many rows does SELECT * FROM hosts return?
Column
One named fact shared by every row, with a type: host is text, minutes is an integer.
Example: SELECT host, minutes picks two columns.
Common confusion and a question to try
Selecting columns changes what comes back per row; WHERE changes which rows come back.
Which clause picks columns?
Query
A question written in SQL, such as SELECT … FROM … WHERE …, ending in a semicolon.
Example: SELECT host FROM tickets WHERE level = 'ERROR';
Common confusion and a question to try
A query reads; INSERT, UPDATE and DELETE change data.
What ends a SQL statement?
SELECT
The clause that names the columns to return, in the order written. * means every column.
Example: SELECT id, host FROM tickets;
Common confusion and a question to try
SELECT chooses columns, not rows; rows are chosen by WHERE.
What does SELECT * return?
WHERE
The clause that keeps only the rows for which a condition is true. Text values need single quotes; numbers do not.
Example: WHERE level = 'ERROR' AND minutes >= 20
Common confusion and a question to try
WHERE runs before grouping; HAVING runs after.
Why does WHERE level = ERROR fail?
ORDER BY
The clause that sorts the returned rows by one or more columns, ASC (default) or DESC.
Example: ORDER BY minutes DESC, host
Common confusion and a question to try
Without ORDER BY the order is not promised; do not rely on it.
How do you sort largest first?
LIMIT
The clause that keeps only the first N rows after sorting.
Example: ORDER BY minutes DESC LIMIT 3
Common confusion and a question to try
LIMIT without ORDER BY gives an arbitrary N rows.
What does LIMIT 3 do without ORDER BY?
Aggregate function
A function that folds many rows into one value: COUNT, SUM, AVG, MIN, MAX.
Example: SELECT COUNT(*), AVG(minutes) FROM tickets;
Common confusion and a question to try
Selecting a plain column next to an aggregate needs a GROUP BY.
Which aggregate averages a column?
COUNT
COUNT(*) counts rows; COUNT(column) counts rows where that column is not NULL.
Example: COUNT(t.id) gives 0 for a host with no tickets after a LEFT JOIN.
Common confusion and a question to try
COUNT(*) counts every row of the group, including ones with NULLs.
When do COUNT(*) and COUNT(column) differ?
Alias
A short name given with AS to a result column or to a table: COUNT(*) AS tickets, FROM tickets t.
Example: SELECT h.site FROM hosts h
Common confusion and a question to try
A column alias can be used in ORDER BY; a table alias replaces the table name everywhere after FROM.
What does AS do?
GROUP BY
The clause that splits rows into groups by a column so aggregates run once per group.
Example: SELECT host, COUNT(*) FROM tickets GROUP BY host;
Common confusion and a question to try
Every non-aggregate column in SELECT must be in GROUP BY.
How many rows does GROUP BY host return?
HAVING
A condition on groups, applied after GROUP BY, usually on an aggregate.
Example: HAVING COUNT(*) >= 2
Common confusion and a question to try
WHERE cannot see aggregates; HAVING can.
Where does a condition on COUNT(*) go?
JOIN
Combines rows of two tables where a condition on shared columns is true: JOIN hosts h ON t.host = h.host.
Example: FROM tickets t JOIN hosts h ON t.host = h.host
Common confusion and a question to try
A join on the wrong columns returns nothing rather than an error.
What is the ON clause for?
LEFT JOIN
A join that keeps every row of the left table, filling the right side with NULL when nothing matches.
Example: FROM hosts h LEFT JOIN tickets t ON h.host = t.host
Common confusion and a question to try
The left table is the one written first; put the table whose rows you must keep there.
Which hosts does LEFT JOIN keep that JOIN drops?
NULL
The absence of a value. Comparisons with NULL are neither true nor false; aggregates skip it; IS NULL tests for it.
Example: After a LEFT JOIN, t.id IS NULL marks a host with no tickets.
Common confusion and a question to try
NULL is not 0 and not an empty string.
How do you test for NULL?
Permission
A right on a file or folder: read (r), write (w) or execute (x), granted separately to the owner, the group and everyone else.
Example: -rw-r----- grants the owner read and write, the group read, others nothing.
Common confusion and a question to try
A permission belongs to the file, not to the person; ownership only decides who may change it.
What three rights can a mode grant?
Mode
The set of permission bits on a file or folder, shown by ls -l as ten characters or by stat as a number such as 0640.
Example: chmod 640 notes.txt sets the mode to -rw-r-----.
Common confusion and a question to try
The first character of the ten is the type (- or d), not a permission.
Write the mode 750 as letters.
Owner
The account a file belongs to, shown in the third column of ls -l. The owner may change the file's mode and give it away.
Example: -rw------- 1 alex alex todo.txt is owned by alex.
Common confusion and a question to try
Owning a file does not bypass its mode; a mode of 000 refuses the owner too, until the owner changes it.
Who may run chmod on a file?
Group
A named set of accounts. Every file has a group, and the middle three permission characters apply to its members.
Example: sam is in the alex group, so the group bits of alex's files apply to sam.
Common confusion and a question to try
Being in a file's group gives you the group permissions, not the owner's.
Which command shows the groups you belong to?
chmod
Changes a mode: chmod 700 folder with numbers, or chmod u+x file with letters.
Example: chmod 600 keys/id_ed25519
Common confusion and a question to try
Only the owner (or root) may chmod a file; after chown to someone else, chmod is refused.
What does chmod u+x add?
chown
Changes a file's owner: sudo chown user file. Only root may give a file to another account, so an ordinary account runs it with sudo.
Example: sudo chown alex handover/collect-logs.sh
Common confusion and a question to try
The user comes first and the file second; reversed, chown looks for a user named like the path.
Why set the mode before chown?
Numeric mode
A mode as three digits, owner group others, each adding read 4, write 2 and execute 1: 7 is rwx, 6 rw-, 5 r-x, 4 r--, 0 nothing.
Example: 750 is rwxr-x---.
Common confusion and a question to try
The digits are positions, not a total: 700 and 070 are very different.
What is 640 in letters?
Symbolic mode
A mode change written as who, operator, what: u+x adds execute for the owner, go-w removes write from group and others, a+r adds read for all.
Example: chmod o-r notes.txt
Common confusion and a question to try
Symbolic modes change one thing and leave the rest; numeric modes replace the whole mode.
What does chmod go-rwx do?
Execute bit
The x permission. On a file it allows running it as a program; on a folder it allows entering it and reaching what is inside.
Example: chmod u+x deploy.sh makes the script runnable by its owner.
Common confusion and a question to try
A folder without x cannot be entered even when it has r.
Why does a folder need x?
Least privilege
Giving every account exactly the access its work needs and nothing more.
Example: A handed-over script at 750 owned by the next technician, not 777.
Common confusion and a question to try
Least privilege is not the least useful access; it is the least that still does the job.
Give one example of least privilege from the handover.
sudo
Runs one command as root, the account that may do anything. Use it for the one command that needs root, such as giving a file away with chown, and nothing else.
Example: sudo chown alex handover/collect-logs.sh
Common confusion and a question to try
Needing sudo for an everyday task usually means the modes or owners are wrong, not that you need root.
Why does the practice shell refuse sudo?
stat
Prints the facts about one file: size and type, inode, the mode as a number and in letters, owner and group, and its times. stat -c prints only the fields you ask for.
Example: stat -c '%a %U' notes.txt prints 644 sam.
Common confusion and a question to try
stat describes one file; ls -l lists a folder.
Which two forms of the mode does stat print?
id
Prints your user id, your primary group and every group you belong to.
Copy from the original; never edit the original. Evidence that was edited proves nothing.
Why is the original log never edited?
Boolean column
A column holding TRUE or FALSE, such as success. Compare it with TRUE or FALSE, not with text or numbers.
Example: WHERE success = FALSE
Common confusion and a question to try
success = 'FALSE' compares a boolean with text and is refused here.
How do you keep the failed attempts in a WHERE clause?
Phishing
A message that impersonates someone you trust to make you click a link, open a file or give up a password, usually with urgency.
Example: URGENT: your password expires in 1 hour, with a link to a look-alike domain.
Common confusion and a question to try
The visible link text and the real address are separate things; the address is the tell.
Name three marks of a phishing message.
Report a message
Sending a suspicious message to the security team through the known channel, without clicking anything in it.
Example: Report message → Phishing
Common confusion and a question to try
Replying or clicking to check are what the attacker wants.
What do you do first with a suspected phishing message?
IP address
Four numbers from 0 to 255 that identify one interface on a network, such as 192.168.10.20. Written with a prefix, it also says which subnet the interface is on.
Example: 192.168.10.20/24
Common confusion and a question to try
An address belongs to an interface, not to the whole machine; a host with two interfaces has two.
What are the two parts of 192.168.10.20/24?
Prefix length
The number after the slash: how many leading bits of the address are the network part. /24 is 255.255.255.0.
A 5xx is still an answer: the connection and the certificate worked and the server then failed.
What does the first digit of a status code tell you?
Response header
One Name: value line after the status line, such as Server, Content-Type, Content-Length or Location.
Example: Content-Length: 15
Common confusion and a question to try
Headers describe the response; they are not the page.
Which header says how long the body is?
Redirect
A 3xx response with a Location header that tells the client to ask again at another address; curl follows it only with -L.
Example: HTTP/1.1 301 Moved Permanently
Common confusion and a question to try
A redirect is not an error, but a script that expects the page from the first address gets an empty body.
Which flag makes curl follow a redirect?
curl
The command-line HTTP client: curl -I prints the status line and headers, -v prints the handshake, -s -o /dev/null -w "%{http_code}" prints the status code alone.
Example: curl -I https://srv-1.example.test/
Common confusion and a question to try
-I is a HEAD request; without it curl prints the body and hides the headers.
What does curl -I print?
TLS
The encryption layer under https. The handshake checks the server's certificate before any HTTP request is sent; a failed check ends the request with no status line.
Example: curl: (60) SSL certificate problem: certificate has expired
Common confusion and a question to try
TLS wraps HTTP: a certificate failure means no request was ever made, so there is no status code to read.
Which happens first, the certificate check or the HTTP request?
Certificate
The server's signed identity: a subject name, an issuer and a validity period. The client accepts it only if the name matches the address and the dates are current.
Example: * subject: CN=srv-1.example.test
Common confusion and a question to try
Renewing or reissuing a certificate is done on the server; nothing on the client can fix it.
Which two things must be right for a certificate to be accepted?
Certificate error
curl's code 60: either certificate has expired, or no alternative certificate subject name matches target host name. -k skips the check and hides the fault; it never fixes it.
Example: curl: (60) SSL: no alternative certificate subject name matches target host name 'srv-1.example.test'
Common confusion and a question to try
-k proves only that the site would work if the certificate were trusted; every browser still refuses it.
What does curl -k prove about a site?
502 Bad Gateway
The front web server is up and answering, and the application behind it is not. A 502 is an HTTP answer: the port, the certificate and the front server all worked.
Example: HTTP/1.1 502 Bad Gateway
Common confusion and a question to try
A 502 goes to the application or backend owner; the network and the certificate delivered it correctly.
Which parts of the path does a 502 prove are working?
Process
A program that is running, owned by a user, with a number the system assigns to it.
Example: sam 2231 97.0 1.2 /bin/bash /home/sam/backup.sh
Common confusion and a question to try
A program on disk is a file; only a running copy is a process, and one program can be several processes.
What makes a program a process?
PID
The process ID: the number that names one process while it runs. kill and pgrep work in PIDs.
Example: pgrep -x nginx prints 812
Common confusion and a question to try
PIDs are reused after a process ends; look the number up again before you kill it.
Where do you get the PID of a program?
ps
Lists processes: ps aux shows every process with its user, PID, CPU, memory and command; --sort=-%cpu puts the busiest first.
Example: ps aux --sort=-%cpu | head -n 2
Common confusion and a question to try
ps is a snapshot; it does not update. Run it again to see change.
Which ps flags put the busiest process first?
pgrep
Looks processes up by program name and prints the PID of each one; -x requires an exact name, -l adds the name. Nothing printed and exit status 1 means no such process.
Example: pgrep -x backup.sh
Common confusion and a question to try
Without -x, pgrep ssh also matches sshd.
What does pgrep print when nothing matches?
kill
Ends a process by PID: kill PID asks it to stop (TERM); kill -9 PID forces it (KILL). You may only signal processes you own unless you are root.
Example: kill 2231
Common confusion and a question to try
Operation not permitted means the process belongs to someone else, usually root; a service's process should be stopped through systemctl, not killed.
When is kill refused?
systemd
The service manager on most Linux servers: it starts services at boot, restarts them, tracks whether each is active, inactive or failed, and keeps their journal.
Example: reports.service - Nightly reports API
Common confusion and a question to try
systemd is the manager; systemctl is the command you use to talk to it.
What three states can a systemd service be in?
systemctl
The command that asks systemd about a service or changes it: status, is-active and is-enabled only look; start, stop, restart, enable and disable change it and need root.
Example: sudo systemctl start reports
Common confusion and a question to try
enable sets what happens at boot; start acts now. A service can be enabled and stopped, or running and disabled.
Which systemctl verbs need sudo?
Journal
The log systemd keeps for every service. journalctl -u NAME prints one service's lines, oldest first; -n keeps the last few. The reason a start failed is written there by the service itself.
Example: journalctl -u reports -n 4
Common confusion and a question to try
systemd's own lines say that a start failed; the service's line says why. Read the one the service wrote.
Which command shows why a service failed to start?
df and du
df -h reports each mounted disk: size, used, free, Use%. du adds up files and folders: du -sh PATH for a total, du -ah PATH | sort -h | tail for the largest entries.
Example: du -ah /var/log | sort -h | tail -n 3
Common confusion and a question to try
df says how full a disk is; du says what is on it. You need both: one to notice, one to find.
Which command finds the largest file under a folder?
truncate
truncate -s 0 FILE empties a file in place, freeing its space immediately even while a program still has it open, which rm cannot do.
rm on an open log removes the name; the blocks stay in use until the writer closes the file, so the disk stays full.
Why truncate an open log instead of deleting it?
Architecture
The processor family a machine runs: x86_64 or aarch64. Programs and drivers are built for one and do not run on the other. uname -m prints it.
Example: uname -m prints x86_64
Common confusion and a question to try
An aarch64 build on an x86_64 machine does not run slowly; it does not run.
Which command prints the architecture?
CPU count
How many processors the machine has: nproc prints the number, lscpu prints it with the architecture and model.
Example: nproc prints 4
Common confusion and a question to try
CPU(s) in lscpu counts threads the system can schedule, which is what sizing decisions use.
What does nproc print?
free -m
Prints memory in mebibytes: total, used, free, shared, buff/cache and available, then swap. available is what programs can still get, because cache can be given back.
Example: free -m
Common confusion and a question to try
free is not the number to watch; available is.
Which column of free -m says how much memory programs can still get?
Swap
Disk space the kernel uses as overflow memory. Swap nearly full with available memory tiny is memory pressure: the machine is paging and everything slows.
Example: Swap: 2047 1950 97
Common confusion and a question to try
Swap use is a symptom of memory pressure, not a disk problem, even though swap lives on a disk.
What does a nearly full swap line mean?
OOM kill
When memory runs out the kernel ends a process to keep the machine alive and logs Out of memory: Killed process NAME. dmesg shows it.
Example: [ 3120.552104] Out of memory: Killed process 2231 (backup.sh)
Common confusion and a question to try
The killed process is the one that lost, not always the one at fault; read the memory numbers too.
Where does the kernel record an Out of memory kill?
Kernel log (dmesg)
The kernel's own log: hardware found at boot, disks and their sizes, and events like Out of memory kills. dmesg prints it; pipe into grep or tail.
Example: dmesg | grep -c "Out of memory"
Common confusion and a question to try
dmesg is the kernel's log; journalctl -u is a service's log; journalctl -b is this boot's log.
Which command prints the kernel log?
Block device (lsblk)
A disk or partition. lsblk lists them with size, type and mount point. A device named in /etc/fstab but absent from lsblk cannot be mounted.
Example: sdb 100G disk
Common confusion and a question to try
lsblk shows what is attached; df shows what is mounted and how full.
How do you see whether a disk is attached?
Boot stages
Firmware finds a disk, the bootloader loads the kernel, the kernel starts systemd, systemd mounts filesystems and starts services. Each stage fails in its own way: no bootable device, a kernel panic, emergency mode.
Emergency mode means the kernel booted fine; the failure is in systemd's mounting.
Which stage produces You are in emergency mode?
Boot journal (journalctl -b)
The log of the current boot. journalctl -b -p err keeps only the errors, which is where a failed mount or service shows first.
Example: journalctl -b -p err
Common confusion and a question to try
-b is this boot; -u is one service across boots.
How do you list only this boot's errors?
Emergency mode
The minimal shell systemd drops into when a required mount fails. The usual cause is an /etc/fstab line for a disk that is missing or renamed.
Example: You are in emergency mode. After logging in, type "journalctl -xb" to view system logs.
Common confusion and a question to try
It is not a hardware failure of the boot disk; the root filesystem mounted, or there would be no shell.
What usually causes emergency mode?
/etc/fstab
The file that lists what to mount at boot: device, mount point, filesystem type, options. A line for a missing device stops the boot. The reversible fix is a backup, then the line removed with grep -v.
Example: /dev/sdb1 /data ext4 defaults 0 2
Common confusion and a question to try
The nofail option would let the boot continue without the disk; removing the line is the change this course teaches because it is visible and reversible.
What does a line in /etc/fstab describe?
Ticket
One recorded request or problem: who, what they see, what was found, what was done, and what happens next. The evidence and the conclusion live in it.
Restoring straight over the live file destroys the evidence of what went wrong and skips the check.
Where should a restore go first?
Checksum (sha256sum)
A fingerprint of a file's content. sha256sum prints it; two files with the same fingerprint have identical content, and one changed byte changes the whole fingerprint.
Same name and same size do not mean same content; only the fingerprint does.
What does a matching sha256sum prove?
diff
Compares two files line by line: < lines from the first, > lines from the second, with line numbers above; -q only says whether they differ. No output and exit status 0 means identical.
A rollback without a prior backup is a guess at what the file used to say.
What makes a rollback possible?
Status update
What the user will notice, what was done, and what happens next, with nothing promised that the evidence does not support.
Example: Your file is back and verified; I am finding out how it was moved and will update you by 16:00.
Common confusion and a question to try
Never will not survive the next incident; by four o'clock will.
What three things does a user update contain?
Triage
Ordering a bundle of tickets by impact and urgency after gathering one line of evidence for each, before any fix.
Example: Portal (everyone) → disk at 89% (soon) → reports API (one team) → idle script (noise)
Common confusion and a question to try
Arrival order and loudness are not impact.
What decides the order in which tickets are worked?
Distracting symptom
A ticket that sounds like a fault but whose evidence shows nothing to fix: an idle script, a past out-of-memory kill with healthy memory now, an old failed login with no lock.
Example: alex's backup.sh at 0.0% CPU
Common confusion and a question to try
Touching a non-fault is the commonest way to create a real one.
What do you do with a ticket whose evidence shows nothing wrong?
Escalation
Handing a problem to whoever can change its cause, with the evidence command in the transcript: a printer that is off, a certificate only its owner can renew.
Example: escalate printer-off
Common confusion and a question to try
Escalating without evidence sends a summary; the next person has to start over.
What goes with an escalation?
Handover
The list at the end of a practical: what was fixed, what was escalated and to whom, and what was noted and left alone, sorted so anyone can compare it.
Example: sort evidence/handover.txt
Common confusion and a question to try
A handover that only lists fixes hides the open problem and the thing nobody should touch.
What three kinds of line does a handover hold?
Unrelated data
Everything on the server that was not the cause: other services, other files, other people's processes. A fix that changes any of it is not done.
Example: Collateral: none
Common confusion and a question to try
Restarting a healthy service or emptying an extra log feels thorough and is damage.
How does the checkpoint know a fix touched nothing else?
Checkpoint
A chapter that combines earlier chapters on one changed scenario, without hints, and whose retention the certification cards require.
Example: L08 — IT practical checkpoint
Common confusion and a question to try
A checkpoint pass is course readiness, not an exam pass.
What does a checkpoint prove that a chapter does not?
dig
Asks a DNS server for a name and prints the answer: dig NAME shows the sections, dig +short NAME only the values, dig @SERVER NAME asks a specific server. It never reads /etc/hosts.
Example: dig +short intranet.example.test
Common confusion and a question to try
dig timing out means the server; dig saying NXDOMAIN means the record.
What does dig @10.0.20.5 do that plain dig does not?
CNAME
An alias record: the name points at another name, and the address is looked up there. dig +short prints the target with a trailing dot, then the address. An alias to a name with no record gives no address at all.
Example: intranet.example.test. 300 IN CNAME srv-1.example.test.
Common confusion and a question to try
The alias is not broken when its target is missing; the target is.
What does dig +short print for an alias?
/etc/hosts
A local file the resolver library reads before asking DNS. Programs such as ping, curl and browsers obey it; dig and nslookup do not. A stale line there makes one machine disagree with DNS.
Example: 10.0.20.99 portal.example.test
Common confusion and a question to try
It belongs to root: rewrite it with a copy and sudo cp, not with a redirect after sudo.
Which tools ignore /etc/hosts?
Stale record
A DNS record that still holds an address a service no longer uses. ping and dig agree and both are wrong; only the zone owner can fix it, and a temporary hosts line can bridge one machine until then.
Example: files.example.test → 10.0.20.99 (service moved to 10.0.20.10)
Common confusion and a question to try
A bridge in /etc/hosts must be written down and removed once the record is fixed.
How do you tell a stale record from a hosts override?
DHCP
The protocol a machine uses to ask for an address, gateway and DNS server at start-up: DISCOVER, OFFER, REQUEST, ACK. dhclient -v shows the exchange; No DHCPOFFERS received means nothing answered.
Example: sudo dhclient -v eth0
Common confusion and a question to try
No offers can mean the scope is down or the link is; read ip addr before blaming the server.
What are the four messages of a DHCP lease?
Link-local address (169.254)
The address a machine gives itself when no DHCP lease arrives: 169.254.x.y/16. It reaches only its own cable. Seeing it means one thing: no lease.
Example: 2: eth0: UP inet 169.254.23.41/16
Common confusion and a question to try
Nobody assigns 169.254 on purpose; it is a symptom, not a configuration.
What does a 169.254 address tell you?
Lease
What a DHCP server gives: an address for a time, plus the default gateway and the DNS server, which dhclient writes into /etc/resolv.conf. A ping by name afterwards tests all three.
Example: bound to 192.168.10.50 -- renewal in 43200 seconds.
Common confusion and a question to try
An address alone is not a working network; the route and the resolver come with the lease.
What three things does a lease carry?
Route table
The lines a machine uses to choose where a packet goes: a default route, static routes, and one connected route per interface. The line with the longest matching prefix wins.
Example: 192.168.30.0/24 via 10.0.90.2
Common confusion and a question to try
Listing order never decides; prefix length does.
Which route line does a packet take when several match?
Static route
A route an administrator adds by hand: a destination subnet and the next-hop address to reach it. Missing, it sends that traffic down the default instead.
Example: sudo ip route add 192.168.30.0/24 via 10.0.90.2
Common confusion and a question to try
The next hop must be an address on a subnet the router is connected to.
What happens to traffic for a subnet with no static route?
Destination Net Unreachable
A router's reply that it has no route for the destination. When it comes from the ISP for a private subnet, your own router sent the packet there: a static route is missing on your side.
Example: From 203.0.113.1 icmp_seq=1 Destination Net Unreachable
Common confusion and a question to try
It is not the same as Network is unreachable, which means your own host has no route at all.
Who is complaining, and what does it mean?
IP forwarding
The kernel setting that lets a Linux machine pass packets between its interfaces. net.ipv4.ip_forward = 1 makes it a router; at 0 it drops everything not addressed to itself.
Example: sudo sysctl -w net.ipv4.ip_forward=1
Common confusion and a question to try
Correct routes on a box with forwarding off route nothing.
What does a Linux box with two interfaces do with transit packets by default?
NAT (masquerade)
Rewriting the source address of packets leaving a router's public interface to the router's own public address, so replies from the internet can come back and be handed to the private host.
The rule belongs on the interface facing the internet; on the LAN side it changes nothing.
Why does a host with a private address need NAT to reach the internet?
Private address
An address from 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16: usable inside a site, never routed on the internet. Hosts with one reach the internet only through NAT.
Example: 192.168.10.20
Common confusion and a question to try
The router's own public address is routable; the hosts behind it are not.
Which ranges are private?
Hardening
Reducing what a server exposes and what an attacker gains from any one mistake: unused services off, ports fenced, root and password logins off, keys and sudo tight, and proof that the service still works.
Example: stop telnet, fence 3306, PermitRootLogin no
Common confusion and a question to try
A hardening that breaks the portal is an outage, not a control.
What is the test that a hardening step did no harm?
Attack surface
Everything that answers the network: each listening port, service and login method. ss -tlnp lists it. Every unused item on the list is risk without benefit.
Example: ss -tlnp | grep -c LISTEN
Common confusion and a question to try
A port is exposure even when nobody uses it; especially then.
Which command lists a server's attack surface?
INPUT chain (iptables)
The host's own firewall for incoming packets. sudo iptables -A INPUT -p tcp --dport PORT -s SOURCE -j DROP fences one port from one source; -L INPUT lists the rules.
Example: sudo iptables -A INPUT -p tcp --dport 3306 -s 192.168.10.0/24 -j DROP
Common confusion and a question to try
A rule without a port or without a source drops far more than intended.
What two things scope a DROP rule?
sshd_config hardening
PermitRootLogin no and PasswordAuthentication no in /etc/ssh/sshd_config, with PubkeyAuthentication yes kept, and the ssh service restarted so the daemon reads the file.
Editing the file changes nothing until the service restarts; test a new login before closing the old session.
Which line must stay when passwords are turned off?
Private key permissions
A private key is owner-only: mode 0600. With 0644 every account on the machine can read it, and SSH refuses to use it.
Example: chmod 600 .ssh/id_ed25519
Common confusion and a question to try
The public key (.pub) and authorized_keys may be readable; the private key may not.
What mode should a private key have?
/etc/sudoers
Who may run what as root. A NOPASSWD: ALL line makes an account root without a password for anything. Reviewed and edited with visudo on a real machine; here rewritten with a copy and sudo cp.
Example: backup ALL=(ALL) NOPASSWD: ALL
Common confusion and a question to try
root's own line and the sudo group line stay; only the shortcut goes.
What does NOPASSWD: ALL grant?
Data quality
How far a table can be trusted for a total or a group: consistent spellings, no stray spaces, missing values marked as missing, no placeholders pretending to be numbers, no rows entered twice.
Example: 10 rows · 9 distinct tags · 7 with owner · total 7000
Common confusion and a question to try
Data can be valid to SQL and still wrong for every question you ask it.
What four problems does a first look at a table check for?
COALESCE
Returns the first argument that is not missing: COALESCE(owner, 'unassigned') prints the owner, or unassigned when there is none. SQLite and MySQL also spell the two-argument form IFNULL; PostgreSQL has only COALESCE.
Example: COALESCE(owner, 'unassigned') AS owner
Common confusion and a question to try
It fills a gap with an honest word; it does not invent an owner.
What does COALESCE return when its first argument is NULL?
DISTINCT
Each different value once: SELECT DISTINCT lists them, COUNT(DISTINCT tag) counts them. Against COUNT(*), the gap is the number of duplicate rows.
Example: SELECT COUNT(*) AS rows, COUNT(DISTINCT tag) AS tags
Common confusion and a question to try
DISTINCT on a dirty column lists every spelling; clean first.
How do you count how many rows are duplicates?
Duplicate row
The same thing entered twice, usually with the same tag or id. GROUP BY the key with HAVING COUNT(*) > 1 lists them.
Example: GROUP BY tag HAVING COUNT(*) > 1
Common confusion and a question to try
DISTINCT hides duplicates in a listing; it does not fix a total that counted them.
Which clause keeps only the groups with more than one row?
Sentinel value
A real-looking value used to mean missing, like -1 for an unknown cost. Aggregates add it as if it were true. CASE WHEN cost < 0 THEN NULL ELSE cost END turns it back into a missing value.
Example: SUM(CASE WHEN cost < 0 THEN NULL ELSE cost END)
Common confusion and a question to try
A sentinel never errors; it quietly moves every total.
Why did SUM(cost) come out one short?
Mean
The sum divided by the count: AVG in SQL. Every value pulls on it, so one extreme value can move it past every ordinary one.
Example: ROUND(AVG(minutes), 1) AS mean_minutes
Common confusion and a question to try
Report the count beside a mean; a mean of two values is a coin toss.
What does one huge value do to a mean?
Median
The middle value when the values are sorted: half are below it, half above. Unmoved by how extreme the extremes are. In this SQL: ORDER BY the value and take the middle row with LIMIT 1 OFFSET n.
Example: ORDER BY minutes LIMIT 1 OFFSET 3
Common confusion and a question to try
For an even count the median is the average of the two middle values.
How do you get a median without a MEDIAN function?
Outlier
A value far from the rest: the 240-minute inquiry among ten-minute ones. It drags the mean and the range, and it is a real row that deserves its own explanation.
Example: MAX(minutes) = 240 next to a median of 12
Common confusion and a question to try
Do not delete an outlier to fix a mean; report the median and the outlier both.
Which summary does an outlier not move?
Spread (range)
How far apart the values are; the simplest measure is MAX minus MIN. A small spread means the values cluster; a large one often means an outlier.
Example: MAX(minutes) - MIN(minutes) AS spread
Common confusion and a question to try
The range is decided entirely by the two extremes.
What is the simplest measure of spread?
Proportion (share)
A count divided by the whole it belongs to, usually shown as a percentage. In SQL: 100.0 times a SUM over a CASE, divided by COUNT(*), rounded.
Example: ROUND(100.0 * SUM(CASE WHEN minutes <= 15 THEN 1 ELSE 0 END) / COUNT(*), 1)
Common confusion and a question to try
100 instead of 100.0 turns the division into whole numbers and drops the decimals.
Why multiply by 100.0 rather than 100?
Denominator
The whole a share is divided by. A share of inquiries within target divides by every inquiry in the period; dividing by a subset gives a number that can exceed 100 and answers a different question.
Example: / COUNT(*)
Common confusion and a question to try
A share over 100% is a wrong denominator, never good news.
What does a share over 100% tell you?
Sample size
How many values a summary rests on: COUNT(*) printed beside it. Two values cannot show a trend; a share of 9 is far less certain than the same share of 900.
Example: 85.7% (n=7) versus 11.1% (n=9)
Common confusion and a question to try
A percentage without its n hides how little it may mean.
Why print responses beside every mean and share?
Confounder
Something else that changed at the same time and could explain the difference: the site mix shifting between periods while the team stayed the same. GROUP BY both columns makes it visible.
Example: GROUP BY period, site
Common confusion and a question to try
Compare like with like before comparing periods.
How do you check whether the mix changed?
Correlation is not causation
Two things changing together does not show that one caused the other. A memo can say what changed and what changed alongside it; it cannot name the cause from the numbers alone.
Example: Q2 was slower and the phone system changed in Q2
Common confusion and a question to try
The honest sentence names the confounder and the limit of the claim.
What can the data say about the phone system?
Reconciliation
Recomputing a displayed number from the source it claims to summarise and showing the difference. A report is right when every total reconciles to a named query anyone can rerun.
Example: r.total_amount - SUM(s.amount) AS difference
Common confusion and a question to try
The source wins; a report that does not reconcile is wrong until the difference is explained.
What does a positive difference between report and source suggest?
Report table (snapshot)
A table holding the numbers a dashboard displays, computed by a query at a refresh time. It is derived data: useful, fast, and only as right as the query and as current as the refresh.
A snapshot is not the source; it is a claim about the source.
What two things make a report table wrong?
Duplicated join
A join to a table where the key appears more than once, so each matching row is repeated and every sum and count multiplies. COUNT(*) against COUNT(DISTINCT id) after the join reveals it; GROUP BY the key HAVING COUNT(*) > 1 names it.
Example: SELECT COUNT(*) AS joined_rows, COUNT(DISTINCT s.id) AS orders
Common confusion and a question to try
A total exactly double the source is a duplicated key, not double the sales.
Which two counts expose a duplicated join?
Broken filter
A WHERE that matches exactly against a column people typed into, so a dirty spelling drops out and the total is quietly short. Clean the column inside the filter.
Example: WHERE LOWER(TRIM(region)) = 'west'
Common confusion and a question to try
A missing row makes a total too small by exactly that row.
What is the signature of a broken filter in a reconciliation?
Stale refresh
A snapshot computed before the newest source rows. MAX(day) in the source against refreshed_day in the report says how far behind it is; rows with day greater than the refresh day are what it misses.
Example: SELECT id, region, amount FROM sales WHERE day > 5
Common confusion and a question to try
A refresh does not fix a wrong query; stale and wrong are separate problems.
How do you list what a snapshot is missing?
Snapshot versus live
A snapshot is computed once at a refresh time and must say so; a live report queries the source when viewed and is never stale, though it can still be wrong.
Example: refreshed day 5 · next refresh day 8
Common confusion and a question to try
Readers assume live unless the report says otherwise.
What must a snapshot report state?
Misleading scale
An axis that does not start at zero, a percentage shown without its base, or two periods on different scales: correct numbers drawn so the picture says something else.
Example: Y axis 500–560: 520 looks half of 540
Common confusion and a question to try
Start axes at zero unless the reader is told why not.
How does a truncated axis change 520 versus 540?
Validation checklist
The short list run before a report goes out: each total reconciled to a named source query, join keys checked for duplicates, filters listed, refresh time stated, axes from zero, percentages with their base.
The checklist is run before publishing, not after the complaint.
Which checklist item catches a duplicated join?
DELETE
Removes the rows a WHERE matches and nothing else. Name the row precisely, count first, and keep a copy or a record of what went.
Example: DELETE FROM regions WHERE region = 'east' AND manager = 'jordan';
Common confusion and a question to try
DELETE without WHERE empties the table.
What does DELETE with no WHERE do?
Personal data
Any value that points at a person: a name, an email, a phone number, or a combination such as postcode and birth year that narrows to one. If there is a way back to the person, it is personal data whatever the column is called.
Example: name, email, phone: direct; postcode + birth_year: together
Common confusion and a question to try
Removing the name is not enough when other columns still identify.
Which columns in the customers table identify a person?
Quasi-identifier
A column that does not identify on its own but does in combination: postcode with birth year, job title with employer. A count of one for a combination is a person.
Example: GROUP BY postcode, birth_year HAVING COUNT(*) = 1
Common confusion and a question to try
Aggregates with small counts still identify.
Why is a count of one per postcode and birth year not anonymous?
Data minimisation
Collecting, selecting and sharing only the columns and rows the task needs. SELECT * is the opposite of it; a report that needs counts gets counts, not people.
Example: SELECT id, name, postcode instead of SELECT *
Common confusion and a question to try
Easy to collect is not a reason to collect.
What does a newsletter-reach report need from the customers table?
Masking
Hiding part of a value from the reader while the row stays linked to the person: the last four digits of a phone, the last four of a card. It limits disclosure; it does not make data anonymous.
Example: '***-' || RIGHT(phone, 4)
Common confusion and a question to try
Masked data beside an id is still personal data.
How does a support agent confirm a caller with a masked phone?
Anonymisation
Transforming data so nobody, with any other table, can get back to the person. Much harder than removing names: small groups, rare values and joins re-identify. Treat a claim of anonymous with suspicion until the way back has been looked for.
Example: Counts per postcode with every count above a minimum
Common confusion and a question to try
Masking is not anonymisation.
What makes a table of counts re-identifying?
SUBSTR
Returns part of a text: SUBSTR(text, start, length), positions from 1. PostgreSQL never counts from the end: a start below 1 only shortens the result. For the last characters use RIGHT.
Example: SUBSTR('555-0101', 1, 3) is 555
Common confusion and a question to try
SUBSTR(phone, -4) is not the last four in PostgreSQL: it returns the whole phone. RIGHT(phone, 4) is the last four.
Which function gives the last four characters of a text in PostgreSQL?
RIGHT and LEFT
RIGHT(text, n) is the last n characters of a text and LEFT(text, n) the first n; a negative n means all but that many from the other end.
Example: '***-' || RIGHT(phone, 4)
Common confusion and a question to try
The number is how many characters to keep, not a position.
What does RIGHT(phone, 4) return?
NULLIF
Returns NULL when its two arguments are equal, and the first one otherwise. Its best-known use is dividing safely: x / NULLIF(y, 0) gives NULL instead of a division-by-zero error.
NULLIF does not replace a NULL; COALESCE does that.
What does 10 / NULLIF(0, 0) give in PostgreSQL?
Practice database
The database the data lessons run on. It behaves like PostgreSQL, with a few deliberate differences: its error messages are friendlier and name the fix; a script stops at its first error, like psql with ON_ERROR_STOP; ROUND(x, n) takes any number, where PostgreSQL wants a numeric; booleans print TRUE and FALSE, where psql prints t and f; AVG prints without trailing zeros; and text sorts by character code, as PostgreSQL's C collation does, so 'Z' comes before 'a'.
Example: SELECT 5 / 2 prints 2, as PostgreSQL does: whole numbers divide to a whole number.
Common confusion and a question to try
The lessons teach PostgreSQL; MySQL and SQLite differ in places, such as case-insensitive LIKE.
What does the practice database do at a script's first error?
Retention
How long a record is kept and the rule that removes it: a period, a reference column and a cutoff. Applied with a count before, a DELETE with the same WHERE, and proof after (what remains, the oldest that remains), with the run logged.
Example: DELETE FROM customers WHERE last_seen_day < 35;
Common confusion and a question to try
A customer seen exactly on the cutoff day stays.
What three numbers does a retention run record?
Count before you change
Run the WHERE of a DELETE or UPDATE as a COUNT first, read a few matching rows, then run the change with the same condition.
Example: SELECT COUNT(*) FROM customers WHERE last_seen_day < 35;
Common confusion and a question to try
The count and the change must share the same WHERE.
Why count before a DELETE?
Consent
A recorded yes for a stated use. The column holds yes, no, withdrawn and NULL for never asked; only yes is consent. Testing for anything but no admits withdrawn and never asked.
Example: WHERE consent = 'yes'
Common confusion and a question to try
NULL consent is never asked, not yes.
Why is consent <> 'no' wrong?
Access follows the task
Who may see which columns and rows is decided by what their task needs, and is written down: support sees the customer in the ticket, masked; analysts see counts; a tool receives the list it uses. Nobody exports the whole table.
A test a row must pass: an email with an @, a phone of eight characters, a birth year that is not the sentinel. Written as a CASE that yields 1 for a failing row, summed, and given as a share of all rows.
Example: SUM(CASE WHEN email IS NULL OR email NOT LIKE '%@%' THEN 1 ELSE 0 END)
Common confusion and a question to try
A NULL email is NULL under LIKE, so the rule needs IS NULL as well.
Why does the email rule need IS NULL and NOT LIKE?
Threshold
The failing share a load may not exceed, written down before the data arrives. Compared with the decimals kept; never moved after the fact to let a load through.
Example: failing_share 40.0 > threshold 5.0
Common confusion and a question to try
A threshold raised to fit today's data is not a threshold.
When is a quality threshold set?
Quality gate
The step that compares the failing share to the threshold and rejects the load when it fails, reporting the rows and counts to the owner of the source. The fix belongs at the source, not in the query.
Patching the rows in the query hides the problem until the next load.
What happens when a load fails the gate?
Data register
One entry per dataset: owner, source, each field and whether it identifies, purpose, retention rule, who may see which columns, quality rules with thresholds, and the review questions for where the people live. Its numbers come from a query anyone can rerun. It records practice and never declares compliance.
The register is what a qualified reviewer asks to see; it is not their answer.
Which line does not belong in a register?
Review questions, not legal assurance
What a law requires depends on where the people live and what is done with the data. The analyst records the facts and the questions a qualified reviewer will ask, and does not declare compliance with any law.
Example: Where do these customers live, and who has reviewed what that requires?
Common confusion and a question to try
Naming a law is not the same as having met it.
Who answers whether the dataset complies with a law?
LIKE
Matches text against a pattern: % stands for any run of characters and _ for one. email LIKE '%@%' keeps addresses with an @ anywhere. NOT LIKE is the opposite, and a NULL is NULL under either. LIKE is case-sensitive; ILIKE matches in any case.
Example: WHERE email LIKE '%@%'
Common confusion and a question to try
LIKE '@%' matches only addresses that start with @.
What does % mean in a LIKE pattern?
CASE
Picks a value per row: CASE WHEN condition THEN 1 ELSE 0 END. Summed, it counts the rows that meet the condition, which is how a quality rule or a register number is written.
Example: SUM(CASE WHEN email IS NULL THEN 1 ELSE 0 END)
Common confusion and a question to try
Without ELSE 0 the non-matching rows contribute NULL, which SUM ignores; the count is the same but the habit is unsafe.
How does CASE count rows that meet a condition?
Integer division
Dividing two whole numbers gives a whole number in this dialect: 100 * 4 / 10 is 40 but 100 * 1 / 3 is 33, not 33.3. Multiply by 100.0 so the decimals survive.
Example: ROUND(100.0 * failing / COUNT(*), 1)
Common confusion and a question to try
100 * a / b and 100.0 * a / b can differ by up to a whole percentage point.
Why write 100.0 rather than 100 in a share?
Machine learning
A method that learns a rule from labelled examples instead of being given the rule. Its output is only as good as the examples, the truth column it was scored against, and the rows it was scored on.
Example: A classifier trained on labelled tickets
Common confusion and a question to try
A learned rule is not a correct rule.
What does a classifier learn from?
Prediction versus generation
A prediction is a label or number chosen from fixed options: urgent or routine. Generation produces new text or images. Predictions are checked against a truth column; generated text is checked claim by claim.
Example: model_says = 'urgent' is a prediction; the weekly summary is generation
Common confusion and a question to try
Fluent text is not evidence.
How is a prediction checked, and how is generated text checked?
Training versus inference
Training is learning from labelled examples; inference is applying what was learned to new input. Rows used in training must not be used to score the model.
Example: training table: the ids the model learned from
Common confusion and a question to try
Scoring on trained rows is leakage.
Which rows may be used to evaluate a model?
Accuracy
Correct predictions over all rows scored: SUM(CASE WHEN model_says = actual THEN 1 ELSE 0 END) over COUNT(*), with the decimals kept and the period stated. It treats every kind of wrong as equal.
Example: ROUND(100.0 * correct / COUNT(*), 1)
Common confusion and a question to try
The denominator is every row, not the urgent ones.
What is accuracy's denominator?
The four counts
Urgent caught, urgent missed, routine raised as a false alarm, routine left quiet: four SUM(CASE ...) counts over actual and model_says. Missed and false alarms have different costs, which accuracy hides.
A model can be 60 percent accurate and miss most of what matters.
Which two counts does accuracy blur together?
Deterministic rule
A rule written by a person: if the ticket mentions an outage, it is urgent. Reproducible, explainable, scored the same way as the model, and the right choice whenever it measures as well or better.
Example: mentions_outage = 1 means urgent
Common confusion and a question to try
Simpler and better is not a compromise.
When is a rule preferable to a model?
Leakage
Evaluation rows the model was trained on. The model has seen their answers, so its score on them is memory, not prediction. Found with a JOIN from the evaluation rows to the training ids; removed by scoring only the rows that do not match.
Example: JOIN training g ON t.id = g.id WHERE t.period = 'week2'
Common confusion and a question to try
A perfect score on leaked rows means nothing.
How do you find leaked evaluation rows?
Evaluation set
The rows a model is scored on: never trained on, from the period that matters, kept so the score can be rerun.
Example: week2 tickets LEFT JOIN training WHERE g.id IS NULL
Common confusion and a question to try
Held out means held out of training, not out of sight.
What must be true of every evaluation row?
Drift
The data the model meets changes from the data it learned on: the share of urgent tickets rises, the wording shifts. A score from one period does not carry to the next; measure per period.
Example: urgent share 50 percent in week1, 66.7 in week2
Common confusion and a question to try
Drift is GD03's changed mix, met by a model.
Why measure a model per period?
Reproducibility
Another person can rerun the evaluation and get the same number: the scored rows, the training ids excluded, the model version, the query and the date, all kept.
Example: eval.sql · model v3 · rows week2 minus training · run 2026-09-23
Common confusion and a question to try
A number without its inputs is a rumour.
What five things make an evaluation reproducible?
Large language model
A model that generates text, trained on a great deal of it. Its output is fluent whether or not it is true, so every claim about data is checked against the data.
Example: The summary said ticket 14 was urgent; there is no ticket 14
Common confusion and a question to try
Fluency is not accuracy.
Why is a generated summary checked claim by claim?
Unsupported claim
A statement in generated text that the source does not back: a cited row that does not exist, or a value the row contradicts. Counted and given as a share of all claims.
Example: WHERE t.id IS NULL OR c.claimed_value <> t.actual
Common confusion and a question to try
A real ticket cited with the wrong value is unsupported too.
What are the two ways a claim fails the check?
Citation check
A LEFT JOIN from the claims to the source on the cited id: no match means the citation is invented; a match with a different value means it is wrong.
Example: LEFT JOIN tickets t ON c.ticket_id = t.id
Common confusion and a question to try
An inner join would hide the invented citations.
Why LEFT JOIN in a citation check?
Human review and fallback
A generated report is sent only after a person has checked every claim against the source; when it fails, the fallback is the deterministic version: counts and a rule, by query.
Example: Summary: reviewed weekly · Fallback: counts only
Common confusion and a question to try
Review is a checklist, not a feeling.
What is the fallback for a failed generated report?
The words: ML, deep learning, LLM, NLP, RPA
Machine learning learns from examples; deep learning is machine learning with many-layered networks; a large language model generates text; natural language processing works with language; robotic process automation is scripts clicking through software and learns nothing.
Example: RPA fills a form the same way every time; an LLM writes a new paragraph every time
Common confusion and a question to try
RPA is automation, not learning, and often the right tool.
Which of the five does not learn from data?
Grain
What one row of a table stands for: one delivery, one depot per week, one claim. Every count and average is about a grain, and a question is precise once its grain is named.
Example: deliveries: one row per delivery; summary: one row per depot
Common confusion and a question to try
Joining two grains multiplies the finer one.
What is the grain of the summary table?
Population
The rows a measure is about: delivered deliveries with a recorded lateness, not every row. Named before the query, stated in the report with the rows it leaves out.
Example: WHERE LOWER(TRIM(status)) = 'delivered' AND late_minutes >= 0
Common confusion and a question to try
Failed deliveries have no lateness and are outside the population.
Which rows does the lateness question cover?
Misleading field
A column whose values do not mean what they look like: a -1 that means not recorded, a status with four spellings. Read the field before averaging it; the checkpoint plants one.
Example: AVG(late_minutes) 7.7 against AVG over recorded rows 10.6
Common confusion and a question to try
A sentinel averaged in is a number that lies quietly.
What did the -1 do to the average?
Limitation
A number the reader must weigh with the answer: the n behind a mean, the outlier inside it, the depot too small to rank, the snapshot's date. Stated as figures, not apologies.
Example: E3 not ranked (2 recorded); N1's mean includes one delivery of 45 minutes
Common confusion and a question to try
A limitation left out is an overclaim.
Which limitations does the depot answer carry?
Checksum list (SUMS)
A file of `HASH NAME` lines a publisher provides. sha256sum -c LIST hashes each named file and prints OK or FAILED, warns on standard error and exits 1 if anything differed. It proves the files match the list, not who wrote the list.
Example: sha256sum -c SUMS
Common confusion and a question to try
A list downloaded beside the files can be replaced beside them.
What does sha256sum -c print for a changed file?
Tampering
Content changed after it was published or signed: an extra line in an archive, a byte flipped in transit. A hash finds that it happened; a signature finds it even when the list was replaced too.
Example: tail -1 release.tar shows a line the vendor never shipped
Common confusion and a question to try
FAILED says the content differs, not how.
How do you find what changed after FAILED?
Integrity versus authenticity
Integrity: the content is unchanged relative to some reference. Authenticity: the reference itself came from who it claims. A hash gives the first; only a signature from the publisher's key gives the second.
Example: hash matches the page's list: integrity; signature verifies with vendor.pub: authenticity
Common confusion and a question to try
Matching hashes on one page prove nothing about the page.
What can a signature prove that a hash cannot?
Password hashing
Passwords are stored with a slow, salted, purpose-built function, never a fast file hash and never reversible encryption. A fast hash lets an attacker try billions of guesses a second, and without a salt equal passwords hash equally.
Example: A slow salted password hash, not SHA-256 of the password
Common confusion and a question to try
SHA-256 is right for files and wrong for secrets.
Why is a fast hash wrong for passwords?
Digital signature
A value made from a file's hash with a private key and checked with the matching public key: openssl dgst -sha256 -verify PUB -signature SIG FILE prints Verified OK when the holder of the private key signed exactly this content, and Verification failure when the content or the key differs.
Example: Verified OK
Common confusion and a question to try
A failure means the file or the key; check the key from a second channel before blaming the file.
What does Verified OK prove?
Public and private key
Two keys made together: the private one signs and decrypts and stays with its owner; the public one verifies and encrypts and is given to everyone. Verifying a vendor's signature needs only their public key.
Example: vendor.pub verifies what the vendor's private key signed
Common confusion and a question to try
If you hold someone's private key, it is no longer private.
Which key verifies a signature?
Private key handling
The private key stays on the machine that signs, with permissions only its owner can read, and is never copied to verify anything. A signature from a retired key is not acceptance: the current key, confirmed from a second channel, decides.
Example: build.key mode 600 on the build host; vendor.pub everywhere
Common confusion and a question to try
Tampering is detected without ever exposing the private key.
Where does the private key live?
Verification gate
An install that runs only if the checksum list and the signature both pass: a && chain ending in || that records a rejection. The outputs are written to evidence files so the decision can be checked later.
A gate on the checksum list alone installs anything that matches its own list.
Why does the gate need both checks?
Certificate authority
The signer of a certificate. openssl verify -CAfile CA CERT accepts CERT only if CA issued it and it is within its dates; which CA you pass is a decision about whom you trust.
Passing whichever CA makes verify say OK is how untrusted becomes trusted by accident.
What does -CAfile decide?
Trust decision
Choosing which authorities to accept. A certificate from an authority you do not trust fails with error 20, the same message an impostor's certificate produces; the answer is to check the authority, not to add it.
Example: error 20 at 0 depth lookup: unable to get local issuer certificate
Common confusion and a question to try
Adding a CA to make an error go away is the error.
What does error 20 mean?
Expired, untrusted, wrong name
The three ways a certificate fails: past its notAfter date (error 10, curl (60) certificate has expired), issued by an authority you do not trust (error 20), or valid but for a different host name (curl (60) no alternative certificate subject name matches). Each has one fix: reissue, check the authority, issue for the right name. None is fixed by -k.
Example: subject=CN = portal-old.example.test on srv-1.example.test
Common confusion and a question to try
-k or proceed anyway turns off the check that would catch an impostor.
Which fault does a valid certificate for another host produce?
Revocation
Withdrawing a certificate before it expires because its private key leaked or its details changed; clients check revocation lists or status responses. The response to a leaked key is revoke, reissue with a new key, rotate what the key protected.
Valid until it expires is not the same as trustworthy.
What is the response to a leaked private key?
Data at rest and in transit
TLS protects data while it moves between two ends and does nothing for the disk it lands on; disk encryption protects data where it is stored and does nothing for the connection. A control for one state is not a control for the other.
Example: TLS on the portal; encrypted volume on the database host
Common confusion and a question to try
A padlock in the browser says nothing about the server's disk.
What does TLS not protect?
Scanner finding as a claim
A vulnerability scanner matches versions, banners and ports against advisories and reports findings. Each is a claim about a weakness, validated on the host before it is ranked as real or fixed.
Example: 2 vsftpd 21/tcp open: nothing listens on 21 and the unit is inactive
Common confusion and a question to try
Scanner output presented as a verified finding is the mistake the chapter exists to prevent.
What turns a scanner finding into a verified one?
CVSS score
A severity score for a weakness in general, from 0 to 10. It says how bad the flaw is, not whether an exploit is public, whether the host is reachable, or what the host is worth.
Example: cvss 9.9 on an internal host with no public exploit
Common confusion and a question to try
Sorting by CVSS alone puts an unreachable weakness ahead of a reachable one with an exploit.
Which three questions does CVSS not answer?
Exploitability
Whether a weakness can actually be used: a public exploit exists, the affected configuration is in place, the host can be reached. The priority rule adds a bonus for a public exploit.
Example: exploit_available = 1 adds 3
Common confusion and a question to try
A severe weakness with no way to use it is less urgent than a moderate one anyone can use.
Why does a public exploit raise priority?
Exposure
Who can reach the host: the internet, the office network, or only internal systems. The same weakness is more likely to be attacked the wider the reach; an INPUT rule that drops the traffic changes the exposure.
Example: internet +3, office +1, internal +0
Common confusion and a question to try
A database that listens is not exposed to the office if the firewall drops the office.
How does a firewall rule change a finding's exposure?
Asset value
What the host is worth to the business, as a small number the assets table carries. The same weakness on the payroll server outranks the one on a test box.
Example: assets.value from 1 to 3
Common confusion and a question to try
Value is business impact, not hardware cost.
Why is the asset's value part of the rule?
Priority rule
Severity, exploitability, exposure and impact combined by a written formula in the query: CVSS plus bonuses, rounded. The weights are a decision anyone can rerun, argue with and change in one place.
A rule by feel cannot be rerun; a rule in the query can.
What makes the queue reproducible?
False positive
A scanner claim the host disproves: nothing listens, the unit is inactive, the traffic is already dropped. Recorded with the command output that disproves it so the next scan does not reopen it.
Example: 2 FALSE-POSITIVE: ss shows no 21/tcp; systemctl is-active vsftpd prints inactive
Common confusion and a question to try
A critical label does not outrank an inactive service.
How is a false positive recorded?
Validation evidence
The command output on the host that decides a claim: ss -tlnp for listening sockets, systemctl is-active for the unit, sudo iptables -L INPUT for what the firewall drops. Saved to evidence files and cited by the verdict.
Example: ss -tlnp > evidence/ports.txt
Common confusion and a question to try
The scanner's severity label is the claim, not the evidence.
Which three commands validate the three claims?
Remediation and retest
The fix, then the same observation that confirmed the finding, run again: is-active now prints inactive, the INPUT chain now shows the DROP, the office now gets connection refused. A fix is proven by the behaviour changing.
A command returning is not the same as the behaviour changing.
How do you prove a remediation worked?
Exception
A finding left unfixed on purpose: with an owner, a reason, a compensating control and an expiry date, after which it returns to the queue. Without those it is neglect with a label.
Example: status = 'exception', expires 2026-10-31
Common confusion and a question to try
Low priority is a ranking; an exception is a decision.
What must an exception carry?
Advisory
The publisher's description of a weakness: affected versions and configurations, the fix, and workarounds. The first thing to read when deciding whether a scanner's match applies to this host.
Example: PA-2026-004: affected 2.3.4 backdoor build only
Common confusion and a question to try
An advisory that does not match the host's version is a false positive in the making.
What does an advisory tell you that the scanner does not?
Remediation queue
The open findings, ordered by the priority rule, with fixed, false-positive and exception rows out of it. Re-run after every fix, verdict and expired exception.
Example: WHERE status = 'open' ORDER BY priority DESC
Common confusion and a question to try
Fixing without recording leaves the queue wrong for everyone else.
What leaves the queue and how?
Authentication, authorisation, accounting
Who you are (a password and a second factor), what you may do (the grants), and what you did (the record). An access review is about the second; MFA is about the first.
Example: mfa proves identity; grants decide access; the log records use
Common confusion and a question to try
MFA does not change what an account is allowed to do.
Which of the three is a grant?
Role-based access
Permissions attached to roles, accounts attached to roles. The roles table is the policy; the grants table is the practice; the review compares them.
Example: roles(role, system, permission)
Common confusion and a question to try
A grant given directly to a person bypasses the role and is the first thing a review finds.
What are the two tables a role review compares?
Access review
A scheduled comparison of accounts and grants with roles and status: leavers still enabled, admins without MFA, grants beyond the role, dormant accounts. Each finding gets an owner's decision and a test that the fix took effect.
Example: the four review queries, run monthly
Common confusion and a question to try
A review without decisions and tests is a report.
What are the four review findings?
Excess grant
A grant the account's role does not allow: a system outside the role, or a higher permission on a system the role may only read. Found with a LEFT JOIN to the roles table on role, system and permission where no row matched.
Example: LEFT JOIN roles r ON r.role = a.role AND r.system = g.system AND r.permission = g.permission WHERE r.role IS NULL
Common confusion and a question to try
Matching on role and system alone misses an elevated permission.
Why does the join need all three columns?
Leaver
An account whose person has left. status says so; enabled says whether it still works. A leaver still enabled is the first finding of any review and the reason offboarding is a checklist.
Example: WHERE status = 'left' AND enabled = 1
Common confusion and a question to try
Disabling the account is one door of five.
What does a leaver still enabled prove about the offboarding?
Multi-factor authentication
A second proof of identity beside the password. Enforced on privileged roles first, as a setting the account cannot skip; a reminder is not a control.
Example: admin role: MFA required
Common confusion and a question to try
One phished password on an admin without MFA is every system.
Why enforce MFA on admins first?
Single sign-on and federation
One identity, proved once, opens many systems; federation lets another organisation's identity provider vouch for its users. Convenient, and it means offboarding the identity once removes access everywhere it was granted through it.
Example: disable the identity, and every federated login stops
Common confusion and a question to try
Systems with their own local accounts are not covered by disabling the SSO identity.
What does SSO change about offboarding?
Offboarding
Revoking every path a leaver has: the password (locked), sudo (line removed), keys (revoked), scheduled jobs (removed), running sessions and processes (ended), and the record with the date and the proof for each.
Locking the password does nothing to a key login or a cron job.
Which five doors does an offboarding close?
Account lock
sudo passwd -l prefixes the hash in /etc/shadow with ! so the password stops working; passwd -S prints L for locked; -u reverses it. The account and its files stay until the record is complete.
Example: alex L 09/23/2026 0 99999 7 -1
Common confusion and a question to try
Locked is not deleted, and not revoked for keys.
What does passwd -l change?
Break-glass account
An emergency account with wide access, kept disabled and sealed, its credentials in a safe, its use alarmed and reviewed. It belongs to no one who leaves, so it is preserved by offboarding and checked by the review.
Example: casey: break-glass, enabled 0, mfa 1
Common confusion and a question to try
Deleting it because nobody uses it removes the emergency plan.
What is the correct state of a break-glass account?
Dormant account
An enabled account nobody has used for a set period, ninety days here: a door with no one watching it. Listed by the review, then disabled or justified by its owner.
Example: WHERE enabled = 1 AND last_login_day < 310
Common confusion and a question to try
A dormant account is not a leaver; it may be a person on leave, which is why the owner decides.
How is dormancy measured?
Decommissioning
Retiring an asset on purpose: certificates and keys revoked, data wiped or migrated, DNS names and firewall rules removed, the inventory updated with the date. A server that merely stops being used is still an asset.
Deleting a server from the inventory is not retiring it.
What does a proper decommission remove?
VLAN
A separate broadcast domain inside one switch, numbered 1 to 4094. Frames in different VLANs never meet at layer 2; a router joins them at layer 3. The office here uses 10 staff, 20 servers, 30 guest, 99 management.
Example: VLAN 30 guest 192.168.30.0/24
Common confusion and a question to try
A VLAN separates frames; it does not decide what the router forwards.
What separates two VLANs, and what joins them?
bridge vlan show
The Linux bridge's VLAN table: one line per port with the VLAN ids it carries, PVID marking where untagged frames enter, and Egress Untagged marking which VLAN leaves without a tag.
Example: eth2 10 PVID Egress Untagged
Common confusion and a question to try
The table names ports, not hosts; the patch panel does that.
What does PVID on a line mean?
Patch panel record
The list of which host is cabled to which switch port. The switch does not know it; the record turns a ticket about a person into a port.
Example: eth2 pc-2 staff
Common confusion and a question to try
Change the port the record names, not the one the ticket guesses.
Why does a switch need a patch panel record?
Access port
A port carrying one VLAN for a plain host: the VLAN is PVID (untagged frames from the host enter it) and Egress Untagged (frames leave to the host without a tag). sudo bridge vlan add dev PORT vid VID pvid untagged.
Example: eth1 10 PVID Egress Untagged
Common confusion and a question to try
A VLAN added without pvid untagged is carried tagged, which a PC never sends.
Which two flags make an access port?
Trunk port
A port carrying several VLANs tagged, so the device at the other end (a router or another switch) can tell them apart. Added with sudo bridge vlan add dev PORT vid VID and no flags. A VLAN missing from the trunk has no gateway.
Example: eth6: 10, 20, 30, 99
Common confusion and a question to try
One missing id on the trunk silences a whole VLAN.
How does a trunk carry four networks on one cable?
PVID
The VLAN that untagged frames entering a port are placed in. Every access port has one; on a trunk it is the native VLAN, and the two ends must agree.
Example: eth2 PVID 30: pc-2's frames enter the guest VLAN
Common confusion and a question to try
PVID is about frames coming in; Egress Untagged is about frames going out.
What happens to a PC whose port has the wrong PVID?
Wrong VLAN
A host whose port carries a VLAN other than its subnet's: its frames enter a network where its gateway and neighbours do not exist, so nothing answers, exactly like a dead cable. Found on the switch with bridge vlan show and the patch panel.
Example: pc-2 on 192.168.10.21 with its port on VLAN 30
Common confusion and a question to try
From the PC it looks physical; the fault is on the switch.
What does a PC on the wrong VLAN see?
VLAN missing from the trunk
A VLAN the switch carries on its access ports but not on the trunk to the router: hosts in it reach each other and nothing else, because their gateway is on the other side of the trunk.
Example: eth6 carries 10, 20, 99 and not 30
Common confusion and a question to try
Every guest fails together; staff are fine.
What is the signature of a VLAN missing from the trunk?
VLAN tag
The VLAN id carried inside each frame on a trunk (802.1Q). Access ports strip it; trunks keep it; a router's sub-interface reads it.
Example: frames on eth6 tagged 10, 20, 30 or 99
Common confusion and a question to try
A tagged frame arriving at a plain PC is not understood.
Where are tags added and removed?
Native VLAN
The VLAN untagged frames on a trunk belong to: the trunk port's PVID. When the two ends of a trunk disagree, untagged frames cross into the wrong network on the far side.
Example: one end PVID 30, the other PVID 10
Common confusion and a question to try
Set the native VLAN the same on both ends, or carry everything tagged.
What is a native VLAN mismatch?
Router on a stick
A router joined to the switch by one trunk, with a tagged sub-interface per VLAN carrying that VLAN's gateway address. It routes between VLANs through the same cable the frames came in on.
A VLAN without a sub-interface has no gateway even when the trunk carries it.
How does one router port serve four VLANs?
Tagged sub-interface
A Linux interface such as eth0.30 that sends and receives frames tagged with one VLAN over its parent: sudo ip link add link eth0 name eth0.30 type vlan id 30, then an address and up.
Example: sudo ip link add link eth0 name eth0.30 type vlan id 30
Common confusion and a question to try
The parent carries the tags and has no address of its own.
What three commands build a VLAN's gateway on a router?
Connected route
A route table line without via: the subnet an interface's own address sits in, reached directly. A router on a stick has one per sub-interface, in interface order, after the default route.
Example: 192.168.30.0/24 dev eth0.30
Common confusion and a question to try
The bare trunk parent has no connected route because it has no address.
Why does eth0 print no route line?
Segmentation
Deciding which networks may reach which, and enforcing it where the networks are joined: on the router's FORWARD chain. VLANs separate; rules segment.
Example: guests reach DNS and the internet only
Common confusion and a question to try
A VLAN without a rule is joined to everything by the router.
Where is segmentation enforced?
FORWARD chain
The rules a router applies to packets passing between its interfaces: sudo iptables -A FORWARD -s SOURCE -d DESTINATION -j DROP. Listed with sudo iptables -L FORWARD; an empty chain forwards everything.
Example: sudo iptables -A FORWARD -s 192.168.30.0/24 -d 10.0.20.10 -j DROP
Common confusion and a question to try
INPUT protects the router itself; FORWARD protects what is behind it.
What does an empty FORWARD chain mean?
Positive and negative tests
Proving a segmentation change twice: what must work still works, and what must not work now fails. Recorded together in the change.
A denied test passes on a host with no network at all; the positive test catches that.
Why does a segmentation change need both tests?
Spanning tree
The protocol that blocks one port of any loop between switches so frames do not circulate forever. A port in state blocking is usually STP doing its job. Not simulated here.
Example: port eth7 state blocking
Common confusion and a question to try
Blocking is not broken.
Why would a healthy port be blocking?
Link aggregation
Two or more cables between the same two devices bundled to act as one link, for bandwidth and for surviving one cable's failure. Not simulated here.
Example: bond0 = eth7 + eth8 to sw-2
Common confusion and a question to try
A bundle is between the same two devices; two links to two places is not aggregation.
What does link aggregation give?
MTU
The largest frame a link carries. Mismatched across a path, large frames are dropped while small ones pass, which looks like an intermittent fault. Not simulated here.
Example: ping works, the file copy stalls
Common confusion and a question to try
Small packets passing while large ones fail is the MTU signature.
What does an MTU mismatch look like?
Hypothesis
A named cause for a symptom, stated before any test: the resolver is misconfigured; the default route is wrong. It is right or wrong, which a test can show; a symptom is neither.
Example: Resolution is broken on pc-1
Common confusion and a question to try
Running every command is not a hypothesis.
What makes a statement a hypothesis?
Predicted observation
What a test will print if the hypothesis is right, written before the test runs. A prediction that fails refutes the hypothesis; one that holds confirms it and points at the fix.
Example: nslookup will time out and ping to 10.0.20.10 will succeed
Common confusion and a question to try
A test without a prediction can only produce output.
Why write the prediction before the test?
Distinguishing test
The one test whose outcome differs between two remaining causes: ping the configured resolver and the real one; compare a port's VLAN line with its neighbour's.
Example: the configured resolver is silent, the real one answers
Common confusion and a question to try
A test both causes would pass distinguishes nothing.
What separates a wrong resolver address from a dead resolver?
Dead resolver
A resolv.conf pointing at an address that does not answer: names time out while addresses work. Fixed by writing the right nameserver line and repeating the failed lookup.
Example: nameserver 10.0.20.99
Common confusion and a question to try
A timeout says the resolver did not answer, not which address is right.
Which two tests prove a dead resolver?
Retest
The same test that showed the fault, run after the fix. It proves the fix, and what it leaves open is the next fault.
Example: ping -c 1 web.example.net | tail -n 1 after the default route is replaced
Common confusion and a question to try
A fix without a retest is a guess with sudo.
What does a retest that still fails tell you?
Misleading symptom
A ticket that describes the network working as specified: a guest who cannot reach the portal, a contractor on guest wifi who cannot reach the switch. Confirmed against the policy and answered, never fixed.
Example: guest cannot open the portal login page
Common confusion and a question to try
Fixing a policy breaks the denied paths the grade tests.
What do you do with a ticket that is not a fault?
Default route
Where a host or router sends packets for any destination it has no other route to: default via GATEWAY. On the office router it points at the ISP; pointing it anywhere else cuts the office off from the internet while internal traffic keeps working.
Example: default via 203.0.113.1 dev eth1
Common confusion and a question to try
Internal servers working while the internet fails points at the default route or NAT, not the switch.
What symptom does a wrong default route on the router give?
Server on the wrong VLAN
A server's access port carrying a VLAN other than its subnet's: its gateway is unreachable, so nobody reaches it, while the server beside it on the right VLAN answers. Compared port to port on the switch.
Which comparison finds a server on the wrong VLAN?
Packet path
Every element a packet crosses between two hosts, in order: the access port, the trunk and its tag, the router's sub-interface, the masquerade, the ISP, the destination, and the reply retracing it. Documented with ip route, the FORWARD and NAT listings and a traceroute.
traceroute shows the layer-3 hops only; the switch is on the path but not a hop.
Why does the switch not appear in traceroute?
Single point of failure
An element on a path with no spare: one switch, one trunk cable, one router, one ISP link. Named in the handover; removed by redundancy, which this checkpoint does not build.
Example: sw-1, the trunk, gw-1, the ISP link
Common confusion and a question to try
Separate VLANs are not redundancy.
Which elements of the office path have no spare?
Entity
A kind of thing the data is about, with one table per kind: businesses, users, inquiries. Relationships between them are carried by keys, not by copying.
Example: businesses, users, inquiries
Common confusion and a question to try
A relationship is not an entity; it is a column that points.
How many tables does a booking service with three kinds of thing need?
Primary key
The column that identifies one row: never empty, never repeated. INTEGER PRIMARY KEY here; the practice database refuses NULL and duplicates in it and generates no numbers.
Example: id INTEGER PRIMARY KEY
Common confusion and a question to try
The practice database does not number rows for you.
What two things does a primary key refuse?
Foreign key
A column whose values must match a key in another table: business_id INTEGER NOT NULL REFERENCES businesses(id). It lives on the many side; the database refuses orphans and refuses deleting a parent that is still pointed at. NULL passes.
NULL in a foreign key means none, not zero, and is allowed unless NOT NULL says otherwise.
Which side of a one-to-many relationship holds the foreign key?
CREATE TABLE
Declares a table: each column with a type and its constraints, one column at a time, parents before the tables that reference them.
Example: CREATE TABLE venues (id INTEGER PRIMARY KEY, name TEXT NOT NULL UNIQUE, town TEXT NOT NULL);
Common confusion and a question to try
A table that REFERENCES another must be created after it.
In what order are related tables created?
Constraint
A rule the database enforces at the boundary: PRIMARY KEY, NOT NULL, UNIQUE, REFERENCES, CHECK, DEFAULT. A row that breaks one is refused with a message naming the column, whoever sent it.
Example: NOT NULL constraint failed: inquiries.event_day
Common confusion and a question to try
Removing a constraint to make an insert work legalises the bad row.
Where is the rule enforced?
UNIQUE
No two rows may share a value in the column (NULLs excepted). users.email is unique so two accounts cannot be one person.
Example: UNIQUE constraint failed: users.email
Common confusion and a question to try
INSERT never overwrites; a duplicate is refused, not merged.
What happens when a second row repeats a unique value?
The database boundary
The last place a bad row can be refused, shared by every application, script and hand-typed statement. Rules that live there cannot be forgotten by a new form.
Example: every path in meets NOT NULL
Common confusion and a question to try
Validation in the application helps the user; the boundary protects the data.
Why enforce rules in the database as well as the form?
Orphan row
A row whose foreign key points at nothing: an inquiry for a business that does not exist. A foreign key refuses it on insert and refuses the delete that would create one.
Example: business_id = 9 when there is no business 9
Common confusion and a question to try
Fix the id or create the parent; never drop the rule.
How does an orphan get refused?
DEFAULT
The value a column takes when an insert leaves it out: status TEXT NOT NULL DEFAULT 'new'. Inserting NULL explicitly is still refused by NOT NULL.
Example: status defaults to 'new'
Common confusion and a question to try
A default fills an omitted column, not an explicit NULL.
When does a default apply?
Transaction
BEGIN, then changes, then COMMIT to keep them all or ROLLBACK to undo them all. A failure inside undoes everything since BEGIN; a transaction left open when the statements end is rolled back.
Example: BEGIN; UPDATE ...; UPDATE ...; COMMIT;
Common confusion and a question to try
Outside a transaction each statement stands alone: a failure leaves the earlier ones in place.
What undoes the changes since BEGIN?
COMMIT
Makes every change since BEGIN permanent, together.
Example: COMMIT;
Common confusion and a question to try
Until COMMIT the changes are provisional.
When do the changes become permanent?
Atomicity
A transaction lands whole or not at all: a refused statement or a crash halfway through leaves no half-record. The property that makes a status change and its payment row one change.
Example: the decline was undone when the orphan was refused
Common confusion and a question to try
Bundling unrelated statements gains nothing; bundle what is only correct together.
Which pairs of changes belong in one transaction?
Document store
A database that keeps each record as one self-contained document rather than rows in related tables. It suits records of varying shape that are read whole and rarely joined; shared facts that must stay consistent still want tables and keys.
Example: form submissions with varying fields
Common confusion and a question to try
A document store copies the business into every inquiry, and the copies drift.
What data fits a document store?
Normalisation
Arranging tables so each fact is stored once and reached by a key: the town lives in businesses, and inquiries point at the business rather than copying it. Repeated facts drift apart and turn one change into many.
Example: town in businesses, business_id in inquiries
Common confusion and a question to try
Copying a value into every row for convenience is the redundancy normalisation removes.
Why does the town live in businesses and not in inquiries?
Boundary value
The values at the edge of a rule: the minimum and maximum themselves, and the ones just outside. A rule of 8 to 60 accepts 8 and 60 and rejects 7 and 61; tests that skip the edges miss the commonest bug.
Example: checkServings(8) is ok; checkServings(7) is too few
Common confusion and a question to try
< and <= differ exactly at the boundary.
Which four values test a rule of 8 to 60?
Validation function
A function that turns an input into a label or a decision: too few, too many, ok. It returns the label rather than printing it, so the caller can act on it, and it is called with the boundaries when tested.
Example: function checkServings(servings, minimum, maximum)
Common confusion and a question to try
Printing the label inside the function throws the result away.
What does a validation function return?
Early return
A return inside an if ends the function at once; later lines never run. Each rule gets its own line, read top to bottom.
Example: if (servings < minimum) { return "too few"; }
Common confusion and a question to try
Only the first return reached runs; the order of the checks matters when they overlap.
What happens to the lines after a return that runs?
Return value
The one value a function hands back to its caller. The caller can print it, add it, compare it or pass it on; a value printed inside the function cannot be used.
Example: return total;
Common confusion and a question to try
A function without a return gives undefined.
Why return rather than print?
Invalid input
Text that is not a number, an empty box, a value outside the rule. Checked in order: empty first, then converted, then tested for NaN, then the rule.
Example: Number("twelve") is NaN; Number("") is 0
Common confusion and a question to try
The empty string converts to 0, which looks valid.
In what order are the input checks made?
NaN
The number that is not a number, produced when text cannot be converted. Every comparison with it is false, so it slips past both boundary checks unless isNaN catches it first.
Example: isNaN(Number("twelve"))
Common confusion and a question to try
NaN < 8 is false and NaN > 60 is false: both checks pass it.
How is NaN caught?
Order of checks
Input checks run in an order that decides what each later check sees: the empty string before conversion, NaN after it, the rule last.
Example: empty, then Number(), then isNaN, then the rule
Common confusion and a question to try
Converting first turns an empty box into a valid zero.
Why test for the empty string before converting?
Rounding money
Money in a quote is a whole number here. Math.round(total * 80 / 100) keeps a percentage discount exact and whole; multiplying by 0.8 can leave a fraction.
Example: Math.round(27 * 4 * 80 / 100)
Common confusion and a question to try
Round once, where the rule says, not at every print.
Why round at the discount rule?
Threshold rule
A rule that applies from a value: the discount from 25 servings, the fee beyond 10 units of distance. From means >=; beyond means >. The words decide the comparison.
Example: servings >= 25; distance > 10
Common confusion and a question to try
Or more and more than are different comparisons.
Which comparison does 'more than' become?
let and reassignment
A total that is changed after it is first computed is declared with let; const would refuse the second assignment. Values that never change are const.
Example: let total = servings * price; total = total + 15;
Common confusion and a question to try
const is a promise not to reassign, not a slower let.
When does a variable need let?
Adapting a function
Changing the one line a new requirement touches rather than rewriting the function: a minimum charge becomes return Math.max(minimumCharge, total). The rest of the rule stays, and its tests still pass.
Example: return Math.max(minimumCharge, total);
Common confusion and a question to try
A rewrite loses the rules that were already right.
How is a minimum charge added to quote?
Scope
Where a name is visible. A variable declared inside a function exists only while the function runs; one declared outside is visible inside. Two variables can share a name in different scopes, and the inner one wins inside its block.
Example: let label inside describe hides the outer label
Common confusion and a question to try
The outer variable is untouched by the inner one.
Which label does console.log(label) print after the function?
Shadowing
An inner declaration with the same name as an outer one: inside the block the inner variable is used and the outer one is unreachable; outside, the outer one is unchanged.
Example: let label = "inside"; inside a function while an outer label exists
Common confusion and a question to try
Shadowing is not assignment: the outer value does not change.
What does the outer variable hold after the function returns?
Trace
Working through a program by hand, line by line, writing each variable's value after each step, and recording the exact output before running. The run then confirms the trace or shows where the understanding was wrong.
Example: pass 1: servings 10, rounds 1
Common confusion and a question to try
Running first and reading the output teaches nothing about why.
What does a trace table record?
else if
A chain of conditions where each is tried only when the ones before it were false; the else runs when none was true. The order of the branches is part of the rule.
Example: if too few, else if too many, else ok
Common confusion and a question to try
Two conditions that can both be true depend on their order.
When does an else if run?
while loop
Repeats its body while the condition is true, checking before each pass; a condition that never becomes false loops forever. Traced by writing the variables after each pass.
The check happens before each pass, so 40 < 40 stops the loop.
How many passes does doubling 5 until it is not below 40 take?
Magic number
A bare number in code whose meaning is not written down: 8, 60, 0.8. Named as a constant it says what it means and changes in one place.
Example: const MINIMUM = 8;
Common confusion and a question to try
A constant declared after its first use is an error.
What does naming a number give?
Tradeoff
A choice between two right ways: early returns read top to bottom but scatter the exits; nested if-else keeps one structure but indents. Naming the tradeoff is part of explaining the code.
Example: early returns versus nested if-else
Common confusion and a question to try
There is often no single correct shape, only a reason for the one chosen.
What is the cost of early returns?
Capacity
What a link can carry: the negotiated speed, 100 or 1000Mb/s. The ceiling every throughput number is measured against.
Example: a 100Mb/s uplink carrying 92Mb/s is full
Common confusion and a question to try
Bandwidth is the ceiling; throughput is what was achieved.
What is a link's capacity measured against?
Throughput
What a link carried over a period: bytes counted in an hour, turned into megabits per second. Judged against capacity, never alone.
Example: 9450000000 bytes in an hour is 21Mb/s
Common confusion and a question to try
40Mb/s is slow on a 50Mb/s link and idle on a gigabit one.
How do bytes in an hour become Mb/s?
Interface counters
What an interface has counted since boot: bytes and packets each way, errors, drops and collisions. ip -s link show DEV prints them; the poller reads the same numbers.
Example: ip -s link show eth0
Common confusion and a question to try
Bytes climbing is normal; errors, drops and collisions climbing are symptoms.
Which counters are symptoms?
Collisions
Frames that collided on a half-duplex link. On a link whose peer is full duplex they climb steadily: the signature of a duplex mismatch.
Example: 18421 collisions on eth0
Common confusion and a question to try
Collisions are impossible on a working full-duplex link.
What do climbing collisions point to?
Negotiated speed
The speed and duplex a link settled on when it came up, reported by ethtool and logged by the kernel in dmesg. Compared against what was recorded when the link was installed.
Example: Speed: 100Mb/s where 1000Mb/s was recorded
Common confusion and a question to try
Without a record of the installed speed, 100Mb/s looks normal.
Where is the installed speed recorded?
Duplex mismatch
One end half duplex, the other full: the half-duplex end counts collisions and transmit errors while the link stays up and slow. Usually auto-negotiation switched off on one side.
Example: Duplex: Half with Auto-negotiation: off
Common confusion and a question to try
The link is up, so ping works; the counters show the fault.
What does the half-duplex end count?
Receive errors
Frames that arrived damaged and were discarded: a bad cable, a bad port or interference. They climb with carrier flaps and without any change in speed or duplex.
Example: 2804 receive errors on eth1
Common confusion and a question to try
Drops are not errors: drops are good frames with nowhere to go.
What do receive errors point to?
Carrier flap
A link losing and regaining carrier for a second or two: logged with timestamps by the network service, felt as a brief drop by everyone behind the link.
Example: eth1: Lost carrier at 12:41:07, Gained carrier at 12:41:09
Common confusion and a question to try
A flap is not a reboot; the device stayed up.
Where are a flap's timestamps?
Dropped packets
Good frames discarded because a queue was full. Drops climbing with no errors at the right speed and duplex, at the busiest hours, mean the link is full.
Example: 9137 dropped on the uplink between 12:00 and 15:00
Common confusion and a question to try
Drops without errors: congestion, not a fault in the cable.
What separates drops from errors?
Congestion
A link asked to carry more than its capacity: throughput at the ceiling, drops climbing, everything through it slow and nothing failing outright.
Example: eth0 at 92 percent with drops climbing
Common confusion and a question to try
A congested link is not broken; it is too small or carrying something it should not.
What is the fix for congestion?
Baseline
What a link normally carries at each hour across several ordinary days, kept so that today can be compared with normal. One peak is not a baseline.
Example: the uplink's baseline peak is 45 percent
Common confusion and a question to try
A baseline is measured over days, not remembered.
Why several days rather than one?
Bits and bytes
Counters are in bytes; link speeds are in bits per second. Multiply bytes by 8 before comparing, and divide the hour's total by 3600 for a per-second rate.
Example: rx_bytes * 8 / 3600 / 1000000
Common confusion and a question to try
Forgetting the 8 makes every link look eight times emptier.
Why multiply by 8?
Utilisation
Throughput as a percentage of capacity: mbps times 100 over speed_mbps. The number dashboards show and alerts compare.
Example: 92Mb/s on a 100Mb/s link is 92 percent
Common confusion and a question to try
Utilisation needs the capacity from the links table; samples alone cannot give it.
How is utilisation computed?
Alert threshold
The utilisation at which monitoring raises an alert, chosen above the baseline peak, below full, and held for several samples so one busy hour does not page anyone.
Example: 80 percent for three consecutive samples
Common confusion and a question to try
A threshold without a baseline is a guess.
What makes a threshold reasoned?
Syslog severity
The sender's judgement of a log line: emergency down to debug, with warning and err above notice and info. Filtering by severity finds what a device thought mattered.
Example: warning: kernel: eth24: Link is Down
Common confusion and a question to try
Severity is set by the program that logged, not by the reader.
Which severities are routine?
Timestamp correlation
Matching a symptom's time with the log lines from the same time on the same device: receive errors in the hour the switch logged Link is Down are one fault.
Example: JOIN events e ON e.host = l.host AND e.day = s.day AND e.hour = s.hour
Common confusion and a question to try
Same time on a different device is a coincidence until proven otherwise.
What must match besides the time?
Configuration baseline
The approved copy of a device's configuration, kept with its checksum list so the running configuration can be compared and restored.
Example: /srv/baselines/r1/interfaces and its SHA256SUMS
Common confusion and a question to try
A baseline is the approved file, not the last backup.
How is the running file compared to it?
Configuration drift
The running configuration differing from the recorded baseline with no change record to explain it. Found by comparing, reversed by restoring, prevented by recording changes.
Example: mtu 9000 where the baseline says mtu 1500
Common confusion and a question to try
Drift is not always wrong; it is always undocumented.
What is the first step when drift is found?
Inventory
The list of what exists on the network: asset, role, location, management address, model and lifecycle status. What audits, compare jobs and pollers work from.
A device not in the inventory is not monitored, not baselined and not audited.
What happens to an unlisted device?
Asset lifecycle
A device's states from purchase to disposal: in service, retired, disposed. The inventory carries the state, and a retired device keeps its row so its history and its address are known.
Example: printer-1 ... retired
Common confusion and a question to try
Retired is a row with a status, not a deleted row.
Why keep a retired device's row?
Shallow copy
A copy one level deep: a spread array is new but holds the same record objects; a spread object is new but its nested objects are shared.
Example: [...records][0] === records[0] is true
Common confusion and a question to try
A shallow copy protects the list, not the records in it.
What does a shallow copy share?
sort in place
Array.sort reorders the array it is called on and returns that same array. Sorting a copy means [...list].sort(...) or list.slice().sort(...).
Example: [...days].sort((a, b) => a - b)
Common confusion and a question to try
sort returns the same array, not a sorted copy.
How do you sort without changing the caller's list?
Grouping
Collecting records under a key in an object: counts[town] for how many, groups[town] for an array of the records themselves, created the first time the key appears.
The first record for a key finds undefined; the || 0 or an empty array handles it.
How is the first record for a new key handled?
Lookup object
An object used as an index: built once from a list with byId[record.id] = record, then any id is found in one step instead of a loop.
Example: byId['Q7']
Common confusion and a question to try
An array needs a search; an object keyed by id does not.
When does building an index pay off?
Comparison count
How many steps a piece of code takes as its inputs grow: a nested loop over n and m items makes n times m comparisons; an index makes n plus m. Counted, not guessed.
Example: 5000 ids against 50000 records: 250 million against 55000
Common confusion and a question to try
For ten items either way is fine; the count matters when the lists are large.
How many comparisons does a nested loop make?
Duplicate reconciliation
Deciding which of several records with the same id to keep, by a written rule: the latest day wins, ties keep the first seen, and the losers are counted as superseded rather than silently dropped.
Example: kept[record.id] = record when record.day > current.day
Common confusion and a question to try
Deleting duplicates by id loses the later update or the earlier truth; a rule says which.
What must a reconciliation rule state?
Superseded
A record that lost to a later record with the same id under the reconciliation rule. Counted and reported so the loss is visible.
Example: Superseded: 2
Common confusion and a question to try
Superseded is not deleted: the count is part of the report.
Why report the superseded count?
Module
A file that exports the functions it wants to share and imports what it needs: the reconciliation rule lives in one module and every report imports it, so it is written and tested once.
Example: export function latestById(records) { ... }
Common confusion and a question to try
A module boundary is about one rule in one place, not speed.
Why keep a rule in its own module?
Accessible name
What assistive technology calls a control: from a label whose for matches its id, a label wrapped around it, aria-label, or a button's own text. A placeholder is never a name.
A visible word near a field is not its name unless it is attached.
Which three things give a field a name?
label for and id
The pairing that attaches a label to a field: the label's for attribute equals the field's id, exactly. Clicking the label focuses the field, and the label is read as the field's name.
Example: for="count" with id="count"
Common confusion and a question to try
for pairs with id, not with name.
What must for match?
fieldset and legend
A fieldset groups related controls and its legend names the group: for radio buttons the legend is the question and each label the answer.
Example: <fieldset><legend>Collection or delivery</legend>...
Common confusion and a question to try
A paragraph above the radios names nothing to a screen reader.
How is a group of radios named?
Input type
email, number, date and the rest tell the browser what the field holds: it checks the format, shows a fitting keyboard on phones and offers a picker where it has one.
Example: type="email"
Common confusion and a question to try
type="email" does not send email; it checks the shape of the value.
What does the type give the browser?
Constraint validation
required, min, max and the type are constraints the browser enforces before submitting, with its own message pointing at the field.
Example: type="number" min="8" max="60" required
Common confusion and a question to try
Browser validation is a first line; the server still checks.
What stops a form with an empty required field?
Placeholder
Text shown inside an empty field as an example. It disappears when typing starts and is not a label.
Example: placeholder="you@example.com"
Common confusion and a question to try
A placeholder used as the only label leaves a filled form unreadable.
When is a placeholder acceptable?
Submit button
<button type="submit"> inside a form: reachable with Tab, pressed with Enter or Space, submits without script. A div with onclick is none of those.
A div styled as a button is still a div to the keyboard.
Why not a clickable div?
Keyboard operable
Everything the form does can be done with Tab, Enter and Space: reaching each control, pressing the button, hearing the errors. The test is to unplug the mouse.
Example: Tab to the button, press Enter
Common confusion and a question to try
Working with a mouse says nothing about the keyboard.
How is keyboard operability tested?
Visible focus
The outline that shows which control has the keyboard. Removing it with outline: none and no replacement makes the form unusable without a mouse.
An attribute naming, by id, the element whose text describes the control: a hint or an error message, read after the control's name. The id must exist.
Example: aria-describedby="email-hint"
Common confusion and a question to try
Placing a hint near a field does not attach it; the reference does.
What must the value of aria-describedby be?
Error message
Text that says what is wrong with a field, placed beside it and tied to it with aria-describedby so it is announced with the field. role="alert" announces it when it appears.
Example: <p id="email-error" role="alert">Enter an email address</p>
Common confusion and a question to try
A red border alone tells a screen reader nothing.
How does a screen reader learn about the error?
Tab order
The order the keyboard visits controls: the source order. A positive tabindex jumps one control ahead of the rest and should not be used.
Example: no tabindex on ordinary fields
Common confusion and a question to try
Visual order and source order can differ; the keyboard follows the source.
What does tabindex="1" do?
Viewport meta
<meta name="viewport" content="width=device-width, initial-scale=1"> in the head: the page is laid out at the phone's real width, unzoomed. Without it phones show a zoomed-out desktop page.
Example: width=device-width, initial-scale=1
Common confusion and a question to try
It does not resize text; it sets the layout width.
What does a phone do without it?
max-width
A width the element will not exceed: a form at max-width 40rem keeps lines readable on a wide screen and shrinks to fit a narrow one.
Example: .inquiry { max-width: 40rem; }
Common confusion and a question to try
max-width is a ceiling, not a fixed width.
What does max-width do on a phone?
Grid layout for fields
display: grid on a field wrapper stacks the label above its field in one column with a gap; width: 100% makes fields fill the form.
Example: .field { display: grid; gap: 0.25rem; }
Common confusion and a question to try
Grid with one column is a stack; columns need grid-template-columns.
How are labels placed above fields?
Media query
@media (max-width: 480px) { ... } wraps rules that apply only while the viewport is 480px or narrower. The rules inside are ordinary rules in a second pair of braces.
Outside the condition the inner rules do not exist.
When does a max-width media query apply?
Responsive layout
A layout that works at every width: at a phone width everything is still present and readable, stacked, with no sideways scrolling. Hiding content to fit is a failure, not a technique.
Example: stacked fields at 375px wide
Common confusion and a question to try
Looking tidy at a narrow width is not the test; losing nothing is.
What is the mobile-width test?
Recovery point objective
How much work may be lost: the longest acceptable gap between the last good backup and a failure. Measured from the backup log, met by backing up often enough.
Example: RPO 15 minutes: at most a quarter hour of orders lost
Common confusion and a question to try
The RPO is about data, not downtime.
How is the RPO achieved measured?
Recovery time objective
How long a service may be down before it is restored. Measured by a timed, verified restore; met by a recovery strategy fast enough.
Example: RTO 60 minutes: back within the hour
Common confusion and a question to try
Downtime exactly at the target meets it.
How is the RTO tested?
Downtime
Minutes from the start of an incident to service restored: end_minute minus start_minute. Multiplied by the hourly loss for the cost.
Example: 740 - 650 = 90 minutes
Common confusion and a question to try
Downtime is time, whatever data was lost.
What two columns give downtime?
Loss estimate
Downtime in hours times the system's hourly loss: a number built from a stated assumption, so it can be argued with and recomputed.
Example: 90 minutes at 1200 an hour is 1800
Common confusion and a question to try
Multiplying minutes by an hourly figure forgets the sixty.
Which assumption is inside a loss estimate?
Last good backup
The latest backup with status ok taken at or before the failure: the recovery point. Failed attempts, however recent, do not count.
Example: MAX(b.minute) over ok backups at or before the start
Common confusion and a question to try
The most recent attempt is not the recovery point if it failed.
Why filter on status?
Restore test
A timed restore onto a machine that does not matter, verified afterwards: the only measurement of the RTO. An unverified restore proves nothing; a system never restored is untested.
Example: restore of orders-db in 60 minutes, verified
Common confusion and a question to try
A backup that has never been restored is a hope.
What makes a restore count?
Quantitative risk
A risk expressed as numbers: how often per year, how long, what an hour costs, multiplied into an expected loss. The numbers are assumptions, stated so they can be changed.
Example: 4 per year × 2 hours × 1200 an hour
Common confusion and a question to try
Precise-looking numbers built from guesses are still guesses; the point is that the guesses are visible.
What is the alternative to a quantitative rating?
Stated assumption
A guess written down where it can be seen and changed: per_year, hours and hourly_loss as columns rather than a total. Every estimate should be traceable to its assumptions.
Example: per_year = 4 for a supplier outage
Common confusion and a question to try
A total without its assumptions cannot be argued with.
Where should assumptions live?
Expected annual loss
per_year times hours times hourly_loss for one threat to one system: the number that orders the improvement plan.
Example: annual_loss 9600 for orders-db's supplier outage
Common confusion and a question to try
Frequent small outages can outrank a rare large one.
What orders the risk register?
Supplier failure
An outage at a vendor two or more systems depend on: one failure, several bills. Found by grouping systems by vendor.
Example: PayGate: orders-db and files
Common confusion and a question to try
Two systems failing together with one cause is a shared dependency, not bad luck.
How is a shared supplier found?
Backup interval
How often backups run. The recovery point can never be better than the interval, so an RPO target tighter than the interval cannot be met.
Example: interval 240 against a target of 60
Common confusion and a question to try
A tighter target needs more frequent backups or replication, not a promise.
What does the interval set a floor on?
Recovery strategy
How a system comes back: restore from backup (RPO of the interval, RTO of the restore), replication to a warm standby (RPO minutes, RTO a switch-over), or two live copies (both near zero, twice the cost). Chosen from the targets.
Example: warm standby for RPO 15 and RTO 60
Common confusion and a question to try
The most expensive strategy is not the right one when the targets do not need it.
What chooses the strategy?
Tabletop exercise
A walk-through of the recovery plan on paper: who calls whom, where the backups are, the order of restores. Finds missing steps; does not measure minutes.
Example: a tabletop found nobody knew the vault password
Common confusion and a question to try
A tabletop is not a restore test.
What does a tabletop find?
Improvement plan
The list of resilience gaps in the order to fix them: untested systems, then restores that missed their target, then the rest, higher tier first within each. Ordered by measured gaps, not assumptions.
Example: files, wiki, portal, then orders-db and mail
Common confusion and a question to try
An improvement plan built from the risk register alone ignores what the tests measured.
What comes first in the plan?
Shared responsibility
A hosted supplier runs the platform and promises its uptime; the data, its backups, the restore tests and the plan stay yours. A deleted mailbox is your problem under a 99.9 percent uptime promise.
Example: security of the cloud is theirs, security in the cloud is yours
Common confusion and a question to try
Uptime is not a backup.
What stays yours with a hosted service?
Security practical checkpoint
One server, a bundle of tickets before an audit: some are faults from the hardening, identity and release chapters, one is not, and sometimes one is outside your reach. Graded on the faults fixed, everything else untouched, the evidence and the handover.
Example: two faults, one false claim, a sorted handover
Common confusion and a question to try
The mark is as much for what was left alone as for what was fixed.
What are the four things a checkpoint grades?
Evidence before change
Every ticket is answered first by a read that changes nothing: the config line, the account state, the service state, the certificate dates. Only then is anything changed, and the read is kept as proof of what was true.
A restart or a lock before the read destroys the evidence.
What kind of command comes first?
Root login over SSH
PermitRootLogin yes lets the root account log in over SSH; the hardening baseline is no, so every administrator logs in as themselves and uses sudo. Fixed by rewriting sshd_config and restarting ssh.
Example: PermitRootLogin no
Common confusion and a question to try
Locking root's password does not stop key-based root logins.
How is root login over SSH closed?
Leaver access
What a person who has left can still do: a password that works, a sudoers line, a key, a cron job, a process. Closed by locking the password and removing each grant, and proved with passwd -S.
Example: alex L 09/23/2026 0 99999 7 -1
Common confusion and a question to try
Deleting the account loses the audit trail; locking keeps it.
What proves a leaver's password is locked?
Validated claim
A scanner finding or a user report checked against the host before anything is changed: a service the scanner calls open that systemctl calls inactive is a false positive, recorded and left.
Example: vsftpd: inactive, no port 21 listening
Common confusion and a question to try
Fixing a false positive is a change with no cause.
What is done with a false positive?
Preservation
The other half of a checkpoint: every service, account, file and rule not named by a fault is exactly as it was. Restarts to be safe, extra locks and removed packages all fail it.
Example: nginx still running; backup still locked; server.pem unchanged
Common confusion and a question to try
Doing more than the faults is not thoroughness; it is unrecorded change.
What does preservation forbid?
Legacy service
A cleartext or unmaintained service still listening, telnet or vsftpd: stopped and disabled, then read back with systemctl is-active and is-enabled.
An INPUT rule that drops a port from a subnet that should not reach it: the database port from the office. Proved by a reach test from a desk PC.
Example: sudo iptables -A INPUT -p tcp --dport 3306 -s 192.168.10.0/24 -j DROP
Common confusion and a question to try
Stopping the database is not a fence; the server needs it.
How is the fence proved?
Passwordless sudo
A NOPASSWD line in sudoers gives an account root without a password: removed by rewriting sudoers without it, keeping the root and %sudo lines.
Example: backup ALL=(ALL) NOPASSWD: ALL, removed
Common confusion and a question to try
grep -v rewrites the whole file: read it back before copying it into place.
What must stay in sudoers after the rewrite?
Certificate expiry
A notAfter in the past. openssl x509 -noout -dates prints the window; only the CA can issue a replacement, so the dates are saved and the renewal escalated.
Example: notAfter=Jun 30 23:59:59 2026 GMT
Common confusion and a question to try
Restarting the web server renews nothing.
Who can fix an expired certificate?
Release verification
openssl dgst -verify with the vendor's public key over the release: Verified OK installs, Verification failure does not, and the vendor is asked with the output as evidence.
Example: Verification failure
Common confusion and a question to try
Matching checksums from the same download prove nothing about who published it.
What happens on Verification failure?
CIA triad
Confidentiality, integrity and availability: the three things a failure or abuse case can break. Naming which one comes first, because the fitting control depends on it.
Example: a mistyped DELETE breaks integrity
Common confusion and a question to try
A backup restores integrity and availability and does nothing for confidentiality.
Which property does a lost unencrypted laptop break?
Threat
A failure or abuse case tied to a specific asset and path, with an actor, a likelihood and an impact. A threat with no asset or path cannot be controlled.
Example: credential stuffing against the portal's login form
Common confusion and a question to try
A vague threat like hackers has no path to put a control on.
What must a threat name?
Inherent risk
Likelihood times impact before any control: the ranking of what would happen if nothing were in place.
Example: 4 × 4 = 16 for the scanner on the portal
Common confusion and a question to try
Inherent risk is the starting point, not the priority list.
What is inherent risk compared against?
Trust boundary
Where the zone changes: office to server room, guest to office, internet to anything. A threat whose from_zone differs from the asset's zone crosses one and needs a control at the crossing.
Example: from_zone office against a server-room asset
Common confusion and a question to try
Two hosts in one zone are not separated by a boundary, whatever their names.
How is a crossing found in the model?
Control type
Preventive stops the case, detective notices it, corrective recovers from it. A case with only one type is protected in one way.
Two backups are two corrective controls, not two layers.
Which type does a backup belong to?
Threat actor
Who or what brings the case: an opportunistic scanner whose likelihood follows exposure, or a targeted actor whose likelihood follows access and motive. Failure cases have no actor and still count.
Example: a leaver with a password against the database
Common confusion and a question to try
Opportunistic and targeted actors are scored on different things.
What does an opportunistic actor's likelihood follow?
Authentication
Proving who is at the keyboard: a password, a key, a second factor. It decides nothing about what the proven person may do.
Example: MFA on the portal
Common confusion and a question to try
Strong authentication with no authorization lets anyone proven do anything.
What does authentication not decide?
Authorization
Deciding what a proven person may do: read this share, delete that order. Least privilege and zero trust are authorization rules.
Example: share writes limited to owners
Common confusion and a question to try
Authorization without authentication limits nobody in particular.
What is checked after authentication?
Detective control
The control that notices a case happening: alerting, review, an audit trail. Without one, a case that gets past prevention stays unknown until the damage is found some other way.
Example: failed-login alerting on the portal
Common confusion and a question to try
Detection is not prevention; it is what limits the damage of a prevention that failed.
What happens to a case with no detective control?
Zero trust
Authorization checked on every request wherever it comes from: being on the office network proves nothing. Adds to least privilege rather than replacing authentication.
Example: a request from a desk PC is checked like one from the internet
Common confusion and a question to try
Zero trust does not mean refusing everyone; it means the network is not a credential.
What does the network prove under zero trust?
Residual risk
What remains after the controls in place have cut likelihood or impact: (likelihood minus the summed likelihood cuts) times (impact minus the summed impact cuts). The number that orders the next control.
Example: (4 - 2) × (4 - 1) = 6
Common confusion and a question to try
A control handles a threat only to the extent of its cut; the residual says how much is left.
How is residual computed here?
Defense in depth
Controls of different types layered on one case, so a preventive control failing still leaves a detective one to notice and a corrective one to recover.
Example: write limits plus change alerts plus a restored backup
Common confusion and a question to try
Two controls of the same type fail the same way.
What makes two controls a layer?
Accepted risk
A case whose named owner decided its residual is not worth another control, recorded with the number and a review date. A decision, not an oversight, and excluded from the open ranking.
Example: the wiki case, accepted by its owner with a review date
Common confusion and a question to try
Unraised is ignored; accepted is decided.
What makes a risk accepted rather than ignored?
Nonrepudiation
Evidence that ties an action or a decision to the person who made it so they cannot later deny it: a signed change, a signed risk acceptance, a log they cannot alter.
Example: the acceptance signed by the wiki owner
Common confusion and a question to try
Nonrepudiation is about denial, not secrecy.
What does nonrepudiation prevent?
Policy, standard, procedure
Three levels of a governance document: the policy says what the organisation requires and who owns it, the standard gives the measurable rule, the procedure gives the steps for one task.
Steps in a policy go unreviewed; rules in a procedure go unfollowed.
Which level holds the measurable rule?
Claim
What the organisation says it does about a control, entered by a named person. A claim is not evidence of anything until a dated artefact stands behind it.
Example: MFA on every admin account
Common confusion and a question to try
A true-feeling claim without evidence is still only a claim.
What turns a claim into a control?
Claims-to-evidence mapping
The table that ties each claim to the artefacts collected to show it: exports, tickets, logs, signed lists, each dated and reviewed. The gaps are the audit findings.
Example: claim 4 has no evidence row
Common confusion and a question to try
The mapping shows the gaps, not the strengths.
What does a LEFT JOIN from claims to evidence reveal?
Evidence window
How long a piece of evidence stays current: a quarterly review needs a ticket from the last three months, a yearly acknowledgement from the last year. Evidence collected at the end of its window is still current.
Example: latest + evidence_months * 30 >= today
Common confusion and a question to try
Old evidence proves the past, not the present.
When does evidence become stale?
Audit, assessment, penetration test
An audit checks claims against evidence and a standard with a verdict; an assessment surveys weaknesses against a framework without one; a penetration test tries to get in with permission and reports what worked.
Example: the auditor asks for the review ticket; the pentester tries the login form
Common confusion and a question to try
None of the three replaces the others.
Which one gives a verdict against a standard?
Review period
How often a policy must be re-read and re-approved by its owner. Overdue when the last review plus the period is before today; an obligation resting on an overdue policy is met by an unchecked document.
The engineer's part: producing dated evidence of controls. Whether the organisation is compliant, or certified, is a verdict given by an assessor, an auditor or a lawyer reading that evidence.
Example: an MFA export dated today
Common confusion and a question to try
An export proves a setting; it does not make the organisation compliant.
Who issues the compliance verdict?
Obligation
A requirement the organisation must meet, from a contract, a regulation or its own charter, resting on a policy and sometimes needing a legal or privacy specialist to interpret.
Example: card payment rules in the PayGate contract
Common confusion and a question to try
A contract clause binds you whether or not anyone read it.
What are the three sources of obligations here?
When to involve a specialist
Personal data, breach notification, contract clauses: legal and privacy questions an engineer answers by bringing the facts and asking, not by deciding alone.
Example: a lost laptop with customer records
Common confusion and a question to try
A password is not encryption, and neither decides the law.
What does the engineer bring to the specialist?
Due diligence
Checking a supplier's claims against evidence before the contract: certificate and its scope, restore test, breach history, what the contract promises. A ticked questionnaire is the supplier's claim.
Example: ISO certificate attached, scope: the data centre only
Common confusion and a question to try
A certificate is evidence for its scope only.
What does due diligence read on a certificate?
No-blame reporting
The rule that a phishing report is thanked whatever was clicked, so people keep reporting. Blame or published names end reporting, and the person who entered a password is the one blame silences.
Example: Thanks for reporting this. Did you click, and did you enter anything?
Common confusion and a question to try
Why they clicked is for the awareness plan, not the reply.
What ends reporting?
Phishing triage
The order to handle reports: credentials entered first (a live password), then clicked (a device to check), then the rest; oldest first within each.
Example: ORDER BY credentials_entered DESC, clicked DESC, reported_day, id
Common confusion and a question to try
The oldest report is not the most urgent.
What comes first in the queue?
Phishing campaign
The same sender or message reported by several people: blocked once, everyone warned once, counted as one campaign with its clicks.
Three reports of one campaign are one problem, not three.
How is a campaign found in the reports?
Awareness metric
Reports per hundred staff and minutes to report, by department: the numbers that measure the behaviour to grow. The click rate belongs in the awareness plan, not on the wall.
Example: finance: 50 per 100, 124 minutes
Common confusion and a question to try
A silent department is unknown, not safe.
Which metric goes on the wall?
Account, identity, region
The account (a twelve-digit number) owns resources and pays; the identity (a user or role) acts and carries policies; the region is where a resource lives and is billed.
Example: sam in account 123456789012, bucket in eu-west-2
Common confusion and a question to try
The identity that created a bucket does not pay for it; the account does.
Which of the three receives the bill?
Simulated cloud account
The practice shell's aws command runs against a model of one account: buckets, policies, a budget and costs. Nothing reaches AWS, results are labelled simulated, and a policy refusal here is never provider-verified access.
Example: AccessDenied from the practice policy
Common confusion and a question to try
The rule is real; the provider's behaviour is not being observed.
What does the practice CLI never prove?
Caller identity
What aws sts get-caller-identity prints: the user id, the account and the ARN the CLI is acting as. Saved as evidence before any change.
Example: arn:aws:iam::123456789012:user/sam
Common confusion and a question to try
It shows who, never a secret.
When is it saved?
Inline policy
A policy attached directly to one identity: statements with an Effect, Actions and Resources. Read with aws iam get-user-policy.
Example: Allow s3:* on *; Deny s3:DeleteBucket on orders-raw
Common confusion and a question to try
A wide Allow does not undo a narrow Deny.
How is an inline policy read?
Deny wins
In policy evaluation an explicit Deny beats any Allow, and nothing is allowed by default. The practice model follows the same rule.
Example: rb on the protected bucket refused despite s3:*
Common confusion and a question to try
Deny first, then Allow, then nothing.
What happens with no matching statement?
Temporary credentials
Keys that expire, issued for a session, so a leaked key stops working. Real practice happens with them in a defined sandbox with a resource list and a verified cleanup.
Example: a sandbox session that ends and deletes what it made
Common confusion and a question to try
A long-lived key in a config file is the risk temporary credentials remove.
Why do sandboxes use them?
Chargeable component
What a service bills: for object storage, gigabytes stored per month by class, requests, and data transferred out. Buckets, users and accounts cost nothing themselves.
Example: 12.4 GB-month of S3 Standard
Common confusion and a question to try
Empty buckets are free; their contents are not.
What are the three S3 meters?
Budget and forecast
A monthly limit with the actual spend so far and the spend forecast at the current rate. Read with aws budgets describe-budgets.
Example: limit 20.0, actual 7.31, forecast 11.90
Common confusion and a question to try
A forecast under the limit is a projection, not a promise.
Which three amounts does a budget carry?
Cost by service
The month's spend grouped by service from Cost Explorer: the biggest line is where to look first, and its cause is different for each service.
Example: Storage 3.42, Glue 2.89, Athena 1.00
Common confusion and a question to try
Same dollars, different causes.
What does grouping by service show?
Budget alert
A message sent when spend or forecast crosses a threshold. It stops nothing; someone reads it and acts, or a sandbox deletes itself on schedule.
Example: exceeded 80% of learning-monthly
Common confusion and a question to try
An alert is not a cap.
What does an alert change on its own?
Leftover resource
A bucket or other resource from a past experiment that nobody owns, still costing money and sometimes exposed. Found by inventory, not by memory.
Example: scratch-2025 with 4.8 MiB and public access unblocked
Common confusion and a question to try
Leftovers are found by listing, not remembered.
How is a leftover found?
Block public access
The bucket setting that stops any policy or ACL from making objects public. New buckets block it by default; older ones may not.
Example: BlockPublicAcls true on orders-archive
Common confusion and a question to try
Blocked is the default to keep, not a feature to add later.
Which buckets may lack it?
Cleanup order
Inventory, keep what must be kept, delete, verify with a listing, record where the contents went. Deletion is the middle step, never the first.
Example: ls --recursive, cp --recursive to the archive, rb --force, ls, a line in evidence
Common confusion and a question to try
A delete before the inventory destroys the only record.
What comes before the delete?
Bucket listing
aws s3 ls with a path shows one level with prefixes as PRE lines; --recursive shows every object; --summarize adds totals; --human-readable scales sizes.
Example: aws s3 ls s3://scratch-2025 --recursive --summarize
Common confusion and a question to try
Without --recursive a partition prefix hides its objects.
Which flag shows totals?
Archive first
Copying what must be kept into a bucket that outlives the cleanup, under the old bucket's name, before deleting anything.
cp leaves the source; the delete is a separate, later step.
Where do the objects go?
Verified cleanup
A listing after the delete that no longer shows the resource, plus the record of what was kept where. Shell history and a smaller bill are not proof.
Example: aws s3 ls after rb --force
Common confusion and a question to try
Intent is not result.
What is the proof?
Cleanup record
One line in the evidence saying what was removed and where its contents are, beside the inventory taken before.
Example: removed scratch-2025; its 2 objects are in s3://orders-archive/scratch-2025/
Common confusion and a question to try
Memory is not a record.
Who reads the record?
RAM and storage in plain language
Explain to a new computer user why closing an application can free RAM while a saved note remains.
Explain to a new computer user why closing an application can free RAM while a saved note remains.
Review the reasoning
Define working memory and saved storage separately.
Use a concrete save/close/reopen example.
Avoid promising that closing or restarting fixes every issue.
RAM holds active working data. Storage holds saved files. If I save a note, close its editor and reopen the same file, the saved words should remain in this simple model. Closing can free application memory, but the exact memory change requires observation.
Common mistakes
Saying RAM and storage are the same resource.
Promising that a restart cures every performance problem.
How would your explanation change if the note was never saved?
Choose a first diagnostic
Ticket A has high memory pressure and 80 GB free storage. Ticket B has normal memory pressure and a storage-full save error. Describe your first check for each.
Ticket A has high memory pressure and 80 GB free storage. Ticket B has normal memory pressure and a storage-full save error. Describe your first check for each.
Review the reasoning
Separate the two ticket observations.
Choose measurements matching each reported resource.
Preserve work and describe a reversible action.
For A, I would inspect memory use and compare it after saving and closing an idle application. For B, I would verify the destination and free storage reported with the save error. I would record the observations before proposing changes.
Common mistakes
Deleting files to treat a memory report.
Declaring a problem fixed without repeating the failed operation.
Ticket A now has normal memory pressure but saving fails. Which evidence changes your next check?
Support a recovery claim
A restore action reports success. What would you record before saying the note was recovered?
A restore action reports success. What would you record before saying the note was recovered?
Review the reasoning
Name the intended backup and target path.
Reopen and compare actual content with expected backup content.
Limit the claim to what was observed.
I would record the target path and expected backup text, reopen the restored file and compare its contents. A matching reopened copy supports recovery of that version at that path. It does not prove that every earlier edit or every other file is intact.
Common mistakes
Using the button click as the only evidence.
Claiming unsaved text was recovered without a copy containing it.
What would you say if the path opens but the text does not match?
Explain source punctuation
Why do the quotes appear in console.log("Ready."); but not in its printed output?
Why do the quotes appear in console.log("Ready."); but not in its printed output?
Review the reasoning
Distinguish source code from the produced value.
Explain the quote delimiters and string contents.
State the exact output.
The quotes tell the parser where the string begins and ends. The value between them is Ready. The print call outputs that value, so these delimiter quotes are absent from the output. Quotes can be part of other string values, but this example does not include them.
Common mistakes
Repeating the whole source as the output.
Claiming quotes can never occur in printed text.
Would matching single quotes change this plain message’s output?
Separate two program faults
Program A has a missing closing quote. Program B runs but prints Save before Check when the request was Check then Save. Explain your repair sequence.
Program A has a missing closing quote. Program B runs but prints Save before Check when the request was Check then Save. Explain your repair sequence.
Review the reasoning
Classify A as syntax and B as an output-order mismatch.
Repair the smallest relevant part of each source.
Run the revised sources and compare exact outputs.
For A, I would restore the closing delimiter and run again to check syntax and text. For B, I would move the complete Check statement before Save, then compare the two new output entries with the request. A successful run is necessary but does not alone prove the required output order.
Common mistakes
Changing words when the fault is only order.
Treating all failures as missing quotes.
What changes if B prints the correct order but one message has an extra word?
Tie output to the source
A successful result remains visible after you edit the program. What evidence supports a claim about the edited program?
A successful result remains visible after you edit the program. What evidence supports a claim about the edited program?
Review the reasoning
Identify which source snapshot produced the old output.
Run the current source and preserve its exact result.
Keep local checking separate from independent review.
The old result describes the source used for that run. I would run the edited source and compare its new output to the brief, recording that source and result together. A local successful check supports that specific behavior; it does not supply human review or establish general programming mastery.
Common mistakes
Treating any green result as evidence for all later edits.
Calling a local automated check independently reviewed.
What can you conclude if the new run reports unsupported rather than syntax?
const versus let
When would you declare a variable with let instead of const, and what goes wrong if you choose const?
When would you declare a variable with let instead of const, and what goes wrong if you choose const?
Review the reasoning
State that const forbids reassignment and let allows it.
Give a concrete case that needs reassignment, such as a running count.
Describe the actual failure: an error naming the const at the line that reassigns it.
I use const by default because most names never need a second value, and the error protects me from accidental reassignment. A running count or a total built up in a loop has to change, so it gets let. If I pick const for it, the program stops at the line that reassigns it with an error naming that variable; nothing after that line runs.
Common mistakes
Saying const makes the value immutable in every sense.
Claiming let is the safer default.
Would you ever change a const to let just to make an error go away?
A function prints undefined
A colleague's total function prints undefined instead of the total. What do you check first, and why?
A colleague's total function prints undefined instead of the total. What do you check first, and why?
Review the reasoning
Name the missing return as the first suspect.
Explain that undefined is a printed value, not a crash, which points at the function's result.
Describe a quick check: log inside the function or read the last line of its body.
undefined means the function finished without handing anything back, so I read the function body for a return. The classic version is a line like price * quantity; that calculates and discards the result. Adding return in front fixes it. If the return is there, I check that the call actually reaches it and that no earlier return exits with nothing.
Common mistakes
Rewriting the whole function before reading it.
Assuming the arguments were wrong when the shape of the output says the return is missing.
How would you tell a missing return from a return inside an if that never runs?
Proving a discount rule
How would you show that a discount function is right, including at the boundary?
How would you show that a discount function is right, including at the boundary?
Review the reasoning
Pick cases below, at and above the threshold, plus a zero or one quantity.
State the expected result for each before running.
Explain why the boundary case is the one most likely to be wrong.
I write the expected answers first: with a threshold of 10, quantity 9 gets no discount, 10 gets it, 11 gets it, and 1 is the smallest sensible order. Then I call the function with each and compare. The boundary is where >= versus > goes wrong, so a passing 10 is the evidence I care most about, and I keep those calls as tests so a later change cannot break them quietly.
Common mistakes
Testing one happy-path number and calling it done.
Reading the code and reasoning that it looks right instead of running it.
What would you add if the discount could also depend on the item?
map versus filter versus a loop
What is the difference between map and filter, and when would you reach for a plain for…of loop instead?
What is the difference between map and filter, and when would you reach for a plain for…of loop instead?
Review the reasoning
map returns a new list of the same length with each item transformed.
filter returns a new list holding only the items that pass a test.
Neither changes the original list.
A for…of loop fits when one pass has to do several things at once, such as printing and accumulating a total.
map is one in, one out: every item becomes a new value in a new list of the same length. filter keeps or drops: the result is shorter or the same length and holds the original items. Both leave the source list untouched, which matters when other code still reads it. I use a for…of loop when a single pass needs side effects or more than one result, such as printing each line while adding up a total; forcing that into map would hide what is going on.
Common mistakes
Saying filter changes the array in place.
Using map for its side effects and ignoring the returned list.
How would you count the items that pass a filter?
A loop that is one item short
A colleague's loop over a list of computers prints undefined for the last one. What do you check first?
A colleague's loop over a list of computers prints undefined for the last one. What do you check first?
Review the reasoning
Suspect an index past the end: indexes stop at length minus one.
Check whether the loop is a counted for loop that runs to length inclusive, or reads list[list.length].
Suggest for…of, which cannot run past the end.
Confirm the fix by running with a list of one item and an empty list.
undefined from an array almost always means an index that does not exist, so I look at how the loop picks its index. A counted loop that runs while i <= list.length reads one past the end on its final pass. I would switch it to i < list.length, or better, to for…of, which visits exactly the items that exist. Then I run it with a one-item list and an empty list to be sure both edges behave.
Common mistakes
Blaming the data rather than the index arithmetic.
Adding a check for undefined instead of fixing the boundary.
What would the same mistake look like in a filter that counts large orders?
Proving a count is right
How would you show that a function that counts orders at or above a minimum is correct?
How would you show that a function that counts orders at or above a minimum is correct?
Review the reasoning
Test an empty list, a list with no matches, a list with every item matching, and a list containing exactly the minimum.
State the expected count for each case before running.
Explain that the boundary case distinguishes > from >=.
I write the cases and their expected answers first: an empty list gives 0, a list where nothing reaches the minimum gives 0, a list where everything does gives its length, and a list containing exactly the minimum must count that item. Then I call the function with each and compare. The boundary case is the one that catches > written where >= belongs, so I keep it as a permanent test.
Common mistakes
Only trying the example list from the brief.
Forgetting the empty list, where a loop body never runs.
Which of those cases would a filter with .length get wrong if it used >?
Arrays, objects and records
What is the difference between an array and an object, and why do programs so often combine them?
What is the difference between an array and an object, and why do programs so often combine them?
Review the reasoning
An array holds values by position; an object holds values by name.
A list of records is an array of objects: one object per thing, one array for the collection.
Reading goes left to right: list, position, property.
Missing properties and missing indexes both read as undefined.
An array is for many things of the same kind in order, so I reach it by position. An object is for the named facts about one thing, so I reach it by property name. Almost every real data set is both: a list of records, where the array gives me the collection and each object gives me a labelled row. I read it left to right, orders[2].price, and I remember that a wrong index or a misspelled property both come back as undefined rather than an error.
Common mistakes
Trying to read a property off the list instead of off one record.
Assuming a missing property throws an error immediately.
How would you pull just the names out of a list of records?
A total that fails on undefined
A report script fails with an error that a multiplication got undefined. Where do you look first?
A report script fails with an error that a multiplication got undefined. Where do you look first?
Review the reasoning
Suspect a property name that does not match the records.
Print one record and compare its keys, letter by letter, with the code.
Check whether the code reads a property off a list instead of off a record.
Confirm the fix on one record before running the whole report.
undefined in arithmetic almost always means the value was never there, so I print one record and compare its keys with the property names in the code. Nine times out of ten it is a spelling or capitalisation difference, such as price versus Price. If the keys match, I check whether the code is reading the property off the whole list rather than one record, because a filter result is a list. Then I re-run on one record before the full report.
Common mistakes
Changing the arithmetic instead of the property name.
Adding a check for undefined that hides the real mistake.
What would the same mistake look like when reading a CSV row?
Proving a revenue total
How would you show that a revenue reduce over a list of orders is correct?
How would you show that a revenue reduce over a list of orders is correct?
Review the reasoning
Work a tiny example by hand first and compare.
Test an empty list, which must give the starting value.
Test a single record, where a missing starting value is easiest to expose.
State each expected result before running.
I write the expected number for a two-record list by hand, run the reduce, and compare. Then I try an empty list, which must give exactly the starting value, and a one-record list, where forgetting the starting value shows up as the record itself or an error. I state each expected result before I run it, so I am checking the code rather than admiring its output.
Common mistakes
Only running the example from the brief.
Skipping the empty list because it seems trivial.
Which of those cases catches a reduce with no starting value?
Absolute versus relative paths
Explain the difference between an absolute and a relative path, and why a script that works from one folder can fail from another.
Explain the difference between an absolute and a relative path, and why a script that works from one folder can fail from another.
Review the reasoning
An absolute path starts at / and means the same thing everywhere.
A relative path starts from the working directory.
A script using relative paths depends on where it is run from.
cd inside a script changes what later relative paths mean.
An absolute path like /home/sam/logs/app.log names one exact file no matter where I am. A relative path like logs/app.log is measured from the folder I am in, so it points somewhere different after a cd or when the script is started from another folder. That is why a script that works on my desktop fails from a scheduled job: the job starts in a different working directory. I either use absolute paths or cd to a known folder first.
Common mistakes
Saying ~ is an absolute path (it is shorthand the shell expands).
Forgetting that cd inside a script moves every later relative path.
Where does cd .. take you from /home/sam/logs?
A move that went wrong
A colleague ran mv on a log file and now cannot find it. What do you ask and check?
A colleague ran mv on a log file and now cannot find it. What do you ask and check?
Review the reasoning
Ask for the exact command and the folder they ran it from.
Check whether the destination was a folder or a new file name (a missing trailing slash renames).
Check the destination folder with ls, and the parent with ls -a.
Explain that mv does not delete; the file exists under some name somewhere.
First I want the exact command and where they ran it, because a relative destination depends on the working directory. If the destination folder did not exist, mv renamed the file to that name instead of moving it into a folder, so I ls the parent for a file called archive. Then I check the folder they meant, and the home folder if they used ~ by mistake. mv never deletes, so the file is there under some name; the job is finding which.
Common mistakes
Assuming the file was deleted.
Running more mv commands before looking.
How would a trailing slash on the destination have prevented the rename?
Proving a count from a log
A ticket asks how many errors a service logged yesterday. How do you produce a number you can stand behind?
A ticket asks how many errors a service logged yesterday. How do you produce a number you can stand behind?
Review the reasoning
Name the exact file and the exact pattern used.
Use grep -c, and show a few matching lines with grep to prove the pattern matches what you think.
Note case-sensitivity and what the pattern might miss.
Save the matching lines to a file and attach them as evidence.
I state the file and the pattern: grep -c ERROR /var/log/app/2026-09-21.log. Then I show a handful of the matched lines with plain grep, so the reader can see the pattern matches real error lines and not the word inside another message. I say whether the search was case-sensitive and whether lower-case errors could exist. Finally I redirect the matches into a file and attach it, so the count can be checked by anyone.
Common mistakes
Reporting a number with no pattern or file named.
Using a pattern that also matches unrelated lines and not checking.
How would you count errors per host from the same file?
Why error is not ERROR
Why does a program treat error and ERROR as different, and what do you do about it before comparing?
Why does a program treat error and ERROR as different, and what do you do about it before comparing?
Review the reasoning
String comparison with === is exact: case and whitespace both matter.
Clean the value first with trim and toUpperCase or toLowerCase, then compare with a constant written in that case.
Clean the data in the code rather than editing the data by hand, so every future line is handled the same way.
Computers compare strings character by character, so a capital E and a small e are simply different characters, and a trailing space is another character again. Before I compare a level from a log I normalise it: level.trim().toUpperCase() === "ERROR". That way a line written error, Error or ERROR with a stray space all count, and I have not touched the source data.
Common mistakes
Fixing the one bad line by hand and leaving the comparison exact.
Lower-casing the value but comparing it with an upper-case constant.
Where in a log-reading loop would you put that clean-up so it runs for every line?
A log counter that crashes on the last line
A colleague's script splits a log on \n and stops with cannot read toUpperCase of undefined. What do you check first?
A colleague's script splits a log on \n and stops with cannot read toUpperCase of undefined. What do you check first?
Review the reasoning
Suspect a blank line: a text that ends with a newline splits into a final empty string.
Explain that "".split(",") gives one empty field, so fields[1] is undefined and a method call on it fails.
Skip blank lines with continue before splitting them, or check fields.length before reading fields[1].
Confirm by running with a log that ends with a newline and with an empty text.
undefined before a dot means a value that was never there. The usual cause in a line loop is a blank line: log files end with a newline, so the last split item is an empty string, and splitting that on a comma gives one empty field. fields[1] is then undefined and toUpperCase cannot run on it. I would add if (line === "") { continue; } at the top of the loop, then test with a text that ends in a newline and with an empty text.
Common mistakes
Deleting the final newline from the data instead of handling it in the loop.
Wrapping the whole loop in a check for undefined rather than skipping the blank line.
What would the same script do with a line that has only two fields?
Proving a per-host report is right
How would you show that your per-host error report is correct?
How would you show that your per-host error report is correct?
Review the reasoning
Count the ERROR lines per host by hand on a small log and compare with the printed report.
Test the edges: an empty log, a log with no ERROR lines, a log that ends with a newline, and a host seen only once.
Explain that a plausible wrong number, such as every host showing 1, is caught only by comparing with the data.
I would take a log short enough to count by eye, write down the expected counts per host first, and run the report against it. Then I would try the edge cases: an empty text should print an empty report, a log with only INFO lines should print no hosts, a trailing newline must not crash it, and a host with a single error must show 1 rather than being missed. If the reset to zero were in the wrong place every host would show 1, which looks plausible, so I compare each number with the log rather than trusting that it ran.
Common mistakes
Trusting a report because it printed without an error.
Only testing the six-line example from the lesson.
Which of those cases would a missing blank-line skip fail?
HTML versus CSS
What is the difference between HTML and CSS, and why are they kept separate?
What is the difference between HTML and CSS, and why are they kept separate?
Review the reasoning
HTML gives structure and meaning: headings, paragraphs, lists, links, images.
CSS gives appearance: colour, size, spacing.
Separation lets one stylesheet restyle many pages and lets tools read the structure without the styling.
A well-structured page works without any CSS at all.
HTML says what each piece is, so a heading is an h1 whether it is red or blue. CSS says how it looks, through rules that select elements and set properties. Keeping them apart means one stylesheet can restyle a whole site, a screen reader can read the structure without caring about colour, and a page still makes sense when the stylesheet fails to load. When I catch myself using a heading because it looks big, that is a sign the two have been mixed up.
Common mistakes
Choosing elements for their default look instead of their meaning.
Saying CSS adds content to the page.
Where does a style element belong, and why?
A page that fell apart
After a small edit, everything below one paragraph on a page has turned bold. What do you check first?
After a small edit, everything below one paragraph on a page has turned bold. What do you check first?
Review the reasoning
Suspect an element opened and never closed near the edit.
Look at the last change and the closing tag of the element that starts the bold run.
Use the browser's guess report or developer tools to find where the element really ends.
Fix the closing tag and confirm the rest of the page returns to normal.
A run of unexpected formatting that starts at one point and never stops is the signature of an unclosed element: the browser guessed where it ends and guessed wrong. I would look at the last edit, find the strong or b that starts the bold run, and check for its closing tag. Developer tools show the element's real extent. Close it, reload, and the rest of the page snaps back.
Common mistakes
Adding styles to force things un-bold instead of finding the unclosed tag.
Rewriting the whole section.
How does the same mistake show up with an unclosed link?
Proving a page is usable without images
How would you show that a page makes sense to someone who cannot see its images?
How would you show that a page makes sense to someone who cannot see its images?
Review the reasoning
Check that every informative image has alt text that carries its meaning, and decorative ones have empty alt.
Read the page with images disabled or with a screen reader.
Check that links and headings make sense on their own.
Record what was checked, with the page and the date.
I turn images off in the browser, or read the page with a screen reader, and read it top to bottom. Every picture that carries information should be replaced by words that carry the same information; a decorative one should vanish silently with alt equal to empty. I also read the headings and link texts on their own, since that is how many people navigate. I note the page, the date and what I found, so the next person can repeat the check.
Common mistakes
Writing alt text that says image or picture.
Only checking one page of a site.
What alt text would you give a company logo that links to the home page?
WHERE versus HAVING
What is the difference between WHERE and HAVING, and when would a query need both?
What is the difference between WHERE and HAVING, and when would a query need both?
Review the reasoning
WHERE filters rows before grouping.
HAVING filters groups after aggregation, so it can use COUNT or SUM.
Both appear when you want to count only some rows and then keep only some groups.
Putting an aggregate in WHERE is an error.
WHERE decides which rows go into the groups; HAVING decides which groups survive after the aggregates are computed. If I want the hosts with two or more ERROR tickets, WHERE level = 'ERROR' narrows the rows first, then GROUP BY host, then HAVING COUNT(*) >= 2 keeps the busy hosts. An aggregate cannot sit in WHERE because at that point there are no groups to count.
Common mistakes
Writing WHERE COUNT(*) >= 2.
Filtering with HAVING on a plain column, which works but scans more rows than needed.
What happens if you select a column that is not in the GROUP BY?
A report that doubled
A report of tickets per site suddenly shows twice as many tickets as exist. What do you suspect and how do you check?
A report of tickets per site suddenly shows twice as many tickets as exist. What do you suspect and how do you check?
Review the reasoning
Suspect the join: a host now appears twice in the hosts table, so every ticket matches twice.
Check with a COUNT per host on the hosts table for duplicates.
Compare COUNT(*) on tickets alone against the joined total.
Fix the data or join on a unique key.
Doubling after a join almost always means the joined table has duplicate keys: if web-1 appears twice in hosts, every web-1 ticket is paired twice. I would run SELECT host, COUNT(*) FROM hosts GROUP BY host HAVING COUNT(*) > 1 to find the duplicate, and compare the plain ticket count with the joined count to confirm the size of the inflation. Then I would fix the duplicate row, or join on a column that is guaranteed unique.
Common mistakes
Dividing the result by two.
Blaming GROUP BY instead of the join.
How would a LEFT JOIN change what the report shows for a host with no tickets?
Standing behind a number
A manager asks how many ERROR tickets each site had last week. How do you produce a number you can defend?
A manager asks how many ERROR tickets each site had last week. How do you produce a number you can defend?
Review the reasoning
State the exact query, including the join and the filters.
Check the join does not drop or duplicate rows: compare totals with and without it.
Show a few of the underlying rows for one site.
Note what the number does not include, such as tickets on hosts missing from the hosts table.
I keep the query and show it with the answer: a join from tickets to hosts on host, WHERE level = 'ERROR' and the date range, GROUP BY site. Before I trust it I compare the summed counts with a plain COUNT over tickets for the same filter; a gap means the join dropped tickets whose host is not in the hosts table, and I say so. Then I list the actual rows for one site so the number can be traced back.
Common mistakes
Reporting the number without the query.
Not noticing rows lost by an inner join.
How would you make the missing hosts visible in the same report?
Reading a mode string
Explain what -rwxr-x--- 1 deploy ops means, and who can do what with that file.
Explain what -rwxr-x--- 1 deploy ops means, and who can do what with that file.
Review the reasoning
A regular file owned by deploy with group ops.
The owner may read, write and run it.
Members of ops may read and run it but not change it.
Everyone else has no access; ownership, not membership, decides who may chmod it.
The leading dash says it is a regular file. deploy owns it and its group is ops. The first three letters, rwx, are the owner's: deploy can read, edit and run it. The next three, r-x, apply to members of ops: they can read and run it but not edit it. The last three are dashes, so any other account gets nothing. Only deploy, or root, can change that mode.
Common mistakes
Reading the three groups as one string.
Assuming the owner is bound by nothing (a 000 mode refuses the owner too).
How would you let ops edit it without opening it to everyone?
Permission denied on my own file
A colleague says: it is my file but cat says Permission denied. What do you check and what do you tell them?
A colleague says: it is my file but cat says Permission denied. What do you check and what do you tell them?
Review the reasoning
Check ls -l or stat: the mode may lack owner read.
Check the folder above: without x on the folder, files inside cannot be reached.
Confirm ownership with the owner column and id.
Fix with chmod as the owner; no root needed.
First I look at the mode with ls -l. Ownership grants the right to change the mode, not the right to read, so a mode like 000 or a folder without x refuses the owner too. If the owner column really is their account, they can fix it themselves with chmod 600 on the file, or chmod u+x on the folder. If the owner column is someone else, that is the real problem and the previous owner or root must hand it back.
Common mistakes
Reaching for sudo before reading the mode.
Forgetting the folder's x bit.
What if the file is theirs but the folder belongs to another account?
Proving a handover is safe
How would you show that a script you handed to the next shift has exactly the access it should?
How would you show that a script you handed to the next shift has exactly the access it should?
Review the reasoning
Show ls -l or stat of the copy: mode 750 and the new owner.
Show the original is untouched.
State who is in the group and why that is the right audience.
Note that the mode was set before the chown.
I paste the long listing of the handover folder: the copy shows -rwxr-x--- with the next technician as owner and the team group. I show the original still in my scripts folder with its old mode and owner. I state that the group holds only the on-call technicians, which is who should run it. And I mention the order I used, mode first then chown, because once it was theirs I could not have fixed a wrong mode.
Common mistakes
Trusting that cp preserved what they wanted without listing it.
Handing it over as 777 to avoid tickets.
What would you check if the next shift still could not run it?
Signal versus noise in a login log
How do you tell an attack from ordinary mistakes in an authentication log?
How do you tell an attack from ordinary mistakes in an authentication log?
Review the reasoning
Count failures per account and per source rather than reading lines one by one.
Repetition against privileged accounts from outside addresses is the pattern.
A single failure from inside is noise; a successful login after many failures is the worst case.
Say what you would check next: the account's role and whether a later login succeeded.
I group the failures: per account and per source address. One or two failures for a staff account from the office network are typos. Many failures for admin or root from an outside address within minutes are password guessing, and if a success follows them from the same address, that account is compromised until proven otherwise. So I count first, look at roles second, and look for the success after the failures last.
Common mistakes
Reading the log top to bottom and reacting to the first failure.
Ignoring successes because only failures look bad.
Which single query would you run first on a logins table?
An evidence file that is empty
A colleague saved the failed logins to an evidence file but it has zero lines. What happened and how do you fix it without touching the log?
A colleague saved the failed logins to an evidence file but it has zero lines. What happened and how do you fix it without touching the log?
Review the reasoning
Suspect the pattern: case, spelling or quoting.
Test the pattern with grep -c before redirecting.
Re-run the redirection from the original log; never edit the log.
Confirm with wc -l on the evidence file.
An empty evidence file after a grep almost always means the pattern matched nothing: lower-case failed instead of Failed, or a missing quote so the pattern was only one word. I test with grep -c until the count is right, then redirect again from the original log into the evidence file. The log itself I never open for editing. wc -l on the evidence file proves the fix.
Common mistakes
Editing the log to make the pattern match.
Assuming grep failed silently because of permissions.
How would you also record which address produced the most failures?
Proving a message was phishing
How would you show a colleague that the message they received was phishing, and what would you keep?
How would you show a colleague that the message they received was phishing, and what would you keep?
Review the reasoning
Show the link's real destination beside its visible text.
Show the sender address against the real domain.
Keep the original message unchanged in the evidence folder, read-only.
Report it through the known channel and say what the real site's address is.
I open the message's source and put the link text and the href side by side: the text says the portal, the address goes to a look-alike domain. I do the same with the sender's domain. I copy the raw message into the evidence folder and make it read-only, so what I report is exactly what arrived. Then I report it, and I tell the colleague the real portal address so they reach it by typing it themselves.
Common mistakes
Forwarding a screenshot instead of the raw message.
Clicking the link to demonstrate the fake page.
What would change if the colleague had already entered their password?
Same subnet or not
Two hosts have 10.0.20.77/26 and 10.0.20.130/26. Can they talk directly, and how do you know?
Two hosts have 10.0.20.77/26 and 10.0.20.130/26. Can they talk directly, and how do you know?
Review the reasoning
A /26 has 64 addresses per subnet: 10.0.20.64–127 and 10.0.20.128–191.
77 is in the first, 130 in the second, so they are on different subnets.
Traffic between them must go through a gateway.
Show the working with the mask 255.255.255.192 or with ipcalc.
A /26 leaves six host bits, so subnets are 64 addresses wide: 10.0.20.0–63, 64–127, 128–191, 192–255. 10.0.20.77 sits in 64–127 and 10.0.20.130 in 128–191, so their network parts differ and they cannot talk directly; each must send through its gateway. I would show it with ipcalc 10.0.20.77/26, whose network line reads 10.0.20.64/26, and the same for 130, whose network line reads 10.0.20.128/26.
Common mistakes
Assuming the same third octet means the same subnet.
Forgetting that network and broadcast addresses are not usable hosts.
What changes if the prefix were /25?
Cannot reach the server
A user says the file server is down, but other people reach it. What do you run on their machine and in what order?
A user says the file server is down, but other people reach it. What do you run on their machine and in what order?
Review the reasoning
Start on the affected host: ip addr for the link state and address, ip route for the gateway.
ping the gateway, then the server by address, then by name, and read which message appears.
Network is unreachable is a route fault; Destination Host Unreachable is a gateway fault; a name failure is DNS.
traceroute when the ping leaves but does not arrive, to see where the path stops.
Since others reach the server, the fault is most likely on the one machine. I check ip addr for a DOWN link or a wrong address and prefix, then ip route for a default gateway on the right subnet. Then I ping in order: the gateway, the server by address, the server by name. The wording of the failure tells me the layer: no route, gateway not answering, or a name that does not resolve. If the ping leaves and dies, traceroute shows the last hop that answered.
Common mistakes
Restarting the server because one user cannot reach it.
Pinging by name first, which mixes DNS faults into the routing question.
What would you check if ping by address works but ping by name does not?
Proving the fix
You changed a client's default gateway. What do you attach to the ticket to show the problem is solved?
You changed a client's default gateway. What do you attach to the ticket to show the problem is solved?
Review the reasoning
The route table before and after (ip route).
A ping to the server by name showing the resolved address and 0% loss.
A traceroute showing the expected hops.
What was wrong in one sentence, and what was changed.
I attach ip route before and after, so the missing or wrong default line is visible next to the corrected one. Then a ping to the server by name: its first line proves DNS resolved the name and its statistics line proves the packets came back. A traceroute shows the hops match the diagram. And I write one sentence: the default gateway was 192.168.10.99, which does not exist; it is now 192.168.10.1.
Common mistakes
Attaching a screenshot of a working browser with no command output.
Fixing two things at once so nobody knows which mattered.
What would you keep if the fix was a resolver change instead?
Refused versus timed out
A colleague says a port is blocked because the connection failed. How do you find out whether it is a firewall or a stopped service?
A colleague says a port is blocked because the connection failed. How do you find out whether it is a firewall or a stopped service?
Review the reasoning
Read the failure: refused means the host answered and nothing listens; timed out means nothing answered.
Ping the host to separate host reachability from the port.
On the server, ss -tln shows whether the service listens at all.
Say what each outcome implies for who fixes it.
Failed is not enough; the word matters. Connection refused means the host is up and no service listens on that port, so it is the service or the port number. Connection timed out means nothing came back: a firewall drop if ping works, the host or the path if ping fails. I ping first, then nc the port, and if I can get on the server, ss -tln tells me whether the service is listening at all. Refused goes to the application team; a timeout with a healthy ping goes to whoever owns the firewall.
Common mistakes
Treating every failure as a firewall.
Forgetting that a refusal proves the host is reachable.
What would ss -tln show on the server in each case?
Only the database port fails
Users reach the web app on srv-1 but the app cannot reach its database on the same server. What do you check?
Users reach the web app on srv-1 but the app cannot reach its database on the same server. What do you check?
Review the reasoning
The host is clearly reachable, so the question is the port.
nc -zv from where the app runs to the database port: refused means the database is not listening, timed out means a rule drops it.
ss -tln on the server to see whether the database listens and on which address.
Check the firewall rule for that port from that source.
Since the web port works, the host and the path are fine, so I test the database port from where the app runs with nc -zv. Refused means the database is not listening, and on the server ss -tln will confirm it or show it bound only to localhost. Timed out means a rule drops that port from that source, and I look at the firewall for 3306 from the app's address. Either way I keep the nc line as evidence.
Common mistakes
Restarting the database before testing the port.
Testing from the wrong source address, which hits different rules.
What if the database listens on 127.0.0.1 only?
Proving a service outage
How do you show that an outage was the service and not the network?
How do you show that an outage was the service and not the network?
Review the reasoning
A ping to the host that succeeds.
An nc test on the service port that is refused.
An nc test on another port of the same host that succeeds.
The one-word conclusion recorded with those three lines.
Three lines make the case: ping succeeds, so the host and the path are up; nc on the service port is refused, so nothing listens there; nc on another port such as ssh succeeds, so the host accepts connections in general. Together they leave only the service. I write service-down next to those lines in the evidence file, so anyone can re-run them and reach the same conclusion.
Common mistakes
Attaching only the failing test.
Concluding firewall from a refusal.
Which single line would change your conclusion to a firewall?
Status code or certificate
A user says the website is down. How do you tell a status code problem from a certificate problem from a network problem, from the command line?
A user says the website is down. How do you tell a status code problem from a certificate problem from a network problem, from the command line?
Review the reasoning
Test the port with nc first: refused or timed out is the network or the service, not the web layer.
Run curl -I on the https address: a code 60 error is the certificate and happened before any request.
A status line is an HTTP answer: read the first digit; 5xx is the server, 4xx the request.
Say who fixes each: certificate owner, application owner, or the network.
I work up the stack. nc -zv on 443 tells me whether anything listens: refused or timed out and I stop at the port. If it succeeds I run curl -I on the https address. A certificate error means the TLS handshake failed and no request was ever sent, so the certificate owner gets it. If I get a status line, the connection and the certificate worked and I read the code: 502 or 503 is the application behind the web server, 404 is the path. Each outcome names a different team.
Common mistakes
Reading a certificate error as a server error.
Trying http on port 443 and concluding the site is broken.
What single command would you run first if the user cannot even resolve the name?
The site works with -k
A colleague fixed a broken site by adding -k to the check script and it went green. What happened and what do you do?
A colleague fixed a broken site by adding -k to the check script and it went green. What happened and what do you do?
Review the reasoning
Say what -k does: it skips the certificate check.
The fault is still there; every browser will still refuse the site.
Remove the flag, read the code 60 error, and record the actual cause: expired or the wrong name.
Escalate to the certificate owner with the curl output and the expiry or subject name.
The script stopped checking the certificate, so it stopped noticing the problem. Nothing was fixed: users in a browser see the same warning. I take -k out, run curl -I again and read the error. If it says expired I send the expiry to whoever renews the certificate; if it says no alternative subject name matches, I send them the subject the certificate carries, which curl -v shows. The check script goes back to failing until the certificate is right, because that is its job.
Common mistakes
Treating -k as a fix.
Escalating to the network team for a handshake failure.
How would you prove the renewed certificate is right without a browser?
Proving a web outage
How do you show that a web outage was the application and not the network, the port or the certificate?
How do you show that a web outage was the application and not the network, the port or the certificate?
Review the reasoning
A ping or port test that succeeds, so the host and the path are up.
An nc test on 443 that succeeds, so the web server listens.
A curl -I that returns a status line, so the certificate verified and HTTP was exchanged.
The code itself, 502 or 503, recorded next to those lines with the one-word conclusion.
Four lines. Ping succeeds: host and path. nc 443 succeeds: the listener is there. curl -I returns HTTP/1.1 502 Bad Gateway: the certificate verified, because a status line only comes after the handshake, and the web server answered. The 502 itself says the front server could not reach its backend. I write bad-gateway next to those lines in the evidence file, so anyone can re-run them and land on the same answer, and the ticket goes to the application owner.
Common mistakes
Attaching only the browser screenshot.
Concluding certificate from a 5xx status.
Which one line would change your conclusion to a certificate problem?
A service is down
A Linux service is not running. Walk me through how you find out why and bring it back.
A Linux service is not running. Walk me through how you find out why and bring it back.
Review the reasoning
systemctl status or is-active to confirm the state: inactive, failed, or actually running.
journalctl -u NAME -n for the service's own reason: a port in use, a missing file, a bad config.
Clear that cause (end the holder of the port, restore the file) before starting again.
sudo systemctl start, then is-active to prove it; enable if it should survive a reboot.
First the state: systemctl is-active tells me whether it is cleanly stopped or failed. Failed means the last start went wrong, so I read journalctl -u for that unit and look for the line the service itself wrote, not systemd's wrapper lines. Address already in use sends me to ss -tlnp to find what holds the port; a missing file sends me to restore it. Only then sudo systemctl start, and systemctl is-active to prove it. Starting again without clearing the cause just writes the same failure to the journal.
Common mistakes
Restarting in a loop without reading the journal.
Killing the service's process instead of stopping the service.
When would you use restart rather than start?
The disk is full
A server's root disk hit 100% overnight and the application stopped writing. What do you do, in order?
A server's root disk hit 100% overnight and the application stopped writing. What do you do, in order?
Review the reasoning
df -h to confirm which disk and how full.
du -ah on the likely folder (logs first) piped through sort -h to find the one biggest file.
Empty an open log with truncate -s 0, not rm, so the space returns immediately.
df -h again to prove it, then tell the owner and fix rotation so it does not recur.
df -h first, so I know it is the root disk and not a data volume. Then du -ah /var/log | sort -h | tail, because a log is almost always the cause and that names the file. I empty that one file with sudo truncate -s 0: rm would leave the space taken while the service has the file open. df -h again shows the number came back. Then the real fix: whoever owns that log gets the path and size, and log rotation gets set up, because a log that filled the disk once will fill it again.
Common mistakes
Deleting an open log with rm and wondering why df did not change.
Emptying several logs at once and losing evidence.
Why does df not drop after rm on a file a process still has open?
Proving a fix on a server
How do you show that the service you restarted is really fixed, and that you changed nothing else?
How do you show that the service you restarted is really fixed, and that you changed nothing else?
Review the reasoning
The failing state before: is-active printing failed, and the journal line with the cause.
The one action that cleared the cause, named.
is-active printing active after the start.
Any numbers before and after (df, CPU) saved to files, not remembered.
Before and after, in the transcript. Before: systemctl is-active printed failed and journalctl showed the cause. The action: the one command that cleared it, kill of the stray PID or the cp that restored the file. After: sudo systemctl start, then is-active printing active. For a disk I save df -h to a before file and an after file so the numbers are not from memory. That transcript is the ticket, and anyone can re-run the checks and see the same thing.
Common mistakes
Reporting that the restart printed no error as if that were proof.
Leaving the before state out, so nobody can tell what changed.
What would you attach if the service failed again an hour later?
Memory or disk
A user says the server is out of memory. How do you check whether it is memory or disk, and what do the numbers look like for each?
A user says the server is out of memory. How do you check whether it is memory or disk, and what do the numbers look like for each?
Review the reasoning
free -m: available tiny and swap nearly full means memory pressure.
df -h: a filesystem over 90% means disk pressure.
dmesg confirms memory pressure with Out of memory kills.
Say why the two are unrelated even though both make the machine slow.
Two commands settle it. free -m: if available is a few hundred mebibytes and swap is nearly full, it is memory, and dmesg will usually show the kernel killing something. df -h: if a filesystem is over 90%, it is disk. They feel the same to a user, everything slow or dying, but memory is RAM and disk is storage, and the fixes are different: stop or resize the process for memory, find and empty the file for disk.
Common mistakes
Reading the free column instead of available.
Treating a full swap as a disk problem because swap lives on a disk.
What single line of dmesg would confirm memory pressure?
Emergency mode
A server came up in emergency mode after a disk was removed. What happened and what is the smallest safe fix?
A server came up in emergency mode after a disk was removed. What happened and what is the smallest safe fix?
Review the reasoning
Emergency mode is systemd failing a required mount; the kernel booted.
journalctl -b -p err names the mount; lsblk shows the disk is gone; /etc/fstab still lists it.
Back up /etc/fstab, remove that line, keep the backup.
Reboot and confirm with journalctl -b -p err showing no entries.
The kernel and systemd are fine; a line in /etc/fstab asked for a disk that is no longer attached, so the mount failed and systemd stopped. journalctl -b -p err shows Failed to mount, lsblk confirms the device is missing, and cat /etc/fstab shows the line. The smallest safe change is sudo cp /etc/fstab /etc/fstab.bak, then a copy without that line put in place, then a reboot. If the disk comes back, the backup says exactly what to restore.
Common mistakes
Reinstalling or reformatting the root disk.
Editing fstab with no backup.
What option in fstab would have let the boot continue without the disk?
Proving a capacity finding
How do you show that a machine is short of memory and not of disk, in a way someone else can check?
How do you show that a machine is short of memory and not of disk, in a way someone else can check?
Review the reasoning
free -m saved to a file, with available and swap read out.
df -h saved to a file showing the disks are fine.
The dmesg Out of memory line quoted.
The one-word conclusion next to those, and the reversible action taken.
Three outputs saved as text: free -m showing available at a few hundred mebibytes and swap nearly full, df -h showing every filesystem well under 90%, and the dmesg line where the kernel killed a process for memory. The conclusion, memory-pressure, sits next to them in the evidence folder, with the action taken: the named process stopped and free -m run again. Anyone can re-run the same three commands and land on the same word.
Common mistakes
Quoting numbers from memory.
Reporting the conclusion without the df line that rules disk out.
What would you add if the finding was disk pressure instead?
A user cannot log in
A user says they cannot log in. Walk me through what you check before you change anything.
A user says they cannot log in. Walk me through what you check before you change anything.
Review the reasoning
Name the competing causes: wrong password, locked account, wrong host or service down.
Read the authentication log for that user; each cause leaves a different line.
A pam_faillock lock line means unlock, not reset.
Act on the line you found and record it in the ticket.
I list what it could be: they are typing the wrong password, the account is locked from earlier failures, or they are on the wrong machine. Then I read auth.log for their name. Repeated Failed password lines with nothing else is a password problem; a pam_faillock line saying temporarily locked means the password may be right and the lock is what stops them, so I unlock and say so. Resetting a password on a locked account wastes their time and mine. The line I found goes in the ticket as the cause.
Common mistakes
Resetting the password before reading the log.
Reading the count of failures but not the last line.
What would you look at if the log had no lines for that user at all?
The backup says success
A file on the share is damaged. The backup job has reported success every night. How do you get the file back safely?
A file on the share is damaged. The backup job has reported success every night. How do you get the file back safely?
Review the reasoning
Find last night's copy in the backup location.
Restore it into a separate folder, not over the live file.
Verify with sha256sum that the restored copy matches the backup, and with diff what the live copy lost.
Only then hand it over, keeping the damaged copy for the record.
Success in the job log only means it copied something. I copy last night's version into my own restore folder, never over the live file, so the damaged copy stays as evidence and nothing new can break. sha256sum on the backup copy and the restored copy must print the same fingerprint; diff against the live copy shows exactly what was lost, which goes in the ticket. If the newest backup is also damaged I go back a night and check its fingerprint against a known-good one. Then the user gets the restored file, and the change to the share is its own recorded step.
Common mistakes
Copying the backup straight over the live file.
Trusting the backup date without checking the content.
What would you do if every backup copy had the same damage?
Proving a change and its rollback
How do you show exactly what a change did, and that a rollback put things back?
How do you show exactly what a change did, and that a rollback put things back?
Review the reasoning
A backup of the file taken before the change, in a named place.
A diff of the backup against the live file after the change, showing only the intended line.
After a rollback, the same diff printing nothing, or a checksum matching the backup.
The change record naming when, why, the rollback path and the check.
The backup taken first is the whole proof. After the change, diff backup live shows one added line and nothing else, which is what the change record said would happen. If the change is wrong I copy the backup back and run the diff again; no output means the file is exactly what it was, and a matching sha256sum says the same thing in one line. The record holds the time, the reason, where the backup is and which command verified it, so anyone can check without asking me.
Common mistakes
Describing the change from memory instead of a diff.
Rolling back by editing the file by hand.
Which of those two checks would you attach to a ticket, and why?
Four tickets at once
Four tickets land on one server at the same time. How do you decide what to do first, and how do you know which ones are real?
Four tickets land on one server at the same time. How do you decide what to do first, and how do you know which ones are real?
Review the reasoning
Order by impact: everyone, then what fails soon, then one team, then noise.
One line of evidence per ticket before any fix: service state, journal, df, ps.
A ticket whose evidence shows nothing wrong is noted and left alone.
Fix each real fault the way its cause demands, and nothing else.
First the order: whatever affects everyone, then whatever is about to fail, then a single team, and anything that harms nobody goes last. Then evidence for each before I change anything: is-active and the journal for a service, df for a disk, ps for a process. That is where the noise falls out: an idle script or a past out-of-memory kill with healthy memory is not a fault, and I write it down as such so nobody later kills it to be safe. Then the fixes, one cause at a time, and I re-check the whole server afterwards.
Common mistakes
Working in ticket-number order.
Killing or restarting things that were not faults to be thorough.
Which of the four would you take first if the disk were at 99% instead of 89%?
What you cannot fix
One of your tickets turns out to be outside your reach. How do you handle it without losing the others?
One of your tickets turns out to be outside your reach. How do you handle it without losing the others?
Review the reasoning
Recognise it from evidence: no ping reply, an expired certificate, a removed disk.
Record the evidence command in the transcript, not a summary.
Escalate to the owner with that line, and keep working the fixable tickets.
Say in the handover what is escalated and to whom.
The evidence tells me it is not mine: a printer that does not answer ping, a certificate curl says has expired. I do not spend the hour on it. The evidence line goes in the transcript, the escalation goes to whoever owns the printer or the certificate with that line attached, and I go back to the faults I can fix. The handover lists it as escalated, with the owner, so the next shift does not rediscover it.
Common mistakes
Trying to fix it from the server anyway, for example by adding -k to a certificate check.
Escalating with a description instead of the command output.
How would you write the escalation line for an expired certificate?
Proving the whole server is right
How do you show that you fixed the faults and changed nothing else?
How do you show that you fixed the faults and changed nothing else?
Review the reasoning
The state of each fixed thing afterwards: is-active, df, stat, in the transcript.
The state of the things you did not touch: other services still active, other files unchanged, other people's processes still running.
A sorted handover naming fixed, escalated and noted items.
The change log with one line per action and a Collateral: none statement you can back up.
Two lists. What I fixed, each with its proof afterwards: is-active printing active, df showing the space back, stat showing the mode. And what I did not touch, which is the harder half: the other services still active, the share and the backup unchanged, alex's process still there. The handover is sorted so anyone can compare it with theirs, and the change log has one line per action. If I cannot say collateral: none and back it up, I am not done.
Common mistakes
Proving only the fixes.
Reporting from memory instead of from the transcript.
What single command would you run last to check you left another team's service alone?
A name goes to the wrong place
One user says a site times out; for everyone else it works. How do you find out what is different on their machine?
One user says a site times out; for everyone else it works. How do you find out what is different on their machine?
Review the reasoning
Compare what a program resolves (the first line of ping) with what DNS says (dig +short).
Disagreement means /etc/hosts on that machine; agreement with a dead address means DNS.
dig +short shows an alias chain and whether it ends in an address.
Fix the hosts line by rewriting the file with sudo cp; escalate a stale record to the zone owner.
One machine only points at that machine. I run ping once and read the address it resolved, then dig +short for DNS's answer. If they differ, a line in /etc/hosts is overriding DNS on that PC, and I remove it with a grep -v copy and sudo cp. If they agree and nothing answers there, the record itself is stale, everyone is affected, and the zone owner fixes it while a temporary hosts line bridges the one user. dig also shows me whether the name is an alias and whether the alias ends in an address.
Common mistakes
Restarting DNS for a one-machine problem.
Editing /etc/hosts with a redirect after sudo, which fails.
What would you check if dig itself timed out?
A whole floor has 169.254
Fourteen users on one floor cannot reach anything and all have 169.254 addresses. What happened and what do you do?
Fourteen users on one floor cannot reach anything and all have 169.254 addresses. What happened and what do you do?
Review the reasoning
169.254 means no DHCP lease: the machines self-assigned.
Many machines at once means the scope or the path to it, not the PCs.
dhclient -v on one PC shows No DHCPOFFERS received; ip addr rules out a downed link.
Escalate to the scope owner with that evidence; a temporary static address can bridge one critical machine.
Every 169.254 address is a machine that asked for a lease and got nothing. Fourteen at once is one cause: the DHCP scope is down or unreachable from that floor. On one PC I check ip addr to rule out a downed link, then dhclient -v, which prints three DISCOVERs and No DHCPOFFERS received. That line goes to whoever runs the scope. If one machine cannot wait, I give it an address in the subnet, the gateway and a nameserver line by hand, write that down, and undo it when the scope is back.
Common mistakes
Rebooting the PCs, which asks the same dead scope again.
Leaving static addresses in place after DHCP returns.
How would the picture differ if only one user had 169.254?
Proving where a name resolves
How do you show, in a way someone else can check, why a name went to the wrong address and that your fix worked?
How do you show, in a way someone else can check, why a name went to the wrong address and that your fix worked?
Review the reasoning
The first ping line with the resolved address, and dig +short with DNS's answer, side by side.
cat /etc/hosts showing the override line, before.
The same ping after the change, reaching the right host.
For DHCP, dhclient's last lines saved to a file and a successful ping by name after.
Before and after, in the transcript. Before: ping's first line shows the address the program used, dig +short shows what DNS says, and cat /etc/hosts shows the line that explains the difference. After: the hosts file without that line and a ping that gets a reply. For a lease problem it is dhclient -v's last lines saved to a file, then a ping by name that succeeds, because that one line proves the address, the route and the resolver together. Anyone can re-run those commands and see the same thing.
Common mistakes
Quoting the address from memory.
Proving the address changed but not that the name now reaches a host.
Which single command tests address, route and DNS at once?
How a packet leaves a router
Explain how a router decides where to send a packet, and what a missing route looks like from a host behind it.
Explain how a router decides where to send a packet, and what a missing route looks like from a host behind it.
Review the reasoning
The table: default, static routes, connected routes; longest prefix wins.
A missing static route sends the traffic down the default, usually to the ISP.
The ISP answers Destination Net Unreachable for a private subnet.
Forwarding must be on for a Linux box to pass anything at all.
The router looks for the most specific line that matches the destination: a connected subnet, a static route, or the default. If the static route for the branch is missing, the branch traffic matches the default and goes to the ISP, which has no route to a private subnet and replies Destination Net Unreachable from its own address. That reply is the signature: the fault is a missing route on our side. And on a Linux router none of it works unless net.ipv4.ip_forward is 1.
Common mistakes
Reading Destination Net Unreachable as the destination being down.
Assuming two interfaces make a router.
What would the same missing route look like in traceroute?
The office lost the internet
The router reaches the internet but the office behind it does not. What are the candidates and how do you separate them?
The router reaches the internet but the office behind it does not. What are the candidates and how do you separate them?
Review the reasoning
The router reaching the internet rules out its default route and the ISP link.
Private addresses behind it need masquerade: check sudo iptables -t nat -L POSTROUTING.
A rule on the LAN interface counts as missing.
Prove from a host behind the router, not from the router.
If gw-1 itself pings the web server, its default route and the ISP link are fine, and the difference between gw-1 and pc-1 is the address: gw-1's is public, pc-1's is private and gets no replies. So I read the nat table. Empty, or a MASQUERADE rule on the wrong interface, is the fault; the rule goes on the ISP-facing interface. Then I prove it from pc-1, because a ping from the router proved nothing about the office in the first place.
Common mistakes
Testing from the router and calling it fixed.
Putting the masquerade rule on the LAN side.
How would you tell a NAT problem from a wrong default route?
Proving a routing change
How do you show that a routing or NAT change worked and changed nothing else?
How do you show that a routing or NAT change worked and changed nothing else?
Review the reasoning
ip route saved before and after the change.
The nat chain listing after.
A ping or traceroute from a host behind the router, not from the router.
The one command that made the change, in the record.
Before and after, from the right place. The route table saved before the change and listed after; the nat chain after; and the proof measured from behind the router: pc-1 pinging the branch or the web server, or a traceroute showing every hop answer. A ping from the router itself only proves the router's own address works. The record holds the one command that changed things, so the rollback is one command too.
Common mistakes
Proving from the router.
Changing two things and not knowing which one worked.
What would a traceroute from pc-1 show before the masquerade rule?
Hardening a fresh server
You are handed a new Linux server that runs a web portal and a database. What do you change first, and how do you know you have not broken it?
You are handed a new Linux server that runs a web portal and a database. What do you change first, and how do you know you have not broken it?
Review the reasoning
List what listens with ss -tlnp; stop and disable what is not needed.
Fence the database port to the hosts that need it with an INPUT rule scoped by port and source.
PermitRootLogin no and PasswordAuthentication no, keys kept, ssh restarted, new login tested.
Prove the portal and SSH still work from a client, not from the server.
First the attack surface: ss -tlnp tells me what answers the network. Anything the server does not need, like telnet, is stopped and disabled. The database stays but gets fenced: one INPUT rule dropping its port from the client subnet. Then SSH: root logins off, passwords off, keys kept, restart the service, and open a second session before I close the first. The proof is from the client side: the portal answers, SSH answers, the database does not. A hardening that breaks the portal is an outage.
Common mistakes
Dropping a whole subnet instead of one port.
Editing sshd_config and never restarting, or restarting without testing a new login.
Which of those steps would you do last, and why?
Locked out after hardening
A colleague hardened SSH and now nobody can log in. What did they most likely do, and how do you avoid it?
A colleague hardened SSH and now nobody can log in. What did they most likely do, and how do you avoid it?
Review the reasoning
PasswordAuthentication no with no authorized key in place, or PubkeyAuthentication turned off.
A private key with mode 0644, which SSH refuses to use.
Test a new session before closing the old one.
Console access or a rollback copy of sshd_config is the way back.
Two usual causes. They turned passwords off before their key was in authorized_keys, or they turned PubkeyAuthentication off along with it; either way the only remaining door is keys and the key does not work. The other is a key with permissions 0644, which SSH ignores with a message people skip over. The rule is to keep the existing session open, make the change, restart ssh, and prove a fresh login works before leaving. The way back is the console or the copy of sshd_config taken before the change.
Common mistakes
Closing the working session before testing.
Blaming the firewall for a key-permissions problem.
What would you look at first if password logins still worked after the change?
Proving a hardening
How do you show an auditor that a server is hardened, and that the hardening broke nothing?
How do you show an auditor that a server is hardened, and that the hardening broke nothing?
Review the reasoning
ss -tlnp before and after, so the removed service is visible.
The INPUT chain listing and a connection test from the client side that is refused.
The two sshd_config lines and a successful key login after the restart.
The portal and SSH tested from a client after every change.
Before and after, from the right places. The listening ports before and after show telnet gone. The INPUT chain listing plus a connection test from a client that is now refused shows the fence, and a portal test from the same client shows the fence did not overreach. The two sshd_config lines and a fresh key login after the restart show SSH is locked and still works. The private key's mode and the sudoers file without its NOPASSWD line close the last two. All of it saved as files an auditor can re-run.
Common mistakes
Showing the commands typed instead of the state after.
Testing only from the server itself.
Which single test proves the database fence without proving too much?
A table that just arrived
A table arrives from a spreadsheet and you are asked for a total per site. What do you check before you trust the answer?
A table arrives from a spreadsheet and you are asked for a total per site. What do you check before you trust the answer?
Review the reasoning
DISTINCT on the grouping column: are there several spellings of one value?
LENGTH against LENGTH(TRIM()): stray spaces.
COUNT(*) against COUNT(column): missing values; placeholders like -1 in numbers.
GROUP BY the cleaned expression and neutralise sentinels with CASE before summing.
I never group a raw column from a spreadsheet. First DISTINCT on it to see the spellings, LENGTH against LENGTH of the trimmed value for spaces, COUNT star against COUNT of the column for gaps, and a look at the number columns for placeholders like -1 or 0 that mean unknown. Then the query cleans as it goes: LOWER(TRIM()) in the SELECT and the same expression in the GROUP BY, COALESCE for the gaps I can name, CASE to turn the sentinel back into NULL so SUM skips it. The source stays untouched and the cleaning is written down.
Common mistakes
Fixing the spreadsheet by hand and losing the record of what arrived.
Summing a column with a sentinel in it.
What would you do about a value that was mixed case in the join key?
The join lost rows
A report joins assets to sites and shows five assets; the table has ten. What happened and how do you prove it?
A report joins assets to sites and shows five assets; the table has ten. What happened and how do you prove it?
Review the reasoning
An inner join drops rows whose key does not match exactly; dirty keys do not match.
Count the source rows, count the joined rows, and list the rows whose cleaned key is missing from the other table.
Join on LOWER(TRIM(key)) and compare the counts again.
Duplicates in the other table would multiply rows instead; check COUNT(*) against COUNT(DISTINCT key) there.
Five of ten means the join key did not match for half the rows, and with a spreadsheet column that is almost always case or spaces. I count the source, count the joined result, then list the source rows whose cleaned key is not in the sites table. Joining on LOWER(TRIM(a.site)) brings the count back to ten. If the count had gone up instead, I would check the sites table for duplicate keys with COUNT(*) against COUNT(DISTINCT site).
Common mistakes
Trusting a plausible-looking total without counting the source.
Cleaning the sites table instead of the join expression.
How would a LEFT JOIN change what you saw?
Proving a table is clean enough
How do you show a reviewer that the numbers in your report rest on clean data?
How do you show a reviewer that the numbers in your report rest on clean data?
Review the reasoning
A validation row: rows, distinct keys, rows with the important fields present, the total with sentinels neutralised.
The list of rows that needed attention, with the reason for each.
The cleaning written in the query, not applied by hand.
The same validation row before and after any import or fix.
One query that returns one row: how many rows, how many distinct keys, how many have the fields the report depends on, and the total with placeholders turned back into missing values. Beside it, the list of rows that needed attention and why. The cleaning lives in the query, so the reviewer can read it, and the same validation row run before and after a change proves the change did what it claims.
Common mistakes
Reporting a total without saying what was excluded.
Cleaning by hand so nobody can rerun it.
Which single number in that row would change if the duplicate were removed?
Which number to report
A manager asks for the average response time. What do you give them, and what do you put beside it?
A manager asks for the average response time. What do you give them, and what do you put beside it?
Review the reasoning
Ask what the number is for; a typical response is the median, especially with outliers.
Give the count it rests on and the extremes.
If a mean is wanted, round it and say whether an outlier moved it.
A share needs its denominator and its n.
I ask what decision it feeds. For a typical response I give the median with the count and the slowest value, because one 240-minute inquiry makes the mean describe nobody. If they need the mean for a report, they get it rounded, with the count and a note that one outlier moved it. Any percentage comes with what it was divided by and how many rows it rests on.
Common mistakes
Reporting a mean alone when one value is huge.
A share without its n.
How would you present a period with only two responses?
The numbers say the team got slower
Period two looks slower than period one. Before you tell anyone, what do you check?
Period two looks slower than period one. Before you tell anyone, what do you check?
Review the reasoning
Same measure, same rounding, same boundary rule in both periods.
Sample sizes: how many inquiries each period had.
The mix: GROUP BY period and site (or channel) to see whether the work changed.
Whether something else changed at the same time, and say so.
First that I am comparing the same thing: the same summary, the same target rule at the boundary, decimals kept. Then the sizes: nine against seven is fine, two against forty is not. Then the mix: grouped by period and site, was period two mostly the slow site? If so the team may be unchanged and the work changed. And I list what else changed in period two, because the numbers cannot tell me which of those things mattered.
Common mistakes
Announcing a cause the data cannot show.
Comparing an integer-divided share with a rounded one.
What one query would settle whether the mix changed?
A memo someone can check
How do you write the summary of these two periods so a reader can verify every number?
How do you write the summary of these two periods so a reader can verify every number?
Review the reasoning
Each number with the query that produced it and the count it rests on.
A reconciliation: parts add up to the whole.
The confounder measured, not just mentioned.
A sentence saying what the data does not support.
Every figure comes from a query I include, with its n. Within target plus over target equals the total, so nothing was dropped or double-counted. The mix is a number, the share of each period from the slow site, not a hunch. And the last sentence says what the data cannot decide, so nobody reads a cause into it that is not there.
Common mistakes
Numbers from memory.
Leaving out the reconciliation.
Which number would you check first if the memo were challenged?
A dashboard number looks wrong
A manager says a dashboard total looks too high. What do you do first, and what do you do next?
A manager says a dashboard total looks too high. What do you do first, and what do you do next?
Review the reasoning
Recompute the total from the source with the region cleaned, and put report and source side by side with the difference.
Read the signature: exactly double means a duplicated join key; short by whole rows means a filter dropped them.
Check how stale the snapshot is: newest source day against the refresh day.
Name the source query the report should reconcile to, and fix the report's query, not the number.
First I reconcile: the source total per region, computed fresh with the region cleaned, next to the report's number with the difference. The difference tells me what kind of bug it is. Exactly double is a join to a table where the key appears twice; I count joined rows against distinct sales to prove it and find the duplicate with GROUP BY and HAVING. Short by a whole row is a filter matching exactly against dirty data. Then the refresh: MAX(day) in the source against the report's refreshed day says what the dashboard cannot know yet. The fix is the report's query and its refresh, never a hand-edited number.
Common mistakes
Editing the displayed number.
Refreshing the report and expecting the join bug to go away.
How would you stop the duplicated key from coming back?
Reconciling under time pressure
The dashboard goes to the board in an hour and two regions do not reconcile. What do you fix and what do you say?
The dashboard goes to the board in an hour and two regions do not reconcile. What do you fix and what do you say?
Review the reasoning
Fix what is provable in the time: the duplicate row and the exact-match filter.
Leave the source untouched apart from the duplicated key; change the report's query.
State the refresh time and what it excludes.
Report the two differences and their causes rather than hiding them.
In an hour I can prove and fix two things: delete the duplicated regions row after counting the join, and change the report's filter to clean the region. Then I rerun the reconciliation and show zero differences, or the difference that remains with its reason. The board gets the refresh time and a line saying which sales the snapshot does not include. What I do not do is type the number I expect into the report.
Common mistakes
Publishing with a number that does not reconcile and no note.
Deleting rows in the source to make the report match.
What would you put in the footer of that dashboard?
Proving a report is right
How do you show that every number on a report is right and current?
How do you show that every number on a report is right and current?
Review the reasoning
A reconciliation query per displayed total, with today's difference, filed beside the report.
The join keys checked for duplicates and the filters listed.
The newest source day and the refresh day, stated on the report.
A chart whose axis starts at zero and whose percentages show their base.
Each number on the report has a query that recomputes it from the source, and the difference today is zero or explained. The join keys are checked for duplicates, the filters are written down, and the report says when it was refreshed and what the newest source row is. The charts start at zero and every percentage says what it is a percentage of. That set is the validation checklist, and it is run before the report goes out.
Common mistakes
Trusting last month's report as the reference.
A chart that is technically correct and visually wrong.
Which check would you automate first?
A colleague wants the customers table
A colleague asks for the whole customers table in a spreadsheet to plan a campaign. What do you give them and why?
A colleague asks for the whole customers table in a spreadsheet to plan a campaign. What do you give them and why?
Review the reasoning
Ask what the task needs and give those columns and rows: the consented list with id, name and email, or counts per postcode if it is a reach question.
Name the identifying columns and explain that masking a value is not the same as anonymising the table.
Point out that consent is exactly yes: never asked and withdrawn are not consent.
Say who may see what and that the access decision is written down.
I ask what the campaign needs. If it is a reach question, the answer is counts per postcode, no people at all. If it is a mailing, it is id, name and email for customers whose consent is exactly yes and whose email is usable, and nothing else: no phone, no birth year. The whole table is personal data and a spreadsheet of it is a copy nobody controls. If they need to confirm identities on the phone, the phone is masked to its last four. And I write down what was given to whom, because access follows the task and the register records it.
Common mistakes
Sending the whole table because the requester is a colleague.
Treating a table with names removed as anonymous.
How would you check whether a counts table can still identify someone?
A retention job that must not go wrong
You have to remove every customer not seen for a year from a table of thousands. How do you run it safely?
You have to remove every customer not seen for a year from a table of thousands. How do you run it safely?
Review the reasoning
Write the rule as a number: today's day minus the period is the cutoff, and before means strictly less than.
Count with the same WHERE first and read a sample of the matching rows.
Run the DELETE with that WHERE, then prove it: rows remaining and the oldest last-seen day, which is not before the cutoff.
Log when it ran, the rule, and how many rows went; keep the record, not the rows.
The rule becomes a cutoff day, and I decide the boundary: last seen before the cutoff goes, on the cutoff stays. I run the WHERE as a COUNT first and look at a few of the rows it matches, so the number is the one I expect. Then the DELETE with the same condition, and straight after it the proof: how many remain and the oldest last-seen day among them, which must not be before the cutoff. The run is logged with the rule and the count. I do not keep a copy of the deleted rows; that would undo the point.
Common mistakes
Running the DELETE before counting.
Using <= at the boundary and removing a day the policy keeps.
What would you do if the count came back ten times larger than expected?
Showing a dataset is handled properly
A reviewer asks how you know the customers dataset is handled properly. What do you show them?
A reviewer asks how you know the customers dataset is handled properly. What do you show them?
Review the reasoning
The register entry: owner, fields with their classification, purpose, retention rule, access by role, quality rules with thresholds.
The numbers behind it from one rerunnable query: rows, missing values, consented, oldest and newest.
The retention run logs and the last quality gate result against its threshold.
The review questions for where the people live, without a claim of compliance.
I show the register entry for the dataset and the query that produces its numbers, so the reviewer can rerun it: how many rows, how many missing emails, how many consented, the oldest and newest last-seen day. Then the retention log with the rule and the counts, the last quality gate result against the threshold that was set before the data arrived, and who may see which columns. What I do not show is a line saying the dataset complies with a law; I list the questions that need a qualified answer and leave that answer to them.
Common mistakes
Declaring compliance in the register.
A threshold that was changed to make the last load pass.
Which register line would you expect a reviewer to challenge first?
A model that is 94 percent accurate
A vendor says their ticket classifier is 94 percent accurate. Should the help desk use it?
A vendor says their ticket classifier is 94 percent accurate. Should the help desk use it?
Review the reasoning
Ask what rows it was scored on, against which truth column, and whether any of them were in training.
Ask for the four counts: missed urgent tickets cost more than false alarms.
Score it per period on your own tickets, with the decimals, and put a plain rule beside it.
Use the model only if it beats the rule on your data, and keep the evaluation reproducible.
Ninety-four percent of what? I would want the rows it was scored on and the truth column, and I would check that none of those rows were used in training, because leakage makes any number look good. Then the four counts, since a missed outage and a false alarm are not the same mistake. I would run it on our own tickets per period, keep the decimals, and score a keyword rule on the same rows. If the rule is as good, we use the rule: it is explainable and it does not drift. Whatever we choose, the rows, the query, the model version and the date are kept so anyone can rerun it.
Common mistakes
Accepting an accuracy figure without its denominator and rows.
Comparing the model to nothing instead of to a plain rule.
How would you tell whether the model has drifted a month after launch?
The score dropped after launch
A classifier scored 90 percent before launch and 40 percent in its first real week. What do you check?
A classifier scored 90 percent before launch and 40 percent in its first real week. What do you check?
Review the reasoning
Check the pre-launch evaluation for leakage: join the scored rows to the training ids.
Compare the mix: share of urgent tickets before and after, and score per period.
Score the clean rows only and compare with a deterministic rule.
Report the finding with the rows and query so it can be rerun, and fall back to the rule if the model is worse.
First the evaluation itself: were any of the scored rows in the training set? A join of the evaluation ids to the training ids answers that, and if it finds rows, the 90 was inflated. Then the data: the share of urgent tickets before and after, because a changed mix is drift and a model trained on one mix meets another. Then I score the clean rows only and put the keyword rule beside it. If the rule is better on real tickets, the fallback is the rule. Everything I ran is kept with its rows and date so the next person can rerun it.
Common mistakes
Retraining before finding out why the score fell.
Blaming the users' tickets for not matching the training data.
What would you keep so the pre-launch score could be reproduced?
Is the generated summary trustworthy
A language model writes the weekly ticket summary. How do you show it can be sent?
A language model writes the weekly ticket summary. How do you show it can be sent?
Review the reasoning
Every cited ticket exists: a LEFT JOIN from the claims to the tickets with no NULL matches.
Every cited value matches the table.
The unsupported share is counted and below a threshold set in advance.
A person reviewed it, and the fallback is the deterministic counts by query.
I treat the summary as a list of claims. A LEFT JOIN from the claims to the tickets on the cited id finds the citations that do not exist; a comparison of the claimed value with the row finds the ones the table contradicts. Counted and given as a share, that is the finding, against a threshold set before the summary was written. A person checks the list before it goes, and if the share is over the threshold the summary does not go: the counts by query go instead. The query and the claims table are kept so the check can be rerun.
Common mistakes
Sending a fluent summary because it reads well.
Checking a sample of claims instead of all of them.
What would you do about a summary that cites a real ticket with the wrong value?
A vague question and a new table
A manager asks which depot is slowest and hands you a table you have never seen. Walk me through the first twenty minutes.
A manager asks which depot is slowest and hands you a table you have never seen. Walk me through the first twenty minutes.
Review the reasoning
Make the question precise: grain, population, measure, period.
Count the denominators and read every column for sentinels and dirty spellings before averaging anything.
Reconcile any existing summary to the source and look for a duplicated key with a joined-rows count.
Say what the data can support and what it cannot before writing the answer.
I start by making the question precise: one row per delivery, deliveries that happened with a recorded lateness, mean late minutes per depot with the count beside it, this week. Then the counts every figure will divide by: rows, recorded, delivered. Then I read the columns: the status has four spellings, so I group by the cleaned value; late_minutes has a -1 that means not recorded, so it leaves the average and gets counted. If a summary already exists I reconcile it to the source; a doubled count means a duplicated key, which a joined-rows count confirms. Only then do I write the answer, with a threshold for small depots and the max beside the mean.
Common mistakes
Averaging the column as found.
Trusting the existing dashboard as the reference.
What would you do if the -1 were not documented anywhere?
The dashboard disagrees with your answer
Your answer says N1 has 4 deliveries and 16 minutes mean lateness; the dashboard says 8 and 11.8. The lead trusts the dashboard. What do you do?
Your answer says N1 has 4 deliveries and 16 minutes mean lateness; the dashboard says 8 and 11.8. The lead trusts the dashboard. What do you do?
Review the reasoning
Reconcile in one query: source count, summary count, difference, honest average, summary average, per depot.
Explain each difference by its signature: exactly double is a duplicated key; a lower average is sentinels averaged in.
Show the duplicate with GROUP BY code HAVING COUNT(*) > 1 and the joined-rows count, then remove it and recount.
Date the snapshot and list the rows it cannot include.
I put the two side by side in one query per depot: my count, the dashboard's, the difference, my average, theirs. N1's count is exactly double, and the depots table has N1 twice, which the joined-rows count proves: sixteen joined rows for twelve deliveries. The lower average comes from averaging -1 and the failed rows. I delete the duplicate row by code and name, recount, and show the dashboard's refresh day against the last delivery day. The lead does not have to take my word: every number has a query they can rerun.
Common mistakes
Arguing about which number is right without the reconciliation.
Editing the dashboard's number by hand.
How would you stop the duplicate depot row coming back?
Defending the report
Defend your depot report in five minutes: the answer, the limitations, and how anyone can check it.
Defend your depot report in five minutes: the answer, the limitations, and how anyone can check it.
Review the reasoning
One bounded sentence: among depots with at least three recorded deliveries this week, which had the highest mean lateness, with the n and the max.
The limitations as numbers: small n, the outlier, the unranked depot, the snapshot's date and defects.
No driver names in the report and the reason.
The reproducibility line: the query, the rows, the counts, the date.
The sentence: among depots with at least three recorded deliveries this week, N1 had the highest mean lateness, 16 minutes over three deliveries, one of them 45. The limitations: N1's mean rests on three rows and one outlier; E3 is not ranked because it has two recorded deliveries; the summary the team has been reading is a day-5 snapshot that doubled N1's count through a duplicated depot row and averaged the -1 sentinels. The report ranks depots and carries no driver names, because the question was about depots. And the line that lets anyone check it: the query, twelve rows, nine with recorded lateness, days one to seven, run today.
Common mistakes
Saying N1 is the worst depot.
Leaving the unranked depot out silently.
What would change your sentence if E3 had five recorded deliveries?
Hash, signature, encryption
Explain the difference between hashing a file, signing it and encrypting it, and what each one proves.
Explain the difference between hashing a file, signing it and encrypting it, and what each one proves.
Review the reasoning
A hash proves two contents are the same; it proves nothing about who produced either.
A signature made with a private key and checked with the public key proves the key holder signed exactly this content.
Encryption proves nothing; it makes content readable only to the key holder.
Passwords use a slow salted hash, not a file hash, and none of this is designed at home.
A hash is a fingerprint: same content, same hash, so I can tell a download matches a published list. It says nothing about who published the list; if the page was replaced, the list was too. A signature fixes that: the vendor signs the hash with a private key that never leaves them, and I verify with their public key, so Verified OK means the holder of that key signed exactly this content. Encryption is a different question: it does not prove anything, it keeps content readable only to whoever has the key. Passwords are their own case: a slow, salted, purpose-built hash, never SHA-256 and never reversible encryption. And I use the standard tools for all of it.
Common mistakes
Treating a matching hash as proof of origin.
Storing passwords with a fast hash or with encryption.
What does a signature not tell you about a file?
A download fails verification
The release you downloaded fails signature verification. Walk me through what you check and what you do.
The release you downloaded fails signature verification. Walk me through what you check and what you do.
Review the reasoning
Check the checksum list first to see whether the content changed.
If the content is intact, the key is the question: which key is current, confirmed from a second channel, not from the same download.
Do not install and do not bypass; record the outputs as evidence and report.
Only a release that verifies against the current key is installed.
First sha256sum -c against the vendor's list: if a file shows FAILED, the content changed after publication and the download is rejected. If every file is OK, the signature failed for the key: I check which key the vendor currently signs with through a channel that is not the download page, and try that key. A signature from a retired key is not acceptance either. Nothing gets installed until the current key says Verified OK, and the outputs go into evidence files so someone else can see why the install did or did not happen. What I never do is add a flag that skips the check.
Common mistakes
Installing because the vendor is trusted.
Fetching a new public key from the same page that served the bad file.
How would you confirm which vendor key is current?
A certificate warning
Users see a certificate warning on the portal. Show me how you diagnose it and what you do not do.
Users see a certificate warning on the portal. Show me how you diagnose it and what you do not do.
Review the reasoning
Read the certificate: subject, issuer, dates.
Verify it against the authority the organisation trusts and read the error number: 10 expired, 20 untrusted issuer.
Compare the subject with the host name users type: a valid certificate for another name is the third fault.
Fix by reissue, by checking the authority, or by issuing for the right name; never by -k or proceed anyway; revoke if the key leaked.
I read the certificate with openssl x509: who it is for, who issued it, and its dates. Then openssl verify against the CA the company actually uses. Error 10 is expired: reissue and install. Error 20 is an issuer we do not trust: I find out why before I trust anything, because an impostor looks exactly like that. If it verifies, I compare the subject with the name users type; a certificate for another host is refused for good reason. The fix is always a correct certificate, and the evidence is the three outputs. I do not add -k to a script and I do not tell users to proceed anyway; and if the private key leaked, it is revoked and reissued today, not when it expires.
Common mistakes
Telling users to click through the warning.
Adding the unknown issuer to the trust store to make the error stop.
What is the difference between an expired certificate and a revoked one?
Three hundred critical findings
The scanner reports three hundred critical findings. Where do you start?
The scanner reports three hundred critical findings. Where do you start?
Review the reasoning
Treat them as claims and separate severity from exploitability, exposure and asset value.
Write the priority rule down and run it, so the queue is reproducible and can be argued with.
Validate the top of the queue on the hosts with command evidence before changing anything.
Record false positives with evidence and exceptions with owner, control and expiry.
Not with the number. Each finding is a claim with a severity attached, and severity is one of three questions. I add the other two: is there a public exploit, who can reach the host, and what is the host worth, and I write that into a rule in the query so the queue is the same for everyone and can be disputed. Then I take the top of the queue to the hosts: is the service running, is the port listening, does the firewall already drop the traffic. Confirmed ones get fixed and retested; false positives get recorded with the output that disproves them; anything left open on purpose gets an owner and an expiry.
Common mistakes
Sorting by CVSS and starting at the top.
Fixing straight from the report without looking at the host.
What would make you move a medium finding above a critical one?
The scanner disagrees with the host
The scanner says a critical vsftpd backdoor is present on srv-1. The admin says nothing runs on port 21. Who is right, and how do you settle it?
The scanner says a critical vsftpd backdoor is present on srv-1. The admin says nothing runs on port 21. Who is right, and how do you settle it?
Review the reasoning
Settle it with evidence on the host: ss -tlnp for the socket, systemctl is-active for the unit, the package or version if relevant.
If nothing listens and the unit is inactive, it is a false positive; record it with the output.
If the service is running, confirm, fix by stopping and disabling, and retest the same observation.
Either way the verdict and the evidence go in the record, not in an argument.
Neither is right until the host says so. I run ss -tlnp and look for 21, and systemctl is-active vsftpd. If nothing listens and the unit is inactive, the scanner matched a package name and the claim is a false positive; I record that verdict with the two outputs so the next scan is compared to it. If it is running, the admin is wrong, the claim is confirmed, and I stop and disable the service and run the same checks again to show the change. The record is the verdict file and the evidence, whichever way it went.
Common mistakes
Believing the severity label over the host's state.
Believing the admin without looking.
What if the package is installed but the service is inactive?
Show me the fix worked
You closed two findings on srv-1 last week. Show me they are really fixed and nothing else broke.
You closed two findings on srv-1 last week. Show me they are really fixed and nothing else broke.
Review the reasoning
The retest outputs: is-active inactive and no 23/tcp in ss; the DROP rule in the INPUT chain and connection refused from the office.
The services that had to keep working, checked: ssh, nginx and the database still active, the office still reaching 443 and 22.
The findings table with the two rows set to fixed and the false positive recorded with its evidence.
The queue re-run from the rule, showing what is still open.
For telnet: the retest after the change, systemctl is-active printing inactive and ss showing nothing on 23, saved with the change. For the database: the INPUT chain listing with the DROP for the office range, and the connection refused from pc-1. Then the things I was not allowed to break: ssh, nginx and mysql still active and the office still reaching 443 and 22. The findings table has those two rows as fixed and the vsftpd row as a false positive with its outputs, and the queue re-run from the rule shows the five that remain.
Common mistakes
Showing the commands that were run instead of the observations afterwards.
Closing the findings without updating the record.
Which retest would you automate first?
Run an access review
How would you run an access review on a system with a few hundred accounts, and what would you do with the findings?
How would you run an access review on a system with a few hundred accounts, and what would you do with the findings?
Review the reasoning
Compare accounts and grants with roles and status by query: leavers still enabled, admins without MFA, grants beyond the role, dormant accounts.
Explain least privilege as roles versus grants, not trust.
Each finding goes to the system's owner for a decision, recorded.
Each fix is tested: the revoked access fails.
The review is four queries over three tables: accounts whose status is left but still enabled; privileged accounts without MFA; grants the account's role does not allow, which a LEFT JOIN to the roles table finds where nothing matched; and enabled accounts nobody has used in ninety days. Least privilege is the comparison of grants with roles, whatever anyone thinks of the person. The findings go to the owners of the systems for a decision, the decisions are recorded, and every revocation is tested by trying the access and seeing it fail. Then the four queries run again next month.
Common mistakes
Reviewing by reading the list and judging people.
Closing findings without testing the revocation.
Which finding would you fix without waiting for an owner's decision?
A leaver who still has access
Six weeks after someone left, their SSH key still works on the build server. What went wrong and how do you fix it?
Six weeks after someone left, their SSH key still works on the build server. What went wrong and how do you fix it?
Review the reasoning
Offboarding closed one door and not five: the password was locked, keys and sudo were not revoked.
Fix now: revoke the key, remove sudo, remove scheduled jobs, end processes, and check for local accounts on systems outside SSO.
Prove each revocation with the observation that it fails.
Fix the process: a checklist with the five doors and a record per leaver, and a review query that catches the gap.
The offboarding treated the account as one thing when it is five: a password, sudo, keys, scheduled jobs and running sessions. Locking the password did nothing to the key. Today I revoke the key and the sudoers line, remove any cron jobs, end any sessions or processes running as them, and look for local accounts on servers that do not use single sign-on. Each revocation is proved by the access failing. Then the process: an offboarding checklist with the five doors, recorded per leaver, and a monthly query for leavers still enabled so the next miss is found in weeks rather than by accident.
Common mistakes
Deleting the account and its files before the record is complete.
Assuming SSO covered a server with local keys.
How would you find every server where that key was accepted?
Prove the offboarding
Show me that a leaver's access on a server is really gone.
Show me that a leaver's access on a server is really gone.
Review the reasoning
passwd -S showing L for the locked password.
The sudoers file without their line, and the admin's and root's lines intact.
The authorized_keys file moved aside, the cron file gone, no process running as them.
The record with the date, who did it and the outputs above, and the services still running.
The proof is one observation per door. passwd -S prints L. grep on sudoers finds no line for them while root's and mine are still there. Their authorized_keys is moved aside, the cron file is gone, and ps shows nothing running as them. The services the server exists for are still active, because an offboarding that breaks the server is a new incident. All of it is in the evidence file with the date and my name, attached to the ticket.
Common mistakes
Showing the commands run instead of the state afterwards.
Proving the password lock and calling the offboarding complete.
What would you check on the identity provider as well?
Access ports, trunks and a router on a stick
Explain how one switch and one router give an office four separate networks.
Explain how one switch and one router give an office four separate networks.
Review the reasoning
VLANs are separate broadcast domains on the same switch; access ports put a plain host into one VLAN untagged.
The trunk to the router carries every VLAN tagged so the far end can tell them apart.
The router has a tagged sub-interface per VLAN with that VLAN's gateway address and routes between them.
Segmentation is then the router's FORWARD rules, not the VLANs themselves.
The switch keeps four VLANs apart: each PC's port is an access port, one VLAN, untagged, with the PVID saying which VLAN its frames enter. The port to the router is a trunk carrying all four VLANs tagged. The router has one physical port and four sub-interfaces, eth0.10 to eth0.99, each holding that VLAN's gateway address, and it routes between them through the same cable. That joins the VLANs again, so which network may reach which is decided by FORWARD rules on the router.
Common mistakes
Saying VLANs isolate networks without mentioning the router that joins them.
A PC has no network since it was moved to another desk; the PC beside it works. Where do you look and what do you check?
A PC has no network since it was moved to another desk; the PC beside it works. Where do you look and what do you check?
Review the reasoning
Turn the ticket into a port with the patch panel record.
Read that port's line in bridge vlan show and compare with the VLAN plan.
If the port is on the wrong VLAN, add the right VLAN with pvid untagged and remove the wrong one.
Test from the PC afterwards and check its neighbours still work.
The PC beside it working tells me the VLAN and the gateway are fine, so the fault is specific to this PC's port. The patch panel record turns the desk into a switch port; bridge vlan show gives that port's VLAN. After a desk move the classic finding is the port on another VLAN, so the PC's frames enter a network where its gateway does not exist and it looks like a dead cable. I add the staff VLAN as PVID untagged, remove the wrong one, then test from the PC and confirm the neighbours and the servers still work.
Common mistakes
Replacing the cable before reading the switch.
Changing the port the ticket guessed at instead of the one the panel names.
What if the whole floor lost its network instead of one PC?
Prove the guest network is segmented
Show me the guest VLAN can reach the internet and nothing internal.
Show me the guest VLAN can reach the internet and nothing internal.
Review the reasoning
The FORWARD chain listing on the router with the two DROP rules.
A positive test from a guest host to an internet name.
Negative tests from a guest host to the portal server and the management address.
A staff test proving nothing else broke, all recorded.
The evidence is the router's FORWARD chain, showing the drops from the guest subnet to the management network and to the portal server, and four tests: from a guest host, web.example.net answers and the portal server and the switch's management address do not; from a staff host, the portal still answers. The listing and the four results are saved with the change. Without the negative tests I have only shown guests have a network; without the positive one I have only shown they might have none.
Common mistakes
Testing only that the denied path fails.
Trusting the VLAN separation without checking the router's rules.
Which of those tests would you run again after every router change?
Five tickets, one morning
You arrive to five network tickets: some desks have no internet, one PC cannot resolve names, guests complain they cannot reach the portal, a server is unreachable, and a note says the trunk was changed last week. How do you work?
You arrive to five network tickets: some desks have no internet, one PC cannot resolve names, guests complain they cannot reach the portal, a server is unreachable, and a note says the trunk was changed last week. How do you work?
Review the reasoning
Sort the tickets by what they share: which device could explain each, and which is the network working as specified.
For each, a hypothesis and the observation a test will show, then the test.
Fix what the evidence proves, retest with the failing test, then read the remaining tickets again.
Name the ticket that is not a fault and answer it instead of changing anything.
I group the tickets by the device that could explain them. No internet for the desks while servers work points at the router's default route or NAT; a PC that cannot resolve names points at its own resolver; a server unreachable while its neighbour answers points at its switch port; the guest complaint is the segmentation policy; the note about the trunk is a note, not a symptom. For each real one I write the hypothesis and what the test should print, run that test, fix what it proves, and rerun the failing test. What is still open after a fix is the next fault. The guest gets a reply, not a change.
Common mistakes
Running every command on every device before forming a hypothesis.
Removing the guest rule because a guest asked.
Which ticket would you test first, and why?
Two faults hiding behind one symptom
The whole office lost the internet. You fixed the router's default route and staff are back, but guests still have nothing. What now?
The whole office lost the internet. You fixed the router's default route and staff are back, but guests still have nothing. What now?
Review the reasoning
Recognise that the retest cleared the first fault and left a second visible.
Form the next hypothesis from the guest symptom: their gateway or their VLAN.
Test on the router first (ip addr show for eth0.30), then on the switch (the trunk's VLAN list).
Fix, retest from a guest host's point of view, and record both faults.
The retest tells me the default route was one fault and there is another, because the guest symptom survived a fix that cured everyone else. Guests differ from staff in one way: their VLAN and its gateway. So the hypotheses are that the guest sub-interface on gw-1 is missing or down, or that VLAN 30 is not on the trunk. ip addr show on the router answers the first; bridge vlan show on the switch answers the second. I fix what the evidence names, retest by reaching the web from a guest, and hand over two fault words, not one.
Common mistakes
Assuming the first fix was wrong and undoing it.
Declaring the outage over when staff came back.
How would you know the guest problem existed before the default route broke?
Prove the office works as specified
Show me the office network does what the specification says.
Show me the office network does what the specification says.
Review the reasoning
Allowed paths tested from the hosts: staff to the portal by name, staff and guests to the internet, staff to management, the server to the internet.
Denied paths tested from a guest host: the portal server and the management network unreachable.
The router's evidence saved: route table, FORWARD chain, NAT table, a traceroute to the web.
The packet path and its single points of failure written down, and what was not covered.
The specification is a list of allowed and denied paths, so the proof is those tests run from the hosts: pc-1 opens the portal by name and reaches the web and the switch's management address; a guest reaches the web and gets nothing from the portal server or the management network; the server reaches the web. Beside the tests go the router's route table, FORWARD chain, NAT table and a traceroute to the web, saved as files. The handover names the packet path and its single points of failure, the switch, the trunk, the router and the ISP link, and says plainly that wireless, monitoring and redundancy were not covered.
Common mistakes
Testing only from the router.
Proving allowed paths and skipping the denied ones.
Which single point of failure would you remove first, and how?
Design the tables for a booking service
Businesses receive inquiries from users. Design the tables and say where the rules live.
Businesses receive inquiries from users. Design the tables and say where the rules live.
Review the reasoning
Three tables, one per entity, each with a primary key.
The foreign keys on the many side: inquiries carries business_id and user_id.
Constraints on the columns: NOT NULL where a value must exist, UNIQUE on the email, REFERENCES for the pointers, a default for status.
The rules live in the database so every application meets them; NULL means none, not zero.
Three tables: businesses, users and inquiries, each with an integer primary key. An inquiry belongs to one business and, usually, one user, so inquiries carries business_id and user_id as foreign keys; business_id is NOT NULL because an inquiry always has a business, user_id may be NULL for a walk-in. users.email is UNIQUE, event_day and servings are NOT NULL, status has a default of new. Those rules live in CREATE TABLE, so a form, a script and a hand-typed insert all meet the same refusal, and the town lives once, in businesses, reached by the key.
Common mistakes
Putting the town on every inquiry.
Using 0 as no user.
What would you do when a business closes and has inquiries?
The insert is refused
A colleague says the database is broken: their insert is refused with a FOREIGN KEY error. What do you tell them?
A colleague says the database is broken: their insert is refused with a FOREIGN KEY error. What do you tell them?
Review the reasoning
Read the message: it names the column and the value that matched no parent.
The database is doing its job; the row points at a business that does not exist.
The fix is the right id or the parent row first, never dropping the constraint.
Check the order of operations and whether a transaction should bundle the parent and child inserts.
The message says which column and value found no parent, so the row is an orphan: it points at a business that is not there. That is the database working, not breaking. Either the id is wrong and should be corrected, or the business has to be inserted first; inside one transaction if the two belong together. What I would not do is remove the REFERENCES rule to make the insert go through, because then the orphan lands and every report that joins on it silently loses the row.
Common mistakes
Dropping the foreign key.
Inserting a placeholder parent to satisfy the rule.
What if the parent insert succeeded and the child failed, outside a transaction?
Prove the data cannot go wrong
Show me the booking database refuses bad data and keeps changes whole.
Show me the booking database refuses bad data and keeps changes whole.
Review the reasoning
The refusals, with their messages: NOT NULL, UNIQUE, FOREIGN KEY on insert and on a parent delete.
NULL semantics shown with COUNT(*) against COUNT(column) and IS NULL.
A transaction rolled back and one committed, with the counts before and after.
A failure inside a transaction leaving nothing half done.
I show the four refusals with their messages: an insert without an event day, a duplicate email, an inquiry for a business that does not exist, and deleting a business that still has inquiries. Then NULL: COUNT of the column against COUNT of rows, and IS NULL finding the walk-ins where = NULL finds none. Then transactions: a change rolled back with the count returning to what it was, two changes committed together, and a transaction where the second statement is refused and the first is undone with it. Each is one script whose result anyone can rerun.
Common mistakes
Describing constraints without a refusal to show.
Proving COMMIT without proving the failure case.
Which of those would you add to the test suite first?
Validate a servings request
Write, in words, a function that validates a servings request between a minimum and a maximum, and say how you would test it.
Write, in words, a function that validates a servings request between a minimum and a maximum, and say how you would test it.
Review the reasoning
Parameters for the rule's numbers; the boundaries are allowed.
Guards in order: empty text, conversion, NaN, then the rule; early returns with labels.
Return the label rather than print it, so the caller decides.
Test both boundaries, one value outside each, and an invalid input.
It takes the request and the minimum and maximum as parameters so the rule's numbers are not typed into the code. It checks the empty string first, converts with Number, catches NaN, and only then applies the rule: below the minimum is too few, above the maximum too many, otherwise ok, with the minimum and maximum themselves allowed. Each check returns a label at once, and the label is returned rather than printed so a form or a report can use it. I test it at both boundaries, one value outside each, an empty box and a word.
Common mistakes
Rejecting the boundary values with <= instead of <.
Printing the label inside the function.
What changes if the business raises its maximum?
A quote that is sometimes wrong
Customers report a quote that is occasionally off by a penny and a delivery fee that is sometimes missing. Where do you look?
Customers report a quote that is occasionally off by a penny and a delivery fee that is sometimes missing. Where do you look?
Review the reasoning
Predict the quote by hand for the reported cases before reading the code.
The penny: a percentage applied without rounding, so a fraction survives.
The fee: a comparison at the boundary, > against >=, at the distance limit.
Fix each on its line and rerun the same cases, including the boundaries.
I take the reported cases and work them out by hand first, so I know what the right numbers are. A penny out points at the discount: a percentage of a total is not always whole, and the rule needs Math.round at that step. A fee that is sometimes missing points at the distance boundary: more than and at least differ by one unit, and the case that is wrong is probably exactly at the limit. Each is a one-line fix, and I rerun the cases at both boundaries afterwards rather than a random one.
Common mistakes
Rounding at the print instead of at the rule.
Fixing the fee comparison and not retesting at the limit.
How would you stop the penny bug returning after the next change?
Show me you understand the program
Here is a short program with a loop, a function and a variable declared twice. Tell me what it prints before you run it, and why.
Here is a short program with a loop, a function and a variable declared twice. Tell me what it prints before you run it, and why.
Review the reasoning
Trace line by line with a table of variable values.
Explain which label the inner declaration shadows and what the outer one holds afterwards.
Explain how the loop stops at the boundary of its condition.
Run it afterwards and compare, naming any difference and what it taught.
I trace it before running: each pass of the loop with the variables written down, each branch of the if-else chain, and for the function the inner variable that shadows the outer one only while the function runs, so the outer print is unchanged. The while loop stops when its condition is first false, so I check the last pass against the boundary. Then I run it and compare line by line; where my prediction differs, that difference is the thing I did not understand, and I say what it was.
Common mistakes
Running first and explaining the output afterwards.
Assuming the inner variable changed the outer one.
Which line would you rename to make the program easier to trace?
Capacity, throughput and a baseline
A manager says the office link is slow. What numbers do you need before you agree, and where do they come from?
A manager says the office link is slow. What numbers do you need before you agree, and where do they come from?
Review the reasoning
Capacity from the negotiated speed; throughput from the counters or the poller's samples, converted to Mb/s.
Utilisation as the ratio, compared with the baseline for that hour.
Errors, drops and collisions read separately from utilisation.
A conclusion that names which of the four signatures fits, or says the link is fine.
Slow needs two numbers: what the link can carry, from ethtool or the links table, and what it carried in the hour, from ip -s link or the poller's bytes turned into megabits per second. Their ratio is utilisation, and I compare it with the baseline for that hour on ordinary days. Then I look at the counters that mean trouble: collisions say duplex mismatch, receive errors with carrier flaps say cable, drops with no errors at the busy hours say the link is full, and a speed below the recorded one says it negotiated down. If utilisation is low and the counters are clean, the link is not the problem.
Common mistakes
Calling a link slow because throughput is a small number without looking at its capacity.
Forgetting the factor of 8 between bytes and bits.
What would make you raise the alert threshold from 80 to 90 percent?
Slow since this morning
People behind one router port report slow, unreliable transfers since this morning. Walk me through the first ten minutes.
People behind one router port report slow, unreliable transfers since this morning. Walk me through the first ten minutes.
Review the reasoning
Counters and ethtool on the port, saved as evidence, compared with the recorded link settings.
The journal and dmesg for timestamps: flaps, and what the link negotiated at link-up.
The signature named: duplex, speed, cable or congestion, and the timestamps matched against when the complaints started.
A check that nothing changed: the configuration compared with its baseline.
I start on the router with ip -s link show for the port and ethtool for its settings, saved to files rather than described, and I compare the settings with what was recorded when the link was installed. Then journalctl for the network service and dmesg give me timestamps: a link that lost carrier at 12:41 matches a complaint from 12:45. The counters tell me which of four things it is: collisions mean duplex, a lower speed means it negotiated down, receive errors with flaps mean the cable, drops without errors mean the link is full. Since it started this morning, I also diff the configuration against the baseline, because a change nobody recorded is the commonest cause of a fault that begins at a specific time.
Common mistakes
Restarting the interface before saving the counters.
Reading the counters without knowing what the link should negotiate.
The counters are clean and utilisation is 30 percent. Where do you look next?
Show me the rollback
You restored a router's configuration from the baseline last week. Show me how you know it is right and how the next person could undo it.
You restored a router's configuration from the baseline last week. Show me how you know it is right and how the next person could undo it.
Review the reasoning
The diff that showed the drift, and the drifted file kept as evidence.
The checksum check printing OK after the restore, as the proof.
A change record with the exact rollback command and the verification, written at the time.
The inventory and baseline still true afterwards.
The ticket came from the nightly compare job, so the first evidence is the diff between the baseline and the running file: one line, the MTU. I kept the drifted file before touching anything, restored the baseline with sudo cp, and ran sha256sum -c against the baseline's list, which printed OK; that line is the proof, not my memory of copying the file. The change record I wrote has the change, the rollback as the exact command that copies the kept file back, and the verification command, so the next person can undo it without asking me. I also checked the inventory still listed the device with the right address.
Common mistakes
Restoring without keeping the drifted copy, so there is nothing to roll back to.
A rollback line that says rollback is possible instead of giving the command.
Who should have been asked before the restore, and why?
Copy or mutate
A colleague's function sorts the list it is given and the caller's list comes back reordered. Explain what happened and how you would write it.
A colleague's function sorts the list it is given and the caller's list comes back reordered. Explain what happened and how you would write it.
Review the reasoning
Arrays are passed by reference: the function and the caller hold the same array.
sort reorders in place and returns the same array.
Copy first with spread or slice, then sort the copy; return the result.
Mutation is fine on a value the function made itself.
The function received the caller's array, not a copy, and sort reorders the array it is called on, so the caller's list changed as a side effect. I would copy first, [...list].sort(...), and return the sorted copy, so the caller's list is untouched and the result is still available to whoever needs it. Mutating is fine when the function built the array itself; it is a problem when someone else still holds it.
Common mistakes
Believing sort returns a new array.
Copying every record deeply when only the array order needed protecting.
When would a shallow copy not be enough?
The report double-counts
A report of inquiries per town is wrong: some towns show more inquiries than exist. The data has duplicate ids. What do you do?
A report of inquiries per town is wrong: some towns show more inquiries than exist. The data has duplicate ids. What do you do?
Review the reasoning
Reconcile duplicates before counting: one record per id by a stated rule.
Say which record wins: the latest day, ties to the first seen.
Count what was superseded and show it in the report rather than dropping silently.
Group the reconciled records by town and compare the totals with the raw count.
The count is over records, and duplicate ids mean the same inquiry is counted twice. I reconcile first: keep one record per id under a written rule, the latest day wins and a tie keeps the first seen, and I count the records that were superseded so the report shows how many duplicates there were. Then I group the reconciled list by town. The raw count minus the superseded count should equal the reconciled count, which is the check that I lost nothing I did not mean to.
Common mistakes
Deleting duplicates without stating which one was kept.
Fixing the numbers in the report instead of the data behind it.
What if two records with the same id are for different customers?
Show me the rule holds for input you never saw
Your reconciliation passes on the sample. How do you show it is right in general?
Your reconciliation passes on the sample. How do you show it is right in general?
Review the reasoning
Cases built to hit the rule's edges: a duplicate with a later day, a tie, an id seen once.
Hidden input the code was not written against.
The superseded count reconciles with the input size.
The rule is in one module so the tested code is the code the reports use.
I write the cases the rule is about, not the sample: an id whose later record has a greater day, a tie on the day where the first seen must stay, an id that appears once, and an empty list. Then I run the function on records it was not written against and check the superseded count equals the input size minus the kept count. The function lives in one module that the reports import, so what I tested is what runs.
Common mistakes
Testing only the sample the code was written against.
Leaving the tie case out because it seems unlikely.
How would you catch a duplicate id that belongs to two different customers?
Name every control
Explain what makes a form usable by someone who cannot see it or cannot use a mouse, and how you would check.
Explain what makes a form usable by someone who cannot see it or cannot use a mouse, and how you would check.
Review the reasoning
Every control has an accessible name from a label, a wrapping label or aria-label; placeholders do not count.
A real submit button, reachable with Tab and pressed with Enter; visible focus.
Hints and errors tied to their field with aria-describedby.
Checked by unplugging the mouse and reading each control's name, not by looking.
Every control needs a name the screen reader can announce: a label whose for matches the id, a label around it, or aria-label, and never just a placeholder. Submission has to work from the keyboard: a real button, Tab to reach it, Enter to press it, and a visible focus ring so the person knows where they are. Hints and error messages are tied to their field with aria-describedby so they are read with it. I check by unplugging the mouse and tabbing through, and by reading the accessible name of each control in the browser's accessibility panel.
Common mistakes
Trusting the placeholder as the label.
Removing the focus outline for looks.
How would you show an error message so a screen reader user hears it?
The form works for me
A customer says the inquiry form cannot be submitted on their phone and a colleague says a screen reader reads the fields as unlabelled. It works for you. What do you check?
A customer says the inquiry form cannot be submitted on their phone and a colleague says a screen reader reads the fields as unlabelled. It works for you. What do you check?
Review the reasoning
Try it without the mouse: is the submit control a button and can Tab reach it?
Read each field's accessible name; look for placeholders standing in for labels and for/id mismatches.
Look at the phone width: viewport meta present, nothing clipped or off screen, the button reachable.
Fix in the source and retest at both widths and from the keyboard.
Works for me means with a mouse on a wide screen. I first try it from the keyboard: if the submit control is a div with onclick, Tab never reaches it, which would explain the phone report too if their browser treats it as text. Then I read each field's accessible name; unlabelled fields usually mean placeholders instead of labels or a for that does not match the id. Then I open it at a phone width: without the viewport meta the page is zoomed out and the button may be off screen. I fix the source and retest at both widths and without the mouse.
Common mistakes
Testing only with a mouse at a desktop width.
Fixing the look of the button instead of its element.
What would you add so the error for an empty email field is announced?
Show me it works at a phone width
Show me your inquiry page passes the three gate checks: every control named, submission and errors operable by keyboard, nothing lost at the mobile width.
Show me your inquiry page passes the three gate checks: every control named, submission and errors operable by keyboard, nothing lost at the mobile width.
Review the reasoning
Names shown from the accessibility tree or the checks, not from looking.
A keyboard walk-through: Tab order, Enter on the button, the error announced.
A narrow-width view with every label, field and message visible and no sideways scrolling.
The viewport meta, the stacking rules and the media query in the source.
For the names I show each control's accessible name from the accessibility panel, so it is what the screen reader gets and not what I see. For the keyboard I tab through the form in order, press Enter on the submit button and show the error message tied with aria-describedby being announced. For the phone width I show the page at 375 pixels with every label, field, hint and button visible and no sideways scrolling, and the source that does it: the viewport meta, the grid that stacks each field, full-width inputs and the media query that widens the button.
Common mistakes
Screenshots of the desktop width only.
Saying the form is accessible because it has labels somewhere on the page.
What would you check next if the page also had a data table?
RPO, RTO and how you would know
Explain the difference between a recovery point objective and a recovery time objective, and how you would find out whether a system meets each.
Explain the difference between a recovery point objective and a recovery time objective, and how you would find out whether a system meets each.
Review the reasoning
RPO is data lost, back to the last good backup; RTO is time down.
RPO achieved comes from the backup log: the last successful backup before the failure.
RTO achieved comes from a timed, verified restore, not from the schedule or the vendor.
A target tighter than the backup interval cannot be met; the strategy follows the targets.
The recovery point objective is how much work you accept losing: the gap between the last good backup and the failure. The recovery time objective is how long you accept being down. They are met by different things: the RPO by backing up often enough and the backups succeeding, which I check in the backup log by finding the last ok backup before the incident; the RTO by a restore that is fast enough, which I check by restoring with a clock running and verifying the result. If backups run every four hours, an RPO target of one hour is impossible whatever the document says, and the strategy, backup, replication or live copies, follows from the two targets.
Common mistakes
Treating the backup schedule as proof of the RTO.
Counting a failed backup as a recovery point because it was the most recent.
What would you change first if the restore test took twice the RTO?
The outage cost more than it should
An outage lost a day of orders although the backups run every fifteen minutes, and it took five hours to restore against a one-hour target. Where do you look?
An outage lost a day of orders although the backups run every fifteen minutes, and it took five hours to restore against a one-hour target. Where do you look?
Review the reasoning
The backup log around the failure: were the recent backups ok, or failing silently?
The restore tests: had a restore ever been timed and verified for this system?
The recovery strategy against the targets: a restore from backup cannot meet an hour if it takes five.
The supplier: was the outage shared with other systems on the same vendor?
A day of lost orders with fifteen-minute backups means the recent backups were not good: I look at the backup log around the failure for failed status, because the recovery point is the last one that succeeded, not the last one attempted. Five hours against a one-hour target means the restore had never been timed, or the strategy was wrong for the target; the restores table shows whether a verified test existed and how long it took. Then I check whether other systems failed at the same time with the same cause, because a shared supplier turns one outage into several. The fixes are a backup alert on failed status, a timed restore test, and a strategy that matches the targets.
Common mistakes
Buying a faster restore before finding out why the backups had been failing.
Blaming the vendor for the data loss that the failed backups caused.
How would you set the RPO target if the business cannot say what an hour costs?
Show me the plan works
Show me your resilience review proves each system can be recovered, and say what you assumed.
Show me your resilience review proves each system can be recovered, and say what you assumed.
Review the reasoning
Per system: the RPO achieved from the backup log and the RTO from a verified restore test, against the targets.
Untested systems named as the first gap, not hidden by an inner join.
Every estimate with its assumptions beside it: per_year, hours, hourly loss.
The shared supplier and what stays your responsibility under the hosted service.
For each system I show two numbers against two targets: the recovery point achieved, from the last good backup before the last incident, and the recovery time, from a restore that was timed and verified. Systems with no verified restore are listed first as untested, because that is the biggest gap and an inner join would have hidden them. Every cost figure carries its assumptions in the same table, how often, how long and what an hour costs, so anyone can change one and see the ranking move. I show which systems share a supplier, and for the hosted mail I state that uptime is the supplier's promise while the mailboxes, their backups and the restore test are ours.
Common mistakes
A risk register with totals and no assumptions.
Calling a system recoverable because it has a backup schedule.
Which single test would most change your confidence, and why?
Three tickets before an audit
You get three tickets about one server the day before an audit. Walk me through how you decide what to change.
You get three tickets about one server the day before an audit. Walk me through how you decide what to change.
Review the reasoning
A read for each ticket first, saved as evidence, before any change.
Faults fixed the way the baseline says: config, restart, lock, revoke, fence, chmod.
A claim that the evidence contradicts is recorded as false and left alone.
Everything not named by a fault stays as it was, and the handover lists the fault words, sorted.
I read each ticket and answer it with a command that changes nothing: the PermitRootLogin line, passwd -S for the account, systemctl and ss for the service, openssl for the certificate, saved into an evidence folder. That tells me which tickets are faults. Those I fix the way the baseline says, and read back as proof. A ticket the evidence contradicts, a scanner claim about a service that is not running, is recorded as a false positive and left. Nothing else on the server changes, because the audit reads what changed as much as what was fixed, and the handover is the fault words, sorted.
Common mistakes
Restarting services named in tickets before reading anything.
Fixing a scanner claim that was false.
Which of the three would you fix first, and why?
It says the certificate expired
A user says the portal certificate has expired, the scanner says telnet is listening, and the audit is tomorrow. What do you do, in order?
A user says the portal certificate has expired, the scanner says telnet is listening, and the audit is tomorrow. What do you do, in order?
Review the reasoning
Read the certificate dates with openssl before believing either the user or the scanner.
If the dates are valid, the ticket is left with the evidence; if expired, escalate to the CA with the dates saved.
Confirm telnet with systemctl and ss; if it is running, stop and disable it and read it back.
Hand over: fixed, left, escalated, each with its evidence.
First the certificate, because it is the one I might not be able to fix: openssl x509 -dates on the server certificate. If notAfter is still ahead, the user was wrong and I record the dates and leave it. If it has passed, only the CA can issue a new one, so I save the dates and write escalate cert-expired into the handover. Then telnet: systemctl is-active and ss confirm it, I stop and disable it and read the state back. The handover says what was fixed, what was checked and left, and what was escalated, each with the file that proves it.
Common mistakes
Restarting nginx to renew a certificate.
Escalating the telnet fault that was mine to fix.
What would you do differently if the audit were in an hour?
Show me the server is ready
Show me srv-1 is ready for the audit and that you changed nothing you should not have.
Show me srv-1 is ready for the audit and that you changed nothing you should not have.
Review the reasoning
Each fault with its read before and after: the config line, the account state, the service state, the key mode.
Preservation shown: services still running, the backup account still locked, the certificate untouched.
Escalations with their evidence files and the exact escalate lines.
The sorted handover, and the transcript for the commands.
For each fault I show the read before and the read after: PermitRootLogin yes then no with the restart, alex P then L with the sudoers line gone, telnet active then inactive and disabled, the key at 0644 then 0600. For what I did not change I show the reads too: nginx and mysql still active, the backup account still locked, the certificate dates unchanged. The release that failed its signature is not in /opt/app, and evidence/signature.txt holds the Verification failure line next to escalate vendor-signature in the handover. The handover is the sorted fault words; the transcript has every command.
Common mistakes
Showing only the fixes and not the reads that prove nothing else changed.
Installing a release whose signature failed because the checksums matched.
Which single piece of evidence would the auditor ask for first?
Threat-model a small office
Walk me through threat-modelling a small office with a web portal, a database and a file share.
Walk me through threat-modelling a small office with a web portal, a database and a file share.
Review the reasoning
Assets with a zone and a value; each case tied to an asset, a path and an actor, scored for likelihood and impact.
Trust boundaries named where zones change, with a control at each crossing.
Controls typed as preventive, detective or corrective and by function, authentication kept apart from authorization.
Residual after the controls, an owner per case, and accepted cases recorded rather than dropped.
I list the assets with the zone each sits in and what it is worth, then the failure and abuse cases, each tied to one asset and the path it arrives by, with an actor and a likelihood and impact from one to five. Where a case crosses a zone boundary I put the control at the crossing. For each case I record the controls by type, preventive, detective and corrective, and by function, keeping authentication, who you are, apart from authorization, what you may do. Then I compute what is left after the controls' cuts and rank the open cases by that residual; the top one is where the next control goes, and cases an owner accepts are recorded with the number and a review date.
Common mistakes
Listing threats without an asset or path to control.
Treating MFA as if it limited what a logged-in person may do.
Which case on your list has no detective control, and does that worry you?
MFA is on, so we are fine
A manager says the portal is safe because MFA is on. What do you check before agreeing?
A manager says the portal is safe because MFA is on. What do you check before agreeing?
Review the reasoning
MFA is authentication; ask what authorization limits a proven user.
Ask what detects a bad login pattern and what recovers a changed order.
Compute the residual for the portal's cases rather than calling them handled.
Show the remaining risk and the control type that is missing.
MFA answers who is logging in; it says nothing about what they can do once in, so I check the authorization on the portal: can a proven user read every order, delete any of them? Then the other layers: is there alerting on failed logins and unusual activity, and a backup that restores a changed order? In the model the scanner case goes from sixteen to six after MFA and alerting, which is safer, not safe. I show the manager the residual and the missing type, a role check, so the conversation is about the number that is left rather than a feeling of being fine.
Common mistakes
Accepting authentication as the whole answer.
Saying a case is handled without a residual number.
What would you add first, and what residual would it leave?
Show me the residual
Show me the risk register for the office and defend the top three priorities.
Show me the risk register for the office and defend the top three priorities.
Review the reasoning
Each case with asset, path, actor, likelihood and impact, and its controls with their cuts.
Residual computed from the cuts with COALESCE for uncontrolled cases, ranked.
The top three explained by what is missing: a type or a boundary control.
Accepted cases shown with owner and review date, not hidden.
The register is the threats table joined to its controls: every case has an asset, a path, an actor and two scores, and every control has a type and what it cuts. The ranking is by residual, likelihood minus the summed likelihood cuts times impact minus the summed impact cuts, with cases that have no control counted at full inherent risk through COALESCE. The top three are the phishing case, where awareness and filtering leave likelihood two at impact three; the scanner on the portal, where MFA and alerting leave six; and the ransomware case on the share, which has no detective control at all. The wiki case is accepted, by its owner with a review date, and shown as such.
Common mistakes
A register of totals with no cuts to argue with.
Hiding accepted cases instead of showing the decision.
If you could add one control, which residual would drop the most?
Claims and evidence
An auditor is coming next month. How do you prepare, and what can you say about compliance?
An auditor is coming next month. How do you prepare, and what can you say about compliance?
Review the reasoning
A register of claims, each tied to dated evidence with a window; the gaps found by the query, not by memory.
Policies checked against their review periods; obligations traced to the policy they rest on.
Evidence is the engineer's job; the compliance or certification verdict is the assessor's.
Legal and privacy questions brought to the specialist with the facts.
I start from the register: every control we claim, and for each the evidence we hold with the date it was collected and how long it stays current. A LEFT JOIN from claims to evidence gives the gaps, and a CASE on the latest date gives current, stale or missing. Then the policies themselves: which are past their review period, and which obligations rest on those. What I can say to the auditor is what the evidence shows on which date; whether that makes us compliant with the contract or the regulation is their verdict, and anything touching personal data or a contract clause goes to the privacy or legal specialist with the facts.
Common mistakes
Telling the auditor the organisation is compliant because the exports exist.
Counting old evidence as current because it exists.
Which gap would you close first, and with what evidence?
Three people reported the same email
Three people reported the same invoice email this morning and one of them entered their password. Walk me through the next hour.
Three people reported the same invoice email this morning and one of them entered their password. Walk me through the next hour.
Review the reasoning
Thank each reporter; ask each whether they clicked and what they entered.
Reset the entered password now; check the device that clicked.
Treat the three as one campaign: block the sender, warn everyone once.
Record the reports with time to report; involve the specialist if customer data could be affected.
First the replies: thanks to all three, and the two questions, because the answers order the work. The person who entered a password gets a reset now, before anything else, and their device a look; the one who clicked without entering gets the device checked. Three reports of one sender is a campaign, so it is blocked once and a single warning goes to everyone. I record each report with the minutes it took to report, which is this month's number, and if the credentials could reach customer data I bring the facts to the privacy specialist rather than deciding alone whether anyone must be told.
Common mistakes
Asking the reporter why they clicked.
Handling three reports as three tickets and blocking the sender three times.
What would you change in the process if the report came four hours after the click?
Show me the awareness numbers
Show me your phishing reporting works, with numbers.
Show me your phishing reporting works, with numbers.
Review the reasoning
Reports per hundred staff and minutes to report, by department, from the reports table.
Campaigns identified and the one-block-one-warning response for each.
Triage order shown: credentials, clicks, the rest.
The click rate kept for the plan, not published with names.
The reports table gives the numbers: per department, how many reports per hundred staff and the average minutes from receipt to report, with a LEFT JOIN so a silent department shows as zero rather than vanishing. I show the campaigns, sender domains reported more than once, and that each was blocked once and warned once. I show the queue order that was used, credentials first, then clicks, and the reset times. The click rate I keep for the awareness plan; what goes on the wall is the report rate and the speed, because that is the behaviour we want more of, and no names are on it.
Common mistakes
Publishing click rates with names.
Treating a department with no reports as the safest.
Which department would you visit first, and why?
Who, what, where, and what it costs
You are given access to a cloud account for a data project. What do you establish before creating anything?
You are given access to a cloud account for a data project. What do you establish before creating anything?
Review the reasoning
Which identity the CLI acts as, in which account, in which region, saved as evidence.
What that identity may do, from its policies, and where a Deny ends it; proved by trying the forbidden thing.
What will cost money: storage per GB-month, requests, transfer, compute by the minute, queries by data scanned; the budget and its forecast.
A sandbox with temporary credentials, a resource list and a cleanup that is verified.
First who I am: get-caller-identity tells me the user and the account, and the config says the region, and I save that. Then what I may do, from the identity's policies, and I check the boundary by trying something a Deny should refuse. Then what costs money: for object storage it is gigabytes per month, requests and data out, and for the compute and query services it is minutes and data scanned; the budget shows the limit, the actual and the forecast, and an alert on it notifies without stopping anything. And I agree the sandbox rules: temporary credentials, a list of everything I create, and a cleanup that is proved by a listing afterwards.
Common mistakes
Believing a budget alert caps spending.
Treating a simulated AccessDenied as proof of what the real account would do.
Which of those would you check again after a colleague changes the policy?
The bill went up
The monthly bill doubled and nobody knows why. Where do you look?
The monthly bill doubled and nobody knows why. Where do you look?
Review the reasoning
Cost by service first: the biggest line and its cause.
For storage, the recursive listings with totals: which bucket grew, and leftovers nobody owns.
The budget's forecast against its limit, and whether the alert fired and was read.
Inventory, archive, delete, verify, record for anything that should go.
I start with cost grouped by service, because the dollars are the same but the causes differ: a bigger storage line means data grew or a leftover appeared, a bigger compute line means a job ran more often. For storage I list the buckets recursively with totals and look for the one that grew and for buckets nobody owns, like last year's scratch bucket. I check the budget: was the forecast already over the limit, did the alert fire, did anyone read it. Then for anything that should go, I inventory it, archive what must be kept, delete it, list to prove it, and record where its contents went.
Common mistakes
Deleting the biggest bucket before inventorying it.
Reading the total instead of the per-service breakdown.
What would you set up so this is noticed before the bill arrives?
Show me the cleanup
Show me the leftover bucket is gone and nothing was lost.
Show me the leftover bucket is gone and nothing was lost.
Review the reasoning
The inventory taken before, saved as a file.
The archived objects listed in the archive bucket, with content matching.
The bucket list after the delete without the leftover.
The record line saying what was removed and where its objects are.
Four things, in the order they happened. The inventory file lists every object the bucket held with its size and date. The archive bucket, listed recursively, shows the same objects under the old bucket's name, and the archive blocks public access and encrypts by default, which the leftover did not. The bucket listing after the delete has the raw and curated buckets and no leftover. And evidence/cleanup.txt has one line: what was removed and where its objects are, so next year's question has an answer.
Common mistakes
Showing only the delete command.
Archiving into the raw data bucket because it was there.
What would you do differently if the leftover held ten thousand objects?