Amazon Business Intelligence Analyst Interview Preparation Guide - Mid Level (2-5 years)
Amazon's Business Intelligence Analyst interview process for mid-level candidates consists of an initial recruiter screening, a technical phone screen focusing on SQL and Python, followed by 4-5 onsite interviews. The onsite loop includes technical assessments covering SQL optimization, data modeling and ETL design, metrics definition and analytics, a behavioral interview anchored in Amazon Leadership Principles, and a Bar Raiser round evaluating leadership potential and innovation. All rounds emphasize Amazon's 16 Leadership Principles and require candidates to demonstrate data-driven decision-making, ownership, and the ability to communicate complex technical concepts to non-technical stakeholders.
Interview Rounds
Recruiter Screening
What to Expect
Initial phone conversation with an Amazon recruiter to assess background, role fit, and cultural alignment. The recruiter discusses your experience with BI tools, analytics projects, and SQL/Python proficiency. They also explain the role, team structure, and interview process. This is your opportunity to ask about the team, business domain, and career growth opportunities at Amazon.
Tips & Advice
Be enthusiastic about Amazon's mission and the specific role. Have a clear and concise elevator pitch about your BI background, highlighting relevant projects and tools you've used (Tableau, QuickSight, SQL, Python). Ask thoughtful questions about the team, the business problems they solve, and how analytics impact Amazon's operations. Mention specific Amazon Leadership Principles that resonate with you and align with your experience.
Focus Topics
Technical Skills Overview
Discuss your proficiency with SQL (query writing, optimization), Python (if applicable), data visualization tools, and familiarity with ETL processes and databases.
Practice Interview
Study Questions
Amazon Leadership Principles Alignment
Identify 2-3 Amazon Leadership Principles you naturally embody and be prepared with brief examples that demonstrate them.
Practice Interview
Study Questions
Why Amazon? Why This Role?
Articulate your understanding of Amazon's business, why you're interested in working there, and why this specific BI Analyst role aligns with your career goals.
Practice Interview
Study Questions
Background and BI Experience Summary
Concisely summarize your BI career progression, key projects you've owned, tools you've mastered (Tableau, Power BI, SQL, Python), and measurable outcomes you've delivered.
Practice Interview
Study Questions
Technical Phone Screen
What to Expect
Focused technical phone interview lasting 45-60 minutes where you'll write and optimize SQL queries on a shared coding platform. Expect questions on database concepts, query performance, and possibly basic Python data manipulation. The interviewer will ask you to solve a realistic scenario using SQL (e.g., queries on orders, sessions, or customer data tables) and explain your approach, including why you chose specific joins, filters, or window functions.
Tips & Advice
Think aloud and explain your reasoning for every query choice. Start with a simple solution and then optimize for performance, discussing indexing, partitioning, and query restructuring. Use window functions when appropriate (e.g., ROW_NUMBER(), LAG(), AVG() OVER). Be prepared to discuss INNER/LEFT/RIGHT/FULL joins and when to use each. If Python is asked, demonstrate pandas or numpy usage for data manipulation. Write clean, readable SQL with proper formatting. Test edge cases mentally. Ask clarifying questions about data volume, data types, and expected output format.
Focus Topics
Python Data Manipulation (if applicable)
Write Python code to filter, aggregate, and transform data using pandas or numpy. Handle missing data and perform basic statistical operations.
Practice Interview
Study Questions
Database Concepts and Indexing
Understand transactional (OLTP) vs analytical (OLAP) databases, indexing strategies, query execution plans, and how to identify performance bottlenecks.
Practice Interview
Study Questions
Join Operations and Performance
Understand INNER, LEFT, RIGHT, FULL OUTER, and CROSS joins. Explain join performance implications and when to use each type. Discuss join order optimization for large datasets.
Practice Interview
Study Questions
Window Functions and Advanced SQL
Use ROW_NUMBER(), RANK(), DENSE_RANK(), LAG(), LEAD(), and aggregate window functions. Understand partitioning and ordering clauses for analytical queries.
Practice Interview
Study Questions
SQL Query Writing and Optimization
Write efficient SQL queries to solve analytical problems. Optimize queries by selecting appropriate joins, using indexes, filtering early, and restructuring for performance on large tables.
Practice Interview
Study Questions
Technical Onsite - SQL and Query Optimization
What to Expect
A 60-minute onsite interview focused on advanced SQL query writing and optimization. You'll receive realistic data schemas (e.g., orders, customers, fulfillment) and be asked to write queries to answer analytical questions, optimize slow queries, and discuss performance implications. The interviewer will probe your understanding of indexing strategies, query execution plans, and how to structure queries for efficiency at scale. You should also be prepared to discuss tradeoffs between query complexity and maintainability.
Tips & Advice
Always explain why you're choosing particular joins, filters, and functions. When asked to optimize, walk through the query execution plan conceptually and discuss how indexing, partitioning, or restructuring would improve performance. Provide alternative solutions where applicable and explain the tradeoffs. For mid-level, interviewers expect you to independently identify performance issues and propose solutions without much guidance. Use clear SQL formatting and test your logic with edge cases.
Focus Topics
Data Integrity and Edge Cases
Handle NULL values, duplicates, and edge cases in your SQL logic. Validate results and explain how your query behaves with incomplete or unexpected data.
Practice Interview
Study Questions
Subqueries, CTEs, and Window Functions in Complex Scenarios
Use Common Table Expressions (CTEs) for readability, write subqueries for nested logic, and apply window functions for ranking, running totals, and lag/lead analysis.
Practice Interview
Study Questions
Handling Large Datasets and Performance Bottlenecks
Understand how query performance degrades with large data, identify bottlenecks using execution plans, and apply partitioning, indexing, or denormalization strategies.
Practice Interview
Study Questions
Query Optimization Techniques
Optimize queries for performance by analyzing execution plans, choosing efficient join strategies, filtering early, using indexes, and restructuring for readability and speed.
Practice Interview
Study Questions
Complex Query Writing for Analytics
Write multi-step SQL queries to extract, aggregate, and analyze business metrics. Combine multiple tables, apply conditional logic, and use subqueries or CTEs appropriately.
Practice Interview
Study Questions
Technical Onsite - Data Modeling and ETL Design
What to Expect
A 60-minute onsite interview where you'll design data models, data pipelines, and ETL processes for realistic business scenarios. You may be asked to design a data warehouse schema (star schema with dimension and fact tables), define primary keys and attributes, propose ETL strategies, or optimize data loading processes. The interviewer will evaluate your understanding of data normalization, slowly changing dimensions, and how to ensure data quality and performance in BI systems.
Tips & Advice
Start by clarifying the business requirements, data sources, and reporting needs before diving into design. Propose a star schema or dimensional model with clear fact and dimension tables. Explain your primary key and indexing choices. Discuss how you'd handle slowly changing dimensions (Type 1, 2, or 3). Address data quality validation and testing processes. Consider scalability and performance implications. For mid-level, demonstrate you can own a data model design with some guidance, not just implement a given design.
Focus Topics
Data Quality, Validation, and Testing
Design automated data validation and testing processes. Identify and handle duplicates, NULLs, and inconsistencies. Implement checks to catch data quality issues early.
Practice Interview
Study Questions
Slowly Changing Dimensions (SCD)
Implement SCD Type 1 (overwrite), Type 2 (add new row), or Type 3 (add column) strategies. Maintain historical accuracy while handling plan changes, region moves, and other business updates.
Practice Interview
Study Questions
ETL Design and Data Pipelines
Design automated ETL processes to extract data from sources, transform it for analytics, and load it into the warehouse. Address scheduling, error handling, and incremental loading.
Practice Interview
Study Questions
Data Modeling Best Practices
Define primary keys, foreign keys, attributes, and indexes. Explain denormalization tradeoffs, choose appropriate data types, and design for query performance and maintainability.
Practice Interview
Study Questions
Dimensional Modeling and Star Schema Design
Design fact and dimension tables for a given business scenario. Define grain, measure, and attributes. Create normalized or denormalized structures appropriate for analytics.
Practice Interview
Study Questions
Technical Onsite - Metrics Definition and Business Analytics
What to Expect
A 60-minute onsite interview focusing on metric definition, business insights, and analytical problem-solving. You'll be given ambiguous business questions and asked to translate them into measurable, actionable metrics. Expect scenarios like designing KPIs for Amazon's e-commerce platform, analyzing anomalies in real-time data, predicting product success, or identifying factors driving performance. The interviewer evaluates your ability to think critically, define clear metrics, and drive insights that support strategic decisions.
Tips & Advice
Start by asking clarifying questions to understand the business context and constraints. Define metrics clearly and discuss how you'd calculate them. For anomaly detection scenarios, describe a real-time architecture using Kinesis, Kafka, or Spark Streaming with alerting. When analyzing business problems, use data storytelling to explain findings and tradeoffs. Quantify impact wherever possible (e.g., 'reduced latency by 40%', 'improved adoption by 25%'). For mid-level, interviewers expect independent problem definition and approach without detailed guidance.
Focus Topics
Statistical Methods and Hypothesis Testing
Apply statistical methods to analyze data, test hypotheses, and draw conclusions. Understand significance, confidence intervals, and different statistical approaches for various business questions.
Practice Interview
Study Questions
Anomaly Detection and Real-Time Monitoring
Design real-time monitoring systems to detect anomalies in business data. Discuss architectures using streaming technologies (Kinesis, Kafka, Spark Streaming). Set alert thresholds and handle false positives.
Practice Interview
Study Questions
Cohort Analysis and Trend Identification
Perform cohort analysis to segment users, compare behavior across groups, and identify trends. Explain business impact and use cases for this analytical approach.
Practice Interview
Study Questions
Metric Definition and KPI Design
Translate ambiguous business questions into clear, measurable metrics. Define granularity, calculation logic, and data sources. Design KPIs that align with business objectives and are trackable over time.
Practice Interview
Study Questions
Data-Driven Problem Solving and Insights
Approach business problems analytically. Identify root causes of issues, propose data-backed solutions, and communicate trade-offs and recommendations clearly.
Practice Interview
Study Questions
Behavioral Onsite - Amazon Leadership Principles
What to Expect
A 45-60 minute behavioral interview where the interviewer asks 2-3 behavioral questions designed to assess alignment with Amazon's 16 Leadership Principles. Each question typically targets a specific principle such as Dive Deep, Deliver Results, Ownership, Customer Obsession, or Earn Trust. You'll describe situations where you've demonstrated these principles, using the STAR method (Situation, Task, Action, Result). The interviewer probes for depth, asking follow-up questions about challenges, what you learned, and how you measured success.
Tips & Advice
Prepare 5-7 strong stories covering different Leadership Principles, each with a clear situation, task, action, and quantified result. For mid-level, emphasize examples where you owned a project end-to-end, made independent decisions, drove results under constraints, and learned from challenges. Highlight collaboration with cross-functional teams and instances where you mentored junior colleagues. Use metrics to demonstrate impact (e.g., 'reduced report latency by 40%', 'improved adoption by 25%'). Be specific, not generic. Avoid reciting textbook answers; instead, share authentic experiences that naturally align with principles.
Focus Topics
Amazon Leadership Principle: Customer Obsession and Earn Trust
Show focus on customer needs, communicating findings to stakeholders clearly and earning their trust through data quality and transparency. Share an example of improving a reporting system based on stakeholder feedback.
Practice Interview
Study Questions
Amazon Leadership Principle: Dive Deep
Show willingness to understand details, investigate root causes, and not settle for surface-level explanations. Share an example where thorough analysis uncovered a major data quality issue or business insight.
Practice Interview
Study Questions
STAR Format and Impact Quantification
Structure answers using Situation, Task, Action, Result. Quantify outcomes (time saved, errors reduced, revenue impact, adoption increase) to demonstrate business value.
Practice Interview
Study Questions
Amazon Leadership Principle: Deliver Results
Demonstrate delivering on commitments, managing trade-offs, and achieving goals under pressure or constraints. Quantify impact in your example.
Practice Interview
Study Questions
Amazon Leadership Principle: Ownership
Demonstrate taking responsibility for outcomes, solving problems without waiting for permission, and owning failures as learning opportunities. Share a story where you went beyond your job description to achieve results.
Practice Interview
Study Questions
Bar Raiser Onsite Interview
What to Expect
The final and most rigorous onsite interview, typically 60 minutes, conducted by a senior interviewer tasked with ensuring high hiring standards. The Bar Raiser evaluates your overall fit, leadership potential, innovation mindset, and ability to grow into larger responsibilities. Questions may address how you'd make decisions without manager approval, handle ambiguous situations, drive innovation in analytics, influence others, or raise the bar for your team. This round assesses whether you'll contribute to Amazon's culture of continuous improvement and high standards.
Tips & Advice
Bar Raisers are senior, experienced interviewers with high expectations. Prepare stories that demonstrate leadership potential, risk-taking, and innovation—not just task completion. For mid-level, show examples of driving team improvement, identifying gaps in processes or tools, and proposing solutions. Discuss a time you made a significant decision independently and owned the outcome. Explain how you think about raising standards and mentoring others. Be authentic; Bar Raisers can detect insincere or overly polished answers. Demonstrate that you think strategically about problems, not just tactically.
Focus Topics
Learning from Failure and Adaptability
Discuss a significant failure or unexpected setback in a data project. What did you learn? How did you adapt? What would you do differently and why?
Practice Interview
Study Questions
Decision-Making Under Ambiguity and Risk
Share a scenario where you faced incomplete information, multiple trade-offs, or business risks. How did you frame the decision? What factors did you weigh? What was the outcome?
Practice Interview
Study Questions
Raising the Bar and Mentorship
Provide an example of mentoring a junior analyst or teammate, identifying skill gaps in the team, or advocating for higher standards in BI practices.
Practice Interview
Study Questions
Leadership and Influence Without Authority
Share an example of driving change or making decisions independently, justifying your approach, assessing risks, and achieving positive outcomes without manager approval.
Practice Interview
Study Questions
Innovation and Process Improvement
Describe a time you identified an opportunity to improve a data process, BI tool, or reporting system. What was the innovation? How did you drive adoption and measure success?
Practice Interview
Study Questions
Frequently Asked Business Intelligence Analyst Interview Questions
Describe a time you worked in a matrix organization where several managers or departments had a stake in the same project. How did you keep the initiative moving when priorities, timelines, or expectations were not fully under your control?
Sample Answer
Situation: I worked in a matrix organization on a customer data initiative where Product, Engineering, Legal, and Sales all had a stake.
Task: I had to keep the project moving even though I did not control everyone’s priorities or timelines.
Action: I set up a clear operating model. I defined the business outcome, named one accountable owner, and created a decision log so people could see what was agreed and what was still open. I also built a regular cadence with the key managers so issues surfaced early instead of at the end. When priorities conflicted, I tied the discussion back to business impact. For example, when Sales wanted a faster release and Legal needed more review time, I proposed a phased launch so we could move forward without increasing risk.
Result: The initiative stayed on track because decisions were made in the open and each manager understood how their concerns were being handled.
The main lesson was that in a matrix, progress depends less on direct authority and more on clarity, trust, and disciplined communication.
You have a DataFrame column containing nested lists of tags for each document, and the dataset is very large. Flatten the tags into one row each while preserving a mapping back to the original document id, and explain how you would avoid the memory blow-up that a naive approach can cause at this scale.
Sample Answer
Direct answer
The naive approach (loop over rows in Python, build a list of (doc_id, tag) tuples, then construct a DataFrame from that list) pays for both a Python-level loop and an intermediate list holding every flattened pair before pandas ever sees it. Two better patterns: when the fully flattened result fits in memory, use numpy.repeat to expand the document ids and numpy.concatenate to flatten the tag lists, both implemented in C; when it doesn't fit, stream the flattening in bounded chunks and never hold the full flattened result at once.
Approach
import numpy as np
import pandas as pd
def flatten_with_numpy(df):
tags_series = df["tags"].apply(lambda x: x if isinstance(x, list) else [])
tags_arr = tags_series.to_numpy(dtype=object)
lengths = np.fromiter((len(x) for x in tags_arr), dtype=np.int64)
if lengths.sum() == 0:
return pd.DataFrame(columns=["doc_id", "tag"])
flat_tags = np.concatenate(tags_arr[lengths > 0]) # single 1D array of every tag
doc_ids = np.repeat(df["doc_id"].to_numpy(), lengths) # each doc_id repeated len(tags) times
return pd.DataFrame({"doc_id": doc_ids, "tag": flat_tags})
For data too large to flatten all at once, stream it in bounded chunks instead:
from itertools import islice
def flatten_stream(df_iter, chunksize=100_000):
out_chunks = []
for chunk in df_iter:
pairs = ((row.doc_id, tag) for row in chunk.itertuples(index=False) for tag in (row.tags or []))
batch = list(islice(pairs, chunksize))
while batch:
out_chunks.append(pd.DataFrame(batch, columns=["doc_id", "tag"]))
batch = list(islice(pairs, chunksize))
return pd.concat(out_chunks, ignore_index=True) if out_chunks else pd.DataFrame(columns=["doc_id", "tag"])
Key points:
np.repeat/np.concatenateavoid a Python-level loop entirely for the common case;pandas.explodeis more convenient to write but internally still builds a full copy of the DataFrame with repeated index rows, which costs more memory at large scale than the two-array numpy construction.- The streaming version never materializes the full flattened result: each chunk of input produces a bounded-size output chunk, so peak memory is capped by
chunksize, not by total document count, at the cost of needing topd.concat(or write out) the chunks afterward. lengths > 0filters out documents with an empty tag list beforenp.concatenate, sincenp.concatenaterequires at least one non-empty array and an all-empty input would otherwise raise.
Worked example
df = pd.DataFrame({
"doc_id": [1, 2, 3],
"tags": [["a", "b"], [], ["c"]],
})
print(flatten_with_numpy(df))
Output (verified against pandas 3.0.3, numpy 2.5.1):
doc_id tag
0 1 a
1 1 b
2 3 c
Document 2 has no tags and contributes zero rows to the output, which is the correct one-row-per-tag mapping (not one row per document); documents 1 and 3 each contribute one row per tag, still carrying their original doc_id.
Complexity and edge cases
Complexity: both patterns are O(N) time and O(N) space where N is the total number of tags across all documents (not the number of documents), since every tag must appear at least once in the output. The numpy pattern holds the full N-length output in memory at once; the streaming pattern bounds memory to O(chunksize) by writing or accumulating smaller pieces incrementally, trading a lower memory ceiling for extra I/O or concatenation overhead at the end.
Edge cases: None/NaN (not-a-number) in the tags column is coerced to an empty list via isinstance(x, list) rather than calling pd.isna(x) directly on a cell that might itself be a multi-element list, since pd.isna() on a list raises an ambiguous-truth-value error inside an if; an all-empty tags column returns an explicitly empty, correctly-typed DataFrame rather than letting np.concatenate fail on zero arrays; a single document with an extremely long tag list still needs to fit that one document's tags in memory even under the streaming pattern, since a document's tag list isn't itself split across chunks.
Trade-offs and pitfalls
Use the numpy pattern when the fully flattened result comfortably fits in memory and speed matters most: it minimizes Python-level looping and is typically faster and lighter than pandas.explode at scale, since explode carries the overhead of DataFrame index bookkeeping that the two flat numpy arrays don't. Use the streaming pattern when you must cap memory usage regardless of total size, reading the source in chunks (read_parquet, JSON lines, or a chunked SQL query) so the full flattened array is never constructed at once, only written or aggregated incrementally. The pitfall to watch for in the numpy pattern specifically is the isinstance(x, list) guard: a naive pd.isna(x) check on a cell that could be a list raises inside an if statement precisely because pandas cannot decide whether a multi-element array is True or False, so type-checking the cell rather than null-checking it is the correct guard here, not an arbitrary style choice.
Define selectivity and cardinality in the context of query optimization. How does predicate selectivity influence both index usage and join order selection, and how would you estimate the selectivity of a predicate from existing table statistics?
Sample Answer
Direct answer. Selectivity is the fraction of a table's rows a predicate matches; cardinality is the actual number of rows that come out of an operation. A highly selective predicate (one matching few rows) is exactly the situation where an index earns its cost, and predicate selectivity is also the main input the optimizer uses to decide join order, since it wants to apply the most narrowing filters as early as possible.
Structured elaboration. If a predicate's selectivity is 1% (it matches roughly 1 in 100 rows), an index lookup that jumps straight to those rows beats scanning the whole table, since the fixed cost of the index lookup is repaid many times over by the rows it lets you skip; a predicate matching 50% of rows offers much less benefit from an index, since you'd be visiting half the table's rows either way, just via a more expensive access pattern. For join order, the optimizer generally wants to apply the predicate (or combination of predicates) that will shrink the working set the most, as early in the join sequence as possible, since every table joined afterward then only has to be matched against a smaller intermediate result rather than the full one.
To estimate a predicate's selectivity from existing statistics without running the full query, you'd typically look at the number of distinct values for that column (assuming a roughly uniform distribution, selectivity for an equality predicate is close to 1 divided by the distinct value count) or, where available, a stored histogram that captures the actual distribution more precisely for skewed columns.
Worked example. For a users table with a country column where 90% of rows are 'US' and the remaining 10% are spread across 40 other countries, filtering country = 'US' has low selectivity (matches ~90% of rows, an index doesn't help much, a scan is likely the right choice), while filtering country = 'Luxembourg' has high selectivity (matches a tiny fraction, an index on country earns its cost here even though it's the SAME column and the SAME index).
Trade-offs and pitfalls. Selectivity isn't a fixed property of a column, it's a property of a specific predicate VALUE against that column's distribution; assuming one index is uniformly "good" or "useless" for a column without accounting for which specific values are queried most is a common estimation mistake, and it's exactly why skewed columns need better-than-average statistics (histograms or multi-value frequency counts) to plan well.
Someone you mentor made a mistake that had real, visible consequences for the team or the product. How did you handle the conversation and the follow-up with them?
Sample Answer
Direct answer
The conversation matters less than the sequence: separate stabilizing the consequence from the coaching conversation, then run the retrospective as blameless (focused on the system and process, not the individual) so the mentee stays engaged rather than defensive, and turn what's learned into a durable safeguard, not just a one-time talk.
Sequence: stabilize, then convene
- First, contain the actual consequence, ideally with the mentee involved rather than sidelined; solving it together protects both the outcome and their sense of ownership.
- Only after that, run the retrospective. Doing it while still firefighting mixes urgency with reflection and makes the mentee defensive.
The blameless postmortem as the concrete framework
- Ground rules stated up front: the goal is understanding the system and sequence of events, not assigning blame to the individual who happened to be the one who made the change.
- A neutral facilitator, or a rotating one across the team so it isn't always the same person in that role, helps keep the conversation from drifting toward blame, especially when the mentor is also the mentee's manager.
- Reconstruct a factual timeline first, before any discussion of what should have happened differently; jumping to "here's what you should have done" before the facts are laid out reads as judgment, not diagnosis.
- Sensitive details (who wrote the specific line, private context) get anonymized in the written artifact where possible, since the point is the process, not the person.
- The output is a written root-cause artifact with concrete action items, not just a conversation that ends when the meeting does.
Coaching the mentee specifically
- Ask them to walk through their own reasoning at each decision point, rather than you narrating what went wrong; this builds their own diagnostic skill for next time instead of just transmitting your conclusion.
- Separate the mistake from their competence explicitly, out loud; the message is "the system let this happen too easily," not "you're bad at this."
When the mistake isn't just one person's
- Sometimes the visible consequence comes from multiple people's individually reasonable changes interacting badly (a cross-team or cascading failure), not one person's error. The blameless frame matters even more here: the postmortem needs to surface the interaction, not scapegoat whichever team's change happened to be the trigger. The coaching conversation with your mentee shifts from "what would you do differently" to "how do you think about the blast radius of a change you don't fully control," since the lesson is about system boundaries, not individual judgment.
Worked example
A mentee I was supporting shipped a change that caused a visible, customer-facing issue. The first move was working alongside them to stabilize it, not taking over and pushing them out of the loop. Once it was stable, I ran a blameless postmortem with the mentee, a couple of the affected team members, and a neutral facilitator: we built a timeline from logs and commits before discussing anything about what should have happened, and the mentee walked through their own reasoning at each step rather than me presenting conclusions.
The root cause turned out to be a gap in the pre-merge checks, not a lapse in the mentee's judgment; the change was reasonable given what the tooling surfaced at the time. The written follow-up had concrete items (a new check added to the pipeline, an update to the review checklist) rather than just "be more careful." A few weeks later, in a separate incident, another engineer's change was caught by that new check before it shipped, which is the kind of signal that the fix generalized rather than just patching one person's blind spot.
Trade-offs and pitfalls
- The common junior mistake is either being too harsh in the moment (public correction, visible frustration), which teaches the mentee to hide mistakes next time, or being too soft and skipping the structured retrospective entirely, which loses the systemic fix.
- Blameless doesn't mean consequence-free; if the pattern repeats after a genuine fix and support, that's a different, harder conversation about capability or fit, not a postmortem.
- Anonymizing sensitive details in the artifact protects psychological safety (people's sense that they can admit a mistake without fear of punishment), but overdoing it (scrubbing so much nobody can learn the specific mechanism) makes the postmortem useless as a teaching tool. The balance is protecting the person while keeping the mechanism specific.
Given a table of per-user activity dates (possibly with gaps), write a query that finds each user's streaks of consecutive active days: streak_start, streak_end, and streak_length. Use the classic date-minus-row-number trick (or an equivalent LAG-based approach) and explain why it produces a stable group id for each contiguous run.
Sample Answer
Direct answer: For each user, number the activity dates in order with ROW_NUMBER(), then subtract that row number (in days) from the actual date. Within one unbroken run of consecutive days, the date increases by exactly 1 each row while the row number also increases by exactly 1, so date - row_number is a constant for the entire run and jumps to a new constant the moment there's a gap. That constant is a ready-made, stable group id: group by it (per user) and aggregate to get each streak's start, end, and length.
Structured elaboration
Why the trick works, concretely. If a user is active on Jan 1, 2, 3 (three consecutive days), their row numbers are 1, 2, 3. date - row_number, expressed as date - (row_number * INTERVAL 1 day) so both sides are dates, gives Dec 31, Dec 31, Dec 31 for all three rows: the row number is climbing at exactly the same rate as the date, so the difference is invariant. The moment there's a gap (say the next activity is Jan 5, skipping Jan 4), the row number continues climbing by 1 (to 4) but the date jumps by 2, so date - row_number shifts to a new constant. Every row in a contiguous run shares one constant; every gap produces a new constant. That is why grouping by this value is safe and deterministic, unlike an arbitrary running counter that would need a separate flag-and-cumsum step (the LAG-based alternative below does exactly that instead).
WITH numbered AS (
SELECT user_id, activity_date,
ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY activity_date) AS rn
FROM activity
),
grouped AS (
SELECT user_id, activity_date,
activity_date - (rn * INTERVAL '1 day') AS island_id
FROM numbered
)
SELECT user_id, island_id,
MIN(activity_date) AS streak_start, MAX(activity_date) AS streak_end, COUNT(*) AS streak_length
FROM grouped
GROUP BY user_id, island_id
ORDER BY user_id, streak_start;
LAG-based equivalent. Instead of arithmetic on the date, compare each row directly to the previous one: flag a new streak whenever activity_date <> prev_date + 1, then take a running SUM of that flag as the group id. This produces the identical grouping, at the cost of one extra window pass; it generalizes more naturally when the gap rule is not a fixed "+1 day" (see below).
Worked example (executed in DuckDB). User 1's activity dates: Jan 1, 2, 3 (a 3-day streak), then Jan 5, 6 (a 2-day streak after a 1-day gap), then Jan 10 (an isolated day).
user_id | streak_start | streak_end | streak_length
1 | 2025-01-01 | 2025-01-03 | 3
1 | 2025-01-05 | 2025-01-06 | 2
1 | 2025-01-10 | 2025-01-10 | 1
The island_id values produced internally were three distinct dates (one per run), confirming the arithmetic correctly separated the three streaks without any explicit gap-detection logic.
Generalizing the same island logic
- Coarser granularity (3+ consecutive weeks). Replace "day" with "week": truncate each activity date to its week start (e.g.
date_trunc('week', activity_date)), dedupe to one row per (user, week), then apply the identicaldate - row_numbertrick usingINTERVAL '1 week'instead of'1 day'. The mechanism is unchanged; only the unit of contiguity changes. - A per-user variable gap threshold. If "consecutive" means something other than a fixed 1-day gap per user (e.g. some users are only expected to be active every other day), the date-minus-row-number arithmetic trick stops applying cleanly, because it depends on the gap being a fixed, known constant. Switch to the LAG-based form and compare against a per-user threshold column instead of a literal
+ 1:CASE WHEN activity_date > prev_date + gap_threshold THEN 1 ELSE 0 END. - A tolerance window on the contiguity test. If a single missed day should still count as "the same streak" (a grace-day rule), change the LAG comparison from
<> prev_date + 1to> prev_date + tolerance_days, i.e. only break the streak when the gap exceeds the tolerance, not on any gap at all. - The same pattern on a non-boolean series. The identical island logic applies to "3+ consecutive days of declining revenue" or "consecutive growing-revenue days": instead of flagging by date contiguity, flag each row by
CASE WHEN revenue < LAG(revenue) OVER (...) THEN 1 ELSE 0 END(a direction change breaks the streak) and take the running SUM of direction-changes as the group id. The grouping mechanism (a monotonically non-decreasing counter that only increments at a boundary) is exactly the same; only the definition of "boundary" changes.
Trade-offs & pitfalls
- Deduplicate same-day activity before ranking (
GROUP BY user_id, activity_datefirst); otherwise a duplicate row inflatesstreak_lengthwithout representing a real extra day. - The date-minus-row-number trick specifically needs a fixed, known step size (1 day, 1 week); once the gap rule is conditional or per-user, fall back to the LAG-and-cumulative-sum form, which handles any boundary condition you can express as a boolean.
date - row_numberonly produces a stable id within one user's partition; always includeuser_idin the finalGROUP BY, or two different users' unrelated streaks that happen to land on the same constant will merge.
Describe how to use EXPLAIN and EXPLAIN ANALYZE in PostgreSQL to diagnose slow queries. What specific signals in the plan and actual timing should you look for (e.g., sequential-scan vs index-scan, nested loop vs hash join, estimated vs actual rows, buffers), and what corrective actions would you take for common findings?
Sample Answer
Start by running EXPLAIN to get the planner’s estimated plan, then EXPLAIN (ANALYZE, BUFFERS) to execute the query and see real timings and buffer usage. Key steps and what to look for:
- Compare estimated rows vs actual rows: large discrepancies mean wrong statistics. If estimates << actual, add or increase ANALYZE frequency or create more specific statistics (ANALYZE, or CREATE STATISTICS for correlated columns), or rewrite predicates.
- Scan type: Sequential Scan vs Index Scan — seq scan is fine for large portions but unexpected seq scans on selective predicates suggest missing or non-selective indexes or poor statistics. Corrective actions: add or tune indexes (including expression or partial indexes), rewrite joins/filters, or force index usage cautiously.
- Join algorithms: Nested Loop vs Hash/ Merge Join — nested loops are cheap for small inner sets but costly when inner side is large. If you see nested loop with large actual rows, consider adding indexes on join keys, or restructuring query, or increasing work_mem to allow hash joins.
- Timing and cost hotspots: Look at actual time per node and total time — nodes with highest time are bottlenecks.
- Buffers and I/O: High shared read or temp usage indicates disk I/O or spill to disk. Increase work_mem to avoid temp files, add appropriate indexes, or improve vacuum/analyze to reduce bloat.
- Sorts: External sorts (temp files) indicate insufficient work_mem; increase work_mem or add indexes to avoid large ORDER BY sorts.
- Seq scan on partitioned tables: ensure partition pruning works (use constraints or rewrite query) or create indexes per partition.
Practical workflow: run EXPLAIN ANALYZE BUFFERS, identify node with biggest actual time and large estimate mismatch, check indexes/statistics, adjust schema or settings (ANALYZE, CREATE INDEX, increase work_mem), and re-run to confirm improvement. Document changes and add regular maintenance (VACUUM ANALYZE) for stable performance.
Compare computing derived metrics in the BI layer (Looker explores, Tableau calculated fields) versus computing them in the data warehouse as materialized aggregates. Discuss trade-offs in freshness, operational cost, consistency across dashboards, governance, and complexity of joins. Provide recommendations for a growing organization that uses both BI tools and a central warehouse.
Sample Answer
Direct answer: Compute in the warehouse as materialized aggregates for any metric shared across multiple BI tools or dashboards (consistency and governance win), and reserve BI-layer calculated fields for genuinely tool-specific, ad hoc, or single-dashboard-scoped derivations where the overhead of formalizing a warehouse model isn't justified.
Structured elaboration:
- Freshness: a BI-layer calculated field recomputes live at query time (as fresh as the underlying warehouse data, no extra pipeline lag), while a warehouse materialized aggregate is only as fresh as its last refresh; for most business dashboards this difference is immaterial, but it matters for a genuinely live use case.
- Operational cost: BI-layer calculations shift compute cost to query time, repeated on every dashboard view (fine for lightly-used dashboards, expensive at high query volume); warehouse pre-aggregation pays the cost once per refresh and serves reads cheaply afterward.
- Consistency across dashboards: this is the decisive factor for anything used in MORE than one place: a calculated field defined independently in Looker AND in Tableau (two different BI layers) for "the same" metric WILL drift, since each tool's calculated-field logic lives and evolves independently, invisible to the other tool; a single warehouse-computed metric read by both tools guarantees they show the same number by construction.
- Governance: a warehouse-computed metric can be put behind the same registry/access-control/testing discipline as any other governed asset (S58); a BI-tool-native calculated field typically lives inside that tool's proprietary project file, outside the registry's visibility entirely, making it invisible to governance and easy to silently duplicate.
- Join complexity: the warehouse is the right place for genuinely heavy, complex joins (the kind discussed in this topic's cross-system, high-cardinality join content); pushing a heavy multi-table join into a BI tool's calculated-field layer typically performs worse and is harder to test than doing it once, upstream, in the warehouse.
Recommendation for a growing org using both: any metric read by MORE than one dashboard or MORE than one BI tool should be computed once in the warehouse and referenced, not recalculated per tool; genuinely single-use, exploratory, ad hoc calculated fields can stay in the BI layer, with an explicit norm that anything promoted to a shared/recurring dashboard gets "graduated" into the warehouse-governed layer at that point, not before (avoiding premature formalization of things that never end up needing it).
Trade-offs & pitfalls: the common failure mode as an org grows is BI-layer calculated fields quietly accumulating across many dashboards, each independently maintained, until nobody can say with confidence which of the five slightly-different "conversion rate" calculated fields scattered across Looker and Tableau is the "real" one; the graduation norm above is specifically designed to catch this before it compounds, by making the warehouse the mandatory home for anything shared.
Turn this resume bullet into a story you could tell in about sixty seconds: 'Reduced nightly batch job time from 4 hours to 30 minutes by parallelizing tasks and optimizing database queries.'
Sample Answer
Direct Answer
Build the STAR skeleton straight from the bullet: Situation is that the nightly batch job's four-hour runtime was delaying downstream reports, Task was reducing that without breaking correctness, Action is the two specific things named in the bullet, parallelizing tasks and optimizing database queries, and Result is the number already in the bullet, four hours down to thirty minutes, roughly an eight-times improvement. The number and a one-clause statement of why it mattered are the two things that must survive into the sixty-second version.
Turning the Bullet Into a Story
A resume bullet typically hands you two of the four STAR pieces already, Action and Result, and leaves you to reconstruct Situation and Task on your own. "Downstream reports were delayed" or "the on-call window kept slipping" are both plausible, honest reconstructions of why a four-hour batch job mattered, as long as you frame them as what you can defensibly say happened, not invented specifics you can't back up if probed.
The Action in the bullet, parallelizing tasks and optimizing database queries, is really two distinct changes. In a sixty-second story it's fine to name both without going deep on either: "I identified which parts of the job could run independently and parallelized them, and separately optimized the slowest queries, mostly by adding missing indexes and batching writes that had been happening one row at a time."
What to Include Versus Omit
The clearest signal in this story is the number, four hours to thirty minutes, so it has to survive intact; that's the strongest thing to include. What to omit is implementation-level detail: the specific indexing strategy, the parallelization approach, the exact queries touched. Those are worth having ready if asked, but don't belong in the sixty-second version.
This same include-or-omit judgment holds up on a second, hypothetical bullet too, not something this question actually supplied, just a made-up illustration to show the principle generalizes: an algorithm change that cut storage use by 40 percent. The temptation there is to lead with the algorithm's name or mechanism, but the stronger sixty-second version leads with the number and ties it to something the business cares about, cost or capacity, and only names the specific algorithmic change, for example switching from a full copy to a more compact representation, as a supporting clause rather than the headline. In both cases, real bullet or invented one, the technical mechanism should be ready if probed, but the number and its business consequence are what earns the airtime in a short story.
Worked Example (Full Sixty-Second Version)
"Our nightly batch job took about four hours to run, which meant the team's morning reports weren't always ready before the daily standup. I dug into where the time was going, found several steps that were running sequentially even though they didn't depend on each other, and parallelized those. I also found a handful of slow queries that were missing indexes and were doing writes one row at a time instead of in batches, and fixed both. The job now finishes in about thirty minutes, so reports are consistently ready well before standup."
Trade-offs and Pitfalls
- Leading with implementation jargon before the number loses a non-technical listener before the payoff lands; the number should come early, not as an afterthought.
- Omitting the number entirely to keep the story high level is the opposite mistake and throws away the strongest, most concrete signal the story has.
A product dashboard shows a single conversion rate for all users, but you suspect mobile users behave differently from desktop users. Describe the steps you would take to run a segment-based analysis comparing mobile and desktop: which queries you would run, what visualization you would produce, and how the results would change product prioritization.
Sample Answer
Direct answer
The right first step is not to jump straight to a query, but to confirm the suspicion is real: split the existing conversion metric by device type and check whether the gap between mobile and desktop is large enough, and consistent enough over time, to be worth investigating further before proposing changes.
Structured elaboration
Concretely, this means running a query that computes conversion rate separately for mobile and desktop sessions over a recent, representative window (avoiding a single unusual day), and checking the result holds across at least a few weeks rather than being a one-off blip. If a real and persistent gap is confirmed, the next step is to visualize it in a way that makes the SIZE of the gap and its trend over time legible at a glance, typically a simple time series with mobile and desktop as two separate lines, since a single point-in-time comparison cannot show whether the gap is stable, widening, or narrowing.
From there, the statistical question becomes whether the observed gap could plausibly be explained by normal variation given the sample sizes involved, which calls for a two-proportion significance test (comparing the mobile conversion rate to the desktop conversion rate as two independent proportions) rather than eyeballing the percentages, especially if one of the two groups has a meaningfully smaller sample size. Only once the gap is confirmed as both real and statistically distinguishable from noise does it make sense to bring the finding to product prioritization, since presenting an unconfirmed or statistically weak gap risks sending a team to fix a problem that may not actually exist.
Worked example
Suppose a two-week pull shows 40,000 desktop sessions converting at 4.8% and 65,000 mobile sessions converting at 3.6%, a 1.2-percentage-point absolute gap. A two-proportion test on those counts (1,920 desktop conversions out of 40,000 versus 2,340 mobile conversions out of 65,000) is the right way to check whether a gap of that size, given those sample sizes, is unlikely to be due to chance, rather than asserting significance from the percentage difference alone; with sample sizes this large, a gap of 1.2 points would typically clear a standard significance threshold, which is itself useful information; a much smaller gap, or a much smaller sample, might not. If confirmed, the visualization for product prioritization would plot the weekly mobile and desktop conversion rates as two lines over the same two-week window, making clear whether the gap has been consistent or is a recent development.
Trade-offs and pitfalls
A common mistake is treating a single day or a single small sample's device split as conclusive, when device-level conversion rates can be noisy day to day for reasons unrelated to a real UX gap, such as a marketing campaign that happened to skew heavily toward one device that day. Another common mistake is stopping at "mobile converts worse than desktop" without segmenting further, since a device-level gap is often really concentrated in a specific step of the flow (for example, a form that is hard to fill in on a small screen), and the device split alone will not reveal which step to fix.
Compare a traditional centralized data warehouse, where one platform team owns ingestion, modeling, and serving for the whole company, against a data mesh architecture, where each business domain owns and publishes its own analytical data as a product against company-wide interoperability standards. What specific problem is data mesh trying to solve that a well-run centralized warehouse does not already solve, what does an organization give up by adopting it, and when would you recommend against it?
Sample Answer
Direct answer
Data mesh is trying to solve an organizational bottleneck, not a technical one: in a centralized warehouse, one platform team becomes the sole gatekeeper for every domain's data, and as the company grows, that team cannot scale its domain knowledge or its throughput fast enough to keep every business unit unblocked. Data mesh fixes this by making each domain team responsible for publishing its own data as a well-defined, discoverable, quality-guaranteed "data product," coordinated only by shared interoperability standards rather than a single team's backlog. What you give up is exactly the thing centralization was good at: one team enforcing consistent modeling discipline and conformed dimensions everywhere, which a mesh instead has to achieve through governance and standards that are far easier to state than to actually enforce across many independent teams.
Structured elaboration
The problem data mesh solves. As a company adds domains (finance, marketing, logistics, each with deep, changing domain knowledge), a single centralized platform team increasingly becomes a queue: every new mart, every schema change, every new source integration waits on that one team's capacity, and that team's members are rarely domain experts in all the areas they are modeling data for. Data mesh addresses this by pushing ownership of the DATA out to the domain teams that already understand it best, while the platform team's job shifts to building and operating shared self-serve infrastructure (a common cataloging, access-control, and quality-testing layer) rather than owning every dataset itself.
What a well-run centralized warehouse already solves, and does not need mesh to fix. If an organization is small enough, or disciplined enough, that a single platform team can genuinely keep up with every domain's needs, a centralized warehouse's core advantage, one team enforcing conformed dimensions and one place to look for the "official" definition of a metric, is not a problem data mesh needs to solve, it is a benefit you would be trading away.
What you give up. Conformance discipline is the main casualty: in a centralized model, one team can simply refuse to publish a customer dimension that does not match the existing conformed one. In a mesh, each domain team owns and can independently evolve its own data product, so achieving the same cross-domain consistency requires the interoperability standards (naming conventions, shared identifiers, data contracts, quality SLAs) to be genuinely enforced, typically through automated checks in the shared platform rather than a single team's review, and that enforcement machinery is itself a significant, ongoing investment.
When to recommend against it. A small or early-stage company (the kind of organization discussed when deciding whether it needs a formal warehouse at all) does not have enough distinct domains or organizational scale for a mesh's coordination overhead to pay for itself; a single platform team can still serve everyone directly and faster than standing up domain teams and shared self-serve infrastructure would. A company without the engineering maturity to build and operate the shared interoperability platform a mesh depends on will end up with the worst of both worlds: decentralized ownership without the standards that were supposed to keep it consistent, which is functionally the four-un-conformed-dimensions governance failure, just organized around teams instead of ad-hoc mart builds.
Worked example
A company with one warehouse team serving five departments starts taking two weeks to review and approve every new mart request, and departments start building their own disconnected spreadsheets to route around the bottleneck, exactly the fragmentation a warehouse was meant to prevent in the first place. Moving to a mesh does not remove the need for a customer identifier every domain agrees on: it moves the enforcement of that agreement from "the one team reviews everything" to "the shared platform automatically validates every published data product against a data contract that specifies the agreed identifier, format, and quality checks," which only works if that contract-validation infrastructure actually gets built and maintained, not just proposed.
Trade-offs and pitfalls
The most common mistake is adopting the language of data mesh (domain ownership, data products) without building the shared self-serve platform underneath it, which produces decentralization with none of the standards enforcement that made the model viable in the literature; the result is usually worse consistency than the centralized warehouse it replaced. The second common mistake is treating this as an all-or-nothing choice: many organizations run a hybrid where a small number of genuinely cross-cutting dimensions (customer, date, product) stay centrally owned and conformed exactly as in a Kimball bus architecture, while domain-specific facts and less-shared dimensions are pushed out to domain ownership.
Search Results
Amazon Business Intelligence Engineer Interview Questions
Here is a comprehensive guide to ace Amazon business intelligence engineer interview covering each step from typical interview questions to SQL problems.
Amazon Business Intelligence Engineer Interview Questions
Common Amazon Business Intelligence Analyst interview questions: · How would you design a data model for Lyft App? · What would be the dimension and fact tables?
Breaking Down the Amazon BIE Interview
Metric definition and insights interview questions. Amazon expects BIEs to translate ambiguous business questions into clear, measurable metrics ...
BIE Interview Prep - Amazon.jobs
Each interviewer will typically ask two or three behavioral-based questions about successes or challenges and how you handled them using our Leadership ...
20 Questions from the Amazon Business Intelligence Engineer (BIE ...
What are the different types of statistical methods and their use cases? · How can statistics be used to improve business performance? · Can you ...
AMAZON BUSINESS ANALYST Interview Questions and ... - YouTube
AMAZON BUSINESS ANALYST Interview Questions and ANSWERS! (Amazon Leadership Principles!) TOP TIPS!
Amazon Business Analyst Interview Guide | Sample Questions (2025)
Do you understand how to tackle large data sets? Can you talk about how you want to design the underlying table? For the specific business scenario, would you ...
BI Analyst Interview Questions and Answers (2025)
A comprehensive list of essential BI analyst interview questions and answers. Prepare for technical questions a hiring manager at Amazon, Apple, ...
This interview preparation guide was generated using AI-powered research from the sources listed above. While we strive for accuracy, we recommend verifying critical information from official company sources.
Want to create your own tailored preparation guide using our deep research?
Get Started for FreeInterview-Ready Courses
Visual-first, interactive, structured learning paths
Browse Business Intelligence Analyst jobs
AI-enriched listings across hundreds of company career pages
Explore Jobs