Glossary
149 terms from Coding Interviews in Go, in plain words, each with the chapter that teaches it.
#
- 401(k)
- A US retirement savings account, and an employer 'match' adds money to it when you contribute. It is one of the benefits listed in an offer.
- `check` helper
- A small function you write because Go has no `assert` statement. It does nothing if a condition is true and calls `panic`, which stops the program with your message, if it is false.
A
- AI-assisted round
- A coding round where an AI chat assistant is part of the setup, as in Dana's Mock 2. You are scored on solving the problem, understanding the code the AI wrote, and testing and fixing it.
- any
- Go's type that can hold a value of any type. The heap's `Push` and `Pop` use `any`, so `x.(int)` converts the value back to an `int`.
- API endpoint
- A named address that other programs call, written as a method and a path, such as `GET /orders/{id}/status` for an order's status. It is one of the things you list in a system design round.
B
- Back-of-the-envelope estimate
- A quick, rounded calculation of scale, such as requests per second or storage per year. Only the order of magnitude matters.
- Backtracking
- Building every possible answer one choice at a time: choose an item, explore the rest by recursion, then un-choose it so the next branch starts clean. It costs O(2ⁿ), so it suits inputs of about 20 items or fewer.
- Base case
- The simplest input a recursive function answers directly without calling itself, such as an empty tree (`nil`) returning 0. Without it the recursion never stops.
- Base salary
- Your fixed yearly pay, before any bonus or equity.
- Behavioral interview
- A round, run by Sam at Kettle & Crane, that asks about your past work to predict how you'll work. It checks signals such as ownership, teamwork and learning.
- BFS on a grid
- A search that uses a queue to visit cells in order of distance from the start. It finds the fewest steps across a grid, such as a route across the warehouse floor.
- Big-O
- A way of describing how a solution's running time or memory grows as the input gets bigger, such as O(n) or O(n²). It lets you compare approaches without timing them.
- Binary search
- Finding a position in sorted data by repeatedly checking the middle and discarding half. It costs O(log n), and can also find the 'first day that…' something is true.
- Bonus
- Extra cash, often a target percentage of base salary, paid if you and the company do well. It is not guaranteed.
- Bottleneck
- The part of a brute-force solution that costs the most time. In the Better step you attack it first, as with the slow slice scan in the missing-ticket problem.
- Bottom-up
- Dynamic programming with no recursion: you fill a table starting from the smallest subproblem and work upward. `fewestTable` does this for bag counts.
- Brute force
- The simplest correct solution, which tries every possibility. It is often slow, but you state it first, with its Big-O, so the interviewer knows you have a working approach.
- Brute-force checker
- A slow but obviously correct function that you compare against your fast one on many random inputs. It finds bugs in cases you didn't think to try.
- byte
- Go's type for one raw 8-bit value. Indexing a string or a grid row gives a `byte`, so you compare it with a character literal such as `'.'`. It works for plain ASCII text.
C
- Cache
- Fast memory that keeps recent answers so repeated reads skip the database. Order-status pages use a 60-second cache, at the cost of data that can be stale.
- CDN (content delivery network)
- Servers around the world that keep copies of images and scripts close to users, so pages load faster.
- Checking in
- Pausing at the end of a step to ask the interviewer a short question, such as 'Does that approach sound reasonable?'. It is not meant after every line.
- Clarifying question
- A question you ask to pin down what a problem means, such as input size, empties, duplicates or what to return when there is no answer. You ask these before solving.
- Client
- The customer's browser or app, which sends requests to a system.
- Cliff
- A waiting period, often one year, during which no equity vests. At the first anniversary a quarter vests at once.
- cmp.Compare
- A function from Go's `cmp` package that returns a negative number, zero or a positive number. That is the kind of result `slices.SortFunc` needs from its comparison function.
- CoderPad
- A common online shared editor where you and the interviewer see the code as it is typed. Some versions can run code and some can't.
- Competing offer
- An offer from another company. Mention a real one honestly if asked, and never invent one.
- Constraints
- The limits stated in a problem, such as 'up to 100,000 items'. They tell you how fast your solution must be.
- container/heap
- Go's standard heap package. It does the sifting, but you supply a type with the five methods `Len`, `Less`, `Swap`, `Push` and `Pop`.
- Counteroffer
- Your request for different offer terms. Ask for a specific number and give a reason, such as market data or another offer.
- Cycle
- A linked list whose last node links back to an earlier one, so a plain walk never ends. Fast and slow pointers detect it when they meet on the same node.
D
- Data model
- The tables a system stores and their main columns, such as the `orders` and `order_events` tables.
- Debrief
- The meeting after the loop where interviewers share their notes and scores and decide.
- Deep dive
- The part of a design round where you pick the hardest piece, or the one the interviewer asks about, and examine it in detail.
- defer
- A Go keyword that schedules a call to run when the surrounding function returns. `defer file.Close()` makes sure the file is closed.
- DFS flood fill
- A recursive search that starts at one cell and spreads to every connected cell of the same kind. Counting islands, such as shelf blocks on the warehouse floor, is the typical use.
- DP table
- The slice a bottom-up DP solution fills in, where `table[amount]` holds the best answer for that amount. It is built from the smallest case upward.
- Dry run
- Running your code by hand on a small example and tracking every variable. A trace table keeps the record tidy.
- Dynamic programming (DP)
- Solving each overlapping subproblem once and saving the answer, with a memo (top-down) or a table (bottom-up). It makes slow recursion, such as the fewest-bags problem, fast.
E
- Edge case
- An unusual input at the limits, such as an empty slice or a single item, where code most often breaks.
- Edge-case checklist
- A list to run through after your main example: empty, one item, two items, all the same, duplicates, zero or negative, sorted or reversed, and very large.
- encoding/csv
- Go's standard package for reading comma-separated files like `orders.csv`. It splits each line correctly, even when a name contains a quoted comma, and `ReadAll` returns every row.
- Equity
- Part ownership of a company, given as RSUs or stock options. It becomes yours gradually through vesting.
- Exploding offer
- An offer that expires very soon, such as 'decide by tomorrow'. Politely ask for a few more days; most companies agree.
- Exponential time
- Running time of O(2ⁿ), where the work doubles with every extra item. It is fine for about 20 items and far too slow for 50.
F
- Fast and slow pointers
- Walking a linked list with two references, where `slow` moves one node per step and `fast` moves two. When `fast` reaches the end, `slow` is at the middle, and if there is a cycle they meet.
- Flood fill
- Starting at one grid cell and spreading, like paint, to every connected cell of the same kind. It marks a whole island as visited.
- Functional / non-functional requirements
- Functional requirements say what a system does, such as customers seeing an order's status. Non-functional ones say how well, such as speed, uptime, scale and cost.
G
- GET and POST
- HTTP methods used in API endpoints. `GET` reads data, such as an order's status, and `POST` sends new data, such as a new status event.
- go mod init
- The command that creates a `go.mod` file and turns a folder into a Go module (a project). In the take-home it is run as `go mod init points`.
- go run
- The Go command that compiles and runs a program in one step. `go run file.go` runs a single file, and `go run .` runs the package in the current folder.
- go test
- Go's built-in testing tool. It finds files named `*_test.go` and runs each function named `Test…`, which checks with `if` and reports failures with `t.Errorf`.
- goroutine
- A lightweight unit of concurrently running Go code. Its stack grows as needed, so deep recursion works until the stack reaches about 1 GB, when the program dies with an uncatchable stack overflow.
- Greedy
- Taking the best-looking choice at each step. It only works for some problems: for 13 lb with bags of 2, 5 and 6, greedy fails but dynamic programming succeeds.
- Grid
- Rows of cells, read as `grid[row][col]`. Many problems hide a graph in a grid, like the warehouse floor made of `.` and `#` characters.
H
- Hash map lookup and counting
- Using a map to remember what you've seen or to count items, in O(1) per lookup on average. Go has no set type, so a set is a `map[T]struct{}`.
- Heap for top k
- Keeping a min-heap of at most k items and dropping the smallest whenever it grows past k. It costs O(n log k), which beats sorting when k is small.
- Helper function
- A small function that does one messy job for the main function and can be tested alone, like `orderValue` hiding the wholesale discount.
- High-level design
- The main boxes of a system and arrows showing how requests flow between them.
- Hint
- A nudge from the interviewer. Taking one well counts as communication: say how it changes your plan, then use it.
- Hiring committee
- A group at some large companies that didn't meet you and decides from the written interview feedback.
I
- Idempotency key
- A unique id, such as a reminder's id, passed along with a request so that repeating it doesn't cause the action twice. In Mock 3 it stops a retried email from being sent again.
- In-bounds check
- Making sure a neighbor cell is on the grid before reading it, so you never index outside the slice.
- Integer division
- Dividing two `int`s in Go gives a whole number with the decimals dropped, so `n * (n + 1) / 2` stays an integer. Convert with `float64(...)` first when you need decimals.
- Interval
- A range with a start and an end, such as Alex's delivery slot `{540, 570}` for 9:00 to 9:30. Two intervals overlap when the second starts before the first ends.
- Island
- A group of connected cells of one kind in a grid, such as a block of shelves on the warehouse floor.
L
- Latency
- How long one request takes, measured in milliseconds.
- Leveling
- Deciding which level, such as junior, mid-level or senior, your interviews show. The same problem is scored with different expectations at each level.
- Linked list
- A chain of nodes, each a struct with a `value` and a `next` pointer, like Alex's delivery route. The last node's `next` is `nil` unless the list has a cycle.
- Load balancer
- A building block that spreads requests across several web servers.
- Loop (onsite)
- The set of 2 to 5 final rounds, in person or on video, that usually mixes coding, system design and behavioral rounds.
M
- maps.Equal
- A function that compares two maps (or, for `slices.Equal`, two slices) for equal contents. It is needed because `==` doesn't work on maps or slices.
- math/rand
- Go's standard package for random numbers. `rng.Intn(9)` gives a whole number from 0 up to but not including 9.
- max and min
- Built-in Go functions (Go 1.21 and newer) that return the larger or smaller of their arguments, with no import needed. They are used to keep the best so far.
- Memo
- A map that saves each subproblem's answer, so the recursive function checks it first and solves each subproblem only once.
- Merge intervals
- Combining overlapping time slots by sorting them by start and joining each slot to the last one when `start <= last.end`. It costs O(n log n).
- Message queue
- A waiting list of jobs, such as 'send this email', that a worker does later. If the email service is down, messages wait and the worker retries.
- Mock interview
- A full practice interview under real conditions, with a timer and ideally a friend playing the interviewer.
- Monotonic stack
- A stack kept in strictly increasing or decreasing order by removing items that break the order as new ones arrive. It is used to answer 'next bigger value' questions in O(n) time.
N
- nil
- Go's value for 'points to nothing', such as a missing tree child or the end of a linked list. Reading through a `nil` pointer crashes the program, so check first.
O
- Off-by-one error
- A bug where a count or index is one too big or too small, such as using `right - left` instead of `right - left + 1` for a window's length. A trace table finds it.
- Offer
- A company's proposal for your pay and terms, usually given by phone and then in writing.
- Online assessment
- A timed set of coding problems on a website that runs your code against hidden tests and grades it automatically.
- Online judge
- A practice website that checks your code against hidden tests. It helps with the Code and Test steps, but say your approach aloud first.
- Overlapping subproblems
- The same smaller question coming up many times, like the fewest bags for 28 lb, reached as 30−2 and as 30−1−1. It is the signal that DP will help.
P
- Package
- A folder of Go files that share a name. `go test` runs the tests in one package, and files in the same package need no import for each other.
- Palindrome
- A word or code that reads the same backward, such as the coupon code `KC5225CK`. Two pointers can check it without building a reversed copy.
- Path
- The partial answer a backtracking function is building. You add to it when you choose and shorten it when you un-choose.
- Pattern
- A shape of solution that fits many problems, such as 'remember what you've seen in a set'. Signal words in a problem point to it.
- Pay range
- The lowest and highest pay a company plans for a role. Some laws require it in job postings.
- Pay-transparency law
- A law that requires a pay range in job postings. Several US states have one.
- Practice log
- A simple table with one row per problem or mock: date, problem, pattern, time, whether you needed a hint, and one thing to remember.
- Prefix sum
- A running-total slice where `prefix[i]` is the total of the first `i` items, so any range total is `prefix[end] - prefix[start]` in O(1). Setup costs O(n).
- Pruning
- Abandoning a backtracking branch as soon as it can't lead to a valid answer, such as skipping an item that pushes a gift box over the $40 budget.
- Pseudocode
- Plain-language steps written as comments before the real code. It shows the interviewer your plan and becomes your checklist.
Q
- Queue
- A first-in, first-out line: you take items from the front and add them at the back. In Go BFS it is a slice where `queue[0]` is taken and `queue = queue[1:]` removes it.
R
- Read replica
- A copy of the database that serves reads, taking load off the main database.
- README
- The file a reviewer reads first. It says what a project does, how to run and test it, your decisions, and what you'd do with more time.
- Recruiter
- The person who manages hiring for the company: they schedule your rounds, answer process questions and later discuss the offer. The recruiter screen is a short first call with no code.
- Referral
- An employee recommending you, which often gets your application read sooner.
- Refresher
- A new equity grant given in a later year at some companies.
- Requests per second
- How many requests a system receives each second. It is one of the numbers you estimate in a design round.
- RSU (restricted stock unit)
- Shares a company gives you over time as they vest. Large companies often use them as equity.
- Rubric
- The form each interviewer fills in, listing the qualities the company looks for with a score and notes for each. Those qualities are the signals.
S
- Scaling up / out
- Scaling up means a bigger machine, and scaling out means more machines behind a load balancer. Scaling out also removes single points of failure.
- Scorecard
- Your own 1-to-4 scores for each of the four signals after a mock, used to pick what to practice next.
- Seeded random source
- A random generator started from a fixed number, such as `rand.NewSource(1)`, so every run produces the same inputs and a failure can be repeated.
- Shared editor
- An online editor, such as CoderPad, where the interviewer sees your code as you type. Some can run code and some can't.
- Sign-on bonus
- A one-time payment for joining. Some companies ask for it back if you leave within a year, and it is often the easiest part to negotiate.
- Signal
- One thing a rubric scores. The four for coding rounds are problem solving, coding, communication and testing.
- Signal words
- Words in a problem, such as 'top k' or 'first repeated', that point to a pattern.
- Signposting
- Announcing your next step before you do it, such as 'First I'll write a couple of examples'.
- Single point of failure
- One part whose failure stops the whole system, such as a lone database. Adding a second web server behind a load balancer removes one.
- Slice copy
- `slices.Clone(x)` makes a new slice with the same items, so changing or sorting the copy leaves the original alone. Backtracking saves a clone of `path`, because `path` itself is a view onto memory that later choices overwrite.
- slices.SortFunc
- A Go function that sorts a slice using a comparison function you write, which returns a negative number, zero or a positive number. It lets you sort structs by a field.
- Sliding window
- A run of neighboring items from `left` to `right` that moves along a slice while you keep a running total. A variable-size window grows with `right` and shrinks from `left` while over a limit, and needs non-negative numbers.
- Sort first
- Sorting the input so items that belong together become neighbors. It costs O(n log n) and helps with 'closest' and 'group together' problems.
- sort.SearchInts
- Library functions that find the position in a sorted slice where a value is, or would be inserted. `slices.BinarySearch` also reports whether it was found.
- Stack
- A last-in, first-out collection used for 'most recent', 'undo' and 'cancel out' problems. In Go it is a slice where `append` pushes and `stack[:len(stack)-1]` pops.
- Stack overflow
- A crash when recursion goes so deep that it uses up the stack's memory. In Go this happens past about 1 GB and cannot be caught; on a huge grid use a stack-based DFS or a bottom-up table.
- Stale data
- A cached answer that is a little out of date, such as an order status that still reads 'packed' for up to a minute after it shipped.
- STAR
- Situation, Task, Action, Result: the shape of a behavioral answer. Spend about 60% of it on Action, say 'I' rather than 'we', and put a number in the Result.
- Stock option
- The right to buy shares later at a fixed price. Startups often give these instead of RSUs.
- Story bank
- About six STAR stories that you've written out and practiced aloud, chosen to cover different signals so most questions map onto one of them.
- strconv.ParseFloat
- A Go function that turns text such as `"55.00"` into a `float64`. A bad number returns an error instead of crashing.
- struct
- A Go type that groups named fields, such as an `order` with `product`, `channel` and `price`. Structs also make tree nodes, list nodes and heap items.
- struct{}
- Go's empty struct, which takes no space. As a map's value type it makes a set, where the keys are what matter.
- Subproblem
- A smaller version of the same question, such as the fewest bags for 28 lb when the question is about 30 lb.
- Subset
- A selection of items from a list, possibly none. Three items give 2 × 2 × 2 = 8 subsets.
- System design interview
- An open, usually no-code round of about 45 minutes where you plan a whole system out loud. You are scored on structure, scale reasoning and trade-offs.
T
- Table test
- A Go test that loops over a slice of cases, each with its inputs and expected answer. `TestEdgeCases` in Mock 2 is one.
- Take-home
- A small project you build on your own time, usually in 2 to 4 hours, then discuss in a follow-up review. It is scored on running, correctness, clarity, tests and the README.
- Technical phone screen
- An early coding round of about 45 minutes with one engineer, in a shared editor, usually one or two problems.
- Test function
- A function named `test` or `Test` plus what it tests, whose checks cover one thing. Called from `main` in the quick style, or run by `go test` when named `TestXxx`.
- Thinking aloud
- Saying what you're doing and why as you do it, so the interviewer can follow and score your reasoning and steer you early.
- Throughput
- How many requests a system handles per second.
- Timeboxing
- Sticking to the stated time for a task, such as 2 hours for a take-home. Going far over doesn't impress.
- Top-down
- Dynamic programming written as the recursive solution plus a memo map that is checked first and filled before every return.
- Total compensation (TC)
- All yearly pay added up: base, bonus, the year's share of equity and any sign-on bonus. Kettle & Crane's offer is $152,000 in year 1 and $142,000 from year 2.
- Trace table
- A table with one row per loop pass and one column per variable, used in a dry run to find bugs such as an off-by-one error.
- Trade-off
- What you give up for what you gain with a design choice, such as a cache making reads fast but the data possibly a minute old.
- Trading space for time
- Using extra memory, such as a set or map, to make a solution faster, as the `seen` set does in the missing-ticket problem.
- Tree recursion
- Solving a tree question by returning a base answer for `nil`, asking each child for its answer, and combining them with the node's value, as `total` does for wholesale orders.
- Two pointers
- Two indexes, `left` at the front and `right` at the back, that move inward through a sorted slice in one O(n) pass using O(1) extra space.
V
- Vesting
- Equity becoming yours gradually over time, commonly over four years.
- Virtual onsite
- A loop of final rounds held on video instead of in person.
W
- Walk-away number
- The lowest total compensation you'd accept, decided before any call. It keeps you calm because you know when to say no.
- Web server
- A program that runs your code: it takes a request from a client and returns a response.