Data Visualization and Dashboard Design Questions
Designing visuals and dashboards that communicate clearly. Covers chart-type selection, encoding choices, dashboard layout and hierarchy, avoiding misleading visuals, and designing for the intended audience and decision. Emphasizes effectiveness over decoration.
Design a dashboard panel to report A/B test results (including for multiple concurrent experiments) to product managers and non-statistical stakeholders. Requirements: primary metric, effect size, confidence interval, p-value, sample size, and a recommended action. Describe the layout and how you would annotate it to guard against misinterpretation.
Sample Answer
Direct answer
A dashboard reporting A/B test results to non-technical stakeholders should show the primary metric, its effect size, a confidence interval, the p-value, sample size, and a clear recommended action, laid out so the recommendation is the first thing a viewer sees, with the supporting statistics available but not overwhelming, and annotations that explicitly guard against common misreadings like treating a marginal result as decisive.
Structured elaboration
- Required content: primary metric and its lift (absolute and/or relative), a confidence interval (a range, e.g. -0.4% to +4.6%, that's likely to contain the true effect size if the test were repeated many times; the wider the range, the less certain the estimate), the p-value (roughly: how likely it would be to see a lift at least this big by pure chance if the change actually had no real effect at all; conventionally, below 0.05 is treated as a real signal, and the worked example below shows a p=0.09 result that does not clear that bar), the sample size and test duration (so viewers can judge whether the test had enough power), and a recommended action (ship / hold / continue collecting data).
- Layout: lead with the recommendation and headline lift number; place the supporting statistical detail (CI, p-value, sample size) in a secondary, still-visible row rather than burying it, so a curious or skeptical stakeholder can check the underlying rigor without it being the first thing that competes for attention.
- Supporting multiple concurrent experiments: a table or card-per-experiment view listing each experiment's status, primary metric, and recommendation, with the ability to drill into any one experiment's full detail view.
- Guarding against misinterpretation: annotate when a confidence interval crosses zero ("result not yet statistically distinguishable from no effect") explicitly rather than relying on the stakeholder to infer that from the raw numbers; visually flag if a test is still below its planned sample size (still accumulating, not yet conclusive) so nobody treats an in-progress test's numbers as final.
Worked example
A card for one experiment reads: "Recommendation: Continue collecting data. Lift: +2.1% [95% CI: -0.4%, +4.6%]. p=0.09. Sample size: 45,000 of a planned 80,000. Duration: 9 of planned 14 days," making clear both the promising direction and the fact that it isn't yet conclusive, rather than showing only the +2.1% lift number in isolation.
Trade-offs and pitfalls
Showing only the lift percentage without the confidence interval and sample-size context is the single most common way an A/B test dashboard misleads stakeholders into treating a noisy, in-progress, or marginal result as a confirmed win.
Explain how to map data types (nominal, ordinal, interval, ratio) to visual encodings (position, length, color, area, angle). For each mapping provide a short example of a dashboard scenario that uses that encoding and explain why some encodings are more perceptually accurate.
Sample Answer
Direct answer
Map nominal data (unordered categories) to color hue or shape, ordinal data (ordered categories without meaningful numeric spacing) to a sequential color scale or position along an ordered axis, and interval or ratio data (meaningful numeric spacing, with ratio data also having a true zero) to position, length, or area, since those channels support precise magnitude comparison that nominal/ordinal data doesn't need or support.
Structured elaboration
- Nominal: categories with no inherent order (e.g. product line, region); map to hue (a categorical color palette) or shape, since there's no magnitude to encode, only identity.
- Ordinal: categories with a meaningful order but no consistent numeric spacing (e.g. customer satisfaction: low/medium/high); map to a sequential color scale (light to dark) or an ordered position on an axis, preserving the ORDER without implying the gaps between categories are numerically equal.
- Interval: numeric data with meaningful spacing but no true zero (e.g. a calendar date, or a temperature-like index); position along an axis works well, but ratio statements ("twice as much") aren't meaningful, so avoid area or a zero-anchored bar chart implying a ratio comparison that isn't valid.
- Angle: a weaker channel than position or length for ratio data (per Cleveland-McGill: William Cleveland and Robert McGill's classic 1984 study that ranked how accurately people judge different visual channels, from position and length at the top down to angle, area, and color at the bottom; humans judge angles less accurately), most familiar as pie or donut slice size; usable for ratio data in a pinch, but a sorted bar chart is generally the more precise choice when exact ranking matters.
- Ratio: numeric data with a true zero (e.g. revenue, count of users); this is where length, area, and zero-based bar charts are fully valid, since "twice the length/area" genuinely means "twice the value."
- Why some encodings are more perceptually accurate: position and length are judged by the human visual system with the least error across viewers (per Cleveland-McGill), which is why ratio/interval data (where those channels are valid) should generally prefer them over area or color when precision matters.
*Worked example (e-commerce sales dashboard)
- Nominal: payment method (credit card, PayPal, etc.) shown as distinct colored segments in a stacked bar, since there's no inherent order.
- Ordinal: customer satisfaction tier (low/medium/high) shown with a sequential color scale from light to dark, preserving order visually.
- Interval-like: a day-of-week index used for seasonal pattern coloring, where position matters but "Wednesday is twice Monday" isn't a meaningful statement.
- Ratio: revenue by region shown as bar length, where a bar twice as long genuinely means twice the revenue.
Trade-offs and pitfalls
Using a bar chart (implying a ratio, zero-based comparison) for interval data without a true zero, or using color to represent ratio data where a viewer needs precise comparison, are the two most common mismatches between data type and encoding.
You have a dataset of customer purchase amounts across 5 segments (A–E). Explain which visualizations you would use to compare distributions across segments (e.g., box plots, violin plots, ridgeline plots, histograms) and provide Python (seaborn/matplotlib) pseudo-code or a short snippet that produces a clear comparative plot suitable for a product stakeholder.
Sample Answer
Direct answer
For comparing purchase-amount distributions across 5 customer segments, a violin plot (or a box plot if the audience is less statistically fluent) is generally the best default, since it supports compact side-by-side comparison of shape across all 5 groups at once; a ridgeline plot is a strong alternative when the shapes themselves (not just summary stats) are the main story and some visual "storytelling" flair is appropriate.
Structured elaboration
- Box plots: simplest to read for a non-technical audience, compact for 5 groups, but hide multimodality within a segment.
- Violin plots: recover the shape information a box plot hides, still compact enough for 5 groups; a good default when some of the audience may be unfamiliar with the format, pair with a brief one-line legend explaining how to read it.
- Ridgeline plots: stack each segment's density curve with a slight vertical offset, which reads very well visually for shape comparison across several groups but can visually imply a spurious ordering/ranking effect based on the arbitrary vertical stacking order, so order the ridgelines meaningfully (e.g. by median) rather than alphabetically.
- Histograms: fine for one segment at a time but don't overlay cleanly for 5 groups without becoming visually tangled; better suited to small multiples (one histogram per segment) than a single combined chart.
Worked example (executed, seeded and reproducible)
Simulated log-normal purchase amounts for 5 segments (A-E) with progressively higher typical order size, using a fixed random seed so the result below is exactly reproducible:
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
rng = np.random.default_rng(7)
segments = ['A', 'B', 'C', 'D', 'E']
mu_by_segment = [3.0, 3.1, 3.25, 3.45, 3.65]
rows = []
for seg, mu in zip(segments, mu_by_segment):
amounts = rng.lognormal(mean=mu, sigma=0.4, size=500)
rows.extend((seg, amt) for amt in amounts)
df = pd.DataFrame(rows, columns=['segment', 'purchase_amount'])
fig, ax = plt.subplots(figsize=(7, 4))
sns.violinplot(data=df, x='segment', y='purchase_amount', ax=ax, inner='quartile', cut=0)
ax.set_title('Purchase amount distribution by segment')
Running this code (verified by direct execution) produces segment medians of A: 19.3, B: 21.7, C: 25.2, D: 30.8, E: 38.5, confirming the increasing-magnitude pattern is visible both in the summary statistics and in the violin shapes. df has columns segment and purchase_amount; cut=0 prevents the violin from extending past the observed data range, which matters for a metric like purchase amount that can't go negative (the simulated minimum here is about 5.5, well above zero).
Trade-offs and pitfalls
A violin plot's smoothed density can visually suggest values (like negative purchase amounts) that don't actually occur in the data if the smoothing bandwidth isn't constrained; the cut=0 parameter used above is specifically there to prevent that misleading extension beyond the real data range.
Describe when to use a histogram, a box plot, and a violin plot to show a distribution. For each chart explain what aspects of the distribution it highlights (center, spread, skew, outliers, multimodality) and give an example business metric (e.g., order values, session duration) where each is most useful.
Sample Answer
Direct answer
Use a histogram for a quick, single-distribution read of shape (center, spread, skew, modality); use a box plot when the primary task is comparing the same distribution across several groups compactly (median, quartiles, and outliers, but not the detailed shape); and use a violin plot when you need both the compact multi-group comparison of a box plot AND a sense of the distribution's shape (multimodality) that a box plot alone hides.
Structured elaboration
- Histogram: best single-distribution tool for reading center, spread, skew, and multimodality directly from the bar shapes; harder to compare more than 2-3 groups side by side without them overlapping or needing separate small multiples.
- Box plot: compact summary (median, IQR, i.e. interquartile range, the range covering the middle 50% of the data from the 25th to the 75th percentile, whiskers, outlier points) that scales well to comparing many groups on one axis; the trade-off is it can completely hide multimodality (a box plot of a clearly bimodal distribution looks identical to a unimodal one with the same median and spread).
- Violin plot: combines a box plot's group-comparison compactness with a mirrored density curve showing the actual shape, revealing multimodality a box plot would hide, at the cost of being slightly less immediately familiar to a non-technical audience than a box plot.
- Business examples: order values (typically right-skewed with outliers) are well-served by a histogram for a single group, or a box plot/violin for comparing order-value distributions across customer segments; session duration (often multimodal, e.g. a cluster of very short bounce sessions plus a cluster of long engaged sessions) is a strong case for a violin plot over a plain box plot, since the box plot would hide that bimodality entirely.
Worked example
Comparing order-value distributions across 5 customer segments: a box plot quickly shows which segments have higher medians and wider spreads, but if segment C's order values are actually bimodal (many small orders plus a distinct cluster of bulk orders), only a violin plot reveals that structure, which matters if the team wants to treat those two behaviors differently.
Trade-offs and pitfalls
Relying on a box plot alone when the underlying distribution is meaningfully multimodal risks summarizing away exactly the pattern that matters most for the business decision at hand.
How should a dashboard handle missing or incomplete data in a metric? Describe both the visual convention (how you show missingness to the viewer) and the backend practice (imputation versus exclusion versus flagging), and when each is appropriate from a product-decision perspective.
Sample Answer
Direct answer
Handle missing or incomplete data on a dashboard with a clear visual convention (a distinct gap, hatch pattern, or explicit "no data" label, never silently interpolated as zero or omitted without a mark) paired with a deliberate backend choice (impute, exclude, or flag) made explicitly for the specific metric and business context, not a single default applied blindly everywhere.
Structured elaboration
- Visual convention: show a genuine gap in a line chart (a broken line, not one that connects straight through the missing period as if nothing happened), or a distinct visual marker (hatching, a "no data" label) on a bar or map, so missingness is never visually indistinguishable from a real zero value.
- Backend practice: exclusion: appropriate when the missing data is a small, random subset and excluding it doesn't bias the remaining aggregate; simplest and most transparent option when it's valid.
- Backend practice: imputation: appropriate when a reasonable estimate (e.g. carrying forward the last known value, or a model-based estimate) is genuinely useful for continuity, but must be clearly labeled as estimated wherever it's shown, since imputed values presented as real ones can silently mislead a downstream decision.
- Backend practice: flagging: showing the actual (possibly zero or partial) value alongside an explicit "incomplete data" flag, appropriate when even a partial number carries some signal but shouldn't be trusted as final.
- Choosing per product-decision context: for a metric feeding a high-stakes decision (e.g. a launch go/no-go), err toward exclusion or clear flagging over imputation, since a wrong imputed number could quietly bias that decision; for a lower-stakes trend view where continuity matters more than precision, a clearly-labeled imputation may be the more useful choice.
Worked example
A daily active-users chart tracking around 41,800 to 42,300 DAU has one day of missing data due to a tracking outage: DAU was 41,800 the day before the outage and 42,300 the day after, while the outage day itself recorded 0 rather than a real value. The chart shows a visible gap (a broken line, not a smooth interpolation connecting 41,800 straight to 42,300 as if nothing happened, and not a misleading drop to 0) with a "data unavailable Jun 14" annotation, while a separate lower-stakes weekly-trend view chooses to carry forward the prior day's value of 41,800 as an explicitly labeled estimate ("estimated, carried forward") to preserve visual continuity for that specific use case.
Trade-offs and pitfalls
Silently interpolating or zero-filling missing data without any visual or textual indication is the most damaging choice here, since it makes a real data gap indistinguishable from either a genuine trend or a genuine zero, actively hiding a data-quality problem from the viewer.
Unlock Full Question Bank
Get access to all Data Visualization and Dashboard Design interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.