Teradata interview questions and answers for warehouse developers
Teradata interview questions test whether you understand a massively parallel, shared-nothing database: how the primary index hashes rows to AMPs, why skew slows everything down, how statistics and EXPLAIN guide the optimizer, and how big tables are joined and loaded. Expect architecture and indexing questions first, then SQL with QUALIFY and window functions, then scenarios such as a query that runs out of spool or a load that crawls.
By Evin JohnPublished 7 min read
Who gets Teradata questions
Teradata has long been the warehouse behind banks, telecoms, retailers and airlines, so it comes up for data warehouse developers, ETL developers, BI engineers and DBAs at large enterprises. Many of those teams are also migrating to cloud warehouses, and interviewers may ask you to compare the two. The questions reward engine knowledge more than syntax: anyone can write a join, but a Teradata developer is expected to say which AMPs will do the work. General modeling topics such as star schemas and slowly changing dimensions are covered in data warehouse interview questions.
- Client
- BTEQ, SQL tool or ETL job
- Parsing engine
- Parser
- Optimizer
- Dispatcher
- Interconnect
- BYNET
- AMPs
- AMP 1 + its disk
- AMP 2 + its disk
- AMP n + its disk
Fundamentals: architecture and indexes
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What does shared-nothing mean here? | Architecture | Each AMP owns its own rows and storage and works in parallel with the others; nothing is shared, so the system scales by adding units of work. |
| What is an AMP? | Core unit | An Access Module Processor, a virtual processor that stores, reads, sorts and aggregates the rows assigned to it. |
| What does the parsing engine do? | Query planning | Checks syntax and rights, resolves objects, runs the optimizer and dispatches steps to the AMPs. |
| Primary key versus primary index? | Classic question | The primary key is a logical uniqueness rule. The primary index is physical: its value is hashed to choose the AMP that stores the row. They can differ, and only the primary index decides distribution. |
| UPI versus NUPI? | Index types | A unique primary index spreads rows evenly and gives one-AMP, one-row access. A non-unique one groups equal values on one AMP, which is fine for joins but can cause skew if a few values are very common. |
| How is a row placed on an AMP? | Hashing | The primary index value goes through a hashing algorithm to a row hash, part of which maps to a hash bucket, and the hash map assigns that bucket to an AMP. |
| What is a NoPI table? | Staging | A table with no primary index, where rows are spread without hashing. Loads land quickly, which suits staging, but access by value means scanning all AMPs. |
| USI versus NUSI? | Secondary indexes | A unique secondary index lookup typically touches two AMPs. A non-unique secondary index is stored on the same AMP as its base rows, so lookups ask every AMP. |
| SET versus MULTISET tables? | Duplicates | A SET table rejects entirely duplicate rows, and checking for them costs time on NUPI tables. MULTISET allows duplicates. Which is the default depends on the session mode, so declare it. |
| Volatile versus global temporary tables? | Temporary data | A volatile table's definition and data live only for the session. A global temporary table has a permanent definition in the dictionary, and each session gets its own private data. |
Intermediate: SQL, statistics and space
- What does QUALIFY do? It filters on the result of a window function, the way HAVING filters on aggregates.
QUALIFY ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY order_date DESC) = 1keeps the latest row per customer without a subquery. - Why collect statistics, and on what? The optimizer uses them to estimate row counts and choose join plans. Collect on primary index columns, join columns, common filter columns and partitioning columns, and refresh after large loads.
- What do the confidence phrases in EXPLAIN mean? Phrases such as high, low or no confidence describe how sure the optimizer is about its row estimates. No confidence on a big join is a hint that statistics are missing.
- What is spool space, and why do queries fail with a spool error? Spool is working space for intermediate results, limited per user or profile and split across AMPs. A skewed redistribution can fill one AMP's share while others sit empty, so the query fails even though total spool looks ample.
- Perm, spool and temp space? Perm holds permanent tables, spool holds intermediate and final query results, and temp holds data for global temporary tables.
- What is a partitioned primary index (PPI) for? It keeps rows distributed by the primary index but ordered by a partition expression, often a date range, so queries on a range read only the matching partitions.
- What does a join index do? It stores a pre-joined or pre-aggregated result that the optimizer can use in place of the base tables, kept current automatically, at a cost to loads and updates.
- What is the difference between Teradata mode and ANSI mode? They change defaults such as transaction handling and case sensitivity in comparisons. Code moved between them can behave differently, so teams usually pick one and stick with it.
CREATE MULTISET TABLE sales.orders (
order_id INTEGER NOT NULL,
customer_id INTEGER NOT NULL,
order_date DATE NOT NULL,
amount DECIMAL(12,2)
)
PRIMARY INDEX (customer_id)
PARTITION BY RANGE_N (
order_date BETWEEN DATE '2024-01-01' AND DATE '2026-12-31'
EACH INTERVAL '1' MONTH
);
COLLECT STATISTICS COLUMN (customer_id), COLUMN (order_date)
ON sales.orders;
-- Rows per AMP for the chosen primary index: a few very large counts mean skew
SELECT HASHAMP(HASHBUCKET(HASHROW(customer_id))) AS amp_no, COUNT(*) AS row_count
FROM sales.orders
GROUP BY 1
ORDER BY 2 DESC;SELECT customer_id, order_id, order_date
FROM (
SELECT o.*, ROW_NUMBER() OVER (
PARTITION BY customer_id
ORDER BY order_date DESC, order_id DESC) AS rn
FROM orders o
) AS latest
WHERE rn = 1
ORDER BY customer_id;Interviewers often ask for both versions. The point to make is the tie-breaker: two orders on the same date need a second sort key, or the row you keep can change from run to run.
Senior: joins, locks and loading
| Scenario | What it tests | What a strong answer shows |
|---|---|---|
| Two large tables are joined on a column that is not the primary index of either. What happens? | Join planning | Rows must meet on the same AMP, so the optimizer redistributes one or both tables by the join column's hash, or duplicates a small table to every AMP. Choosing primary indexes on common join columns avoids that movement. |
| EXPLAIN shows a product join on a big table. Is that bad? | Join strategies | Often, because every row is compared with every row. It can be fine for a tiny table; on large ones it usually means a missing join condition, an inequality join or missing statistics. |
| One AMP finishes last in every load and query. Why? | Skew | Its share of rows is far larger because the primary index has a few heavy values or many nulls. Measure rows per AMP and pick a better index, possibly a composite one. |
| Reports block an ETL load at night. How do you reduce contention? | Locking | Reports can use LOCKING ROW FOR ACCESS for dirty reads where that is acceptable, while loads take write locks; schedule heavy loads, and load into staging then switch, to keep lock windows short. |
| Which utility would you use to load 500 million rows into an empty table? | Load utilities | A bulk path such as FastLoad or the Teradata Parallel Transporter load operator, which loads in blocks with minimal per-row overhead. Ongoing trickle feeds suit a row-level stream approach instead. |
| BTEQ versus the bulk utilities? | Tool choice | BTEQ runs SQL scripts and small exports and imports with error handling by return code. The bulk utilities move large volumes in parallel with restart features and error tables. |
| How would you plan a migration from Teradata to a cloud warehouse? | Migration | Inventory objects and workloads, convert Teradata-specific SQL such as QUALIFY, SET tables and macros where the target differs, rethink distribution and partitioning for the new engine, and reconcile results table by table. |
- What is fallback? A table option that keeps a second copy of each row on a different AMP in the same cluster, so data stays available if one AMP fails, at the cost of extra space and write work.
- What is the transient journal? The internal record of before-images that lets Teradata roll back an unfinished transaction. A permanent journal is an optional, longer-lived change record defined per table.
- Why might an INSERT SELECT into a SET table be slow? Each row is checked against existing rows with the same row hash for full duplicates. With a non-unique primary index and many equal values, that check grows quickly; a MULTISET table or a unique index avoids it.
- What is a macro, and how does it differ from a stored procedure? A macro is a stored set of SQL statements run as one transaction with parameters. A stored procedure adds procedural logic such as loops, conditions and error handlers.
- How do you find which queries use the most resources? Through the database query log tables, where logging is enabled, looking at CPU, I/O and skew per query, then reading the EXPLAIN of the worst ones.
Fictional example
- A daily revenue report joined a large transactions table to accounts and kept failing with a spool error in month-end runs. EXPLAIN showed the transactions were being redistributed by account number with no confidence on the estimate. Statistics on the join column were months old. I collected statistics on the join and date columns, which changed the plan to redistribute the smaller table instead. I also checked rows per AMP and found a placeholder account that held a large share of rows because missing values defaulted to it. We filtered those rows into a separate step. The report then finished within its window every night that month, and I added statistics refresh to the load job so it would not drift back.
Preparation plan
- Draw the architectureFrom memory: parsing engine, BYNET, AMPs, and where a row goes after hashing. Then explain primary key versus primary index in one minute.
- Pick indexes for a schemaTake three tables from a star schema and choose primary indexes, partitions and statistics, saying why each avoids skew or redistribution.
- Read EXPLAIN outputUse plans from your own work or published examples and name the join strategy, the confidence and the step that moves the most rows.
- Write window SQLPractice QUALIFY, running totals and gap detection, and the portable version for engines without QUALIFY, for example in SQLite on your laptop.
- Prepare two storiesA tuning win and a load or migration problem, each with what you measured. Mention the ETL side if the job includes it, such as Talend jobs feeding the warehouse.
Teradata rounds lean on vocabulary such as row hash, redistribution and spool, and nerves make people blur them together. Natively, an AI interview assistant for Mac and Windows, can transcribe your mock Teradata interview on your computer and save the transcript and notes for later review. In practice runs it can read a screenshot of an EXPLAIN plan or a DDL script and suggest how to walk through it, and with Pro or the free trial it can draw on the résumé and job description you add.
Questions people ask
What Teradata questions are asked in interviews?
Shared-nothing architecture, parsing engine, BYNET and AMPs, primary key versus primary index, UPI and NUPI, secondary and join indexes, SET versus MULTISET, statistics, EXPLAIN, spool space, QUALIFY and the load utilities.
What is the difference between a primary key and a primary index in Teradata?
A primary key is a logical uniqueness rule. A primary index is physical: its hashed value decides which AMP stores each row, so it drives distribution and the fastest access path.
What causes data skew in Teradata?
A primary index with a few very common values or many nulls, which sends a large share of rows to a few AMPs. Those AMPs then finish last and can run out of spool.
Why does a Teradata query fail with a spool space error?
Intermediate results exceeded the user's spool limit, often on one AMP because of a skewed redistribution. Fresh statistics, a better join plan or filtering earlier usually fixes it.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
