Technology Evaluation and Vendor Management Questions
Selecting and integrating third-party technology: evaluating tools and platforms, vendor and technology assessment, procurement, and managing implementation and integration projects. Covers structured buy-versus-build and vendor-selection reasoning and running the resulting implementation.
You have a CDC log table cdc_log(event_id, table_name, op_type, pk_values text, event_ts) and a target table customers(id, name, email, updated_at). Write SQL queries to detect (a) events applied in cdc_log with no matching change in target, (b) duplicate application of the same event_id, and (c) event ordering issues where an earlier event arrives after a later event causing out-of-order updates. Describe how you would reconcile and repair mismatches.
Sample Answer
Approach summary: treat each CDC row as authoritative source-of-change with event_ts ordering. For an event to be “applied” the target row must reflect the change (matching values) and have updated_at >= event_ts. Below are example queries (Postgres-flavored) and reconciliation steps.
(a) Events recorded in cdc_log but not reflected in customers
- Assumption: cdc_log.pk_values contains "id=123" (adjust parser per your format). cdc_log also contains new payload columns (or we infer expected values). Here I show detection by updated_at and presence of the row.
-- parse id from pk_values (example format: "id=123")
WITH cdc AS (
SELECT
event_id,
table_name,
op_type,
(regexp_replace(pk_values, '.*id=(\d+).*', '\1'))::bigint AS id,
event_ts
FROM cdc_log
WHERE table_name = 'customers'
)
-- events where target row is missing or target.updated_at is older than event_ts
SELECT c.event_id, c.id, c.op_type, c.event_ts
FROM cdc c
LEFT JOIN customers t ON t.id = c.id
WHERE
-- missing row for insert/update/delete
t.id IS NULL
OR t.updated_at < c.event_ts
ORDER BY c.event_ts DESC;
If you have the expected payload in cdc_log (e.g., new_name, new_email), also compare field equality:
-- example when cdc_log has new_name and new_email columns
SELECT c.event_id, c.id
FROM cdc_log c
LEFT JOIN customers t ON t.id = c.id
WHERE (c.table_name='customers')
AND (
t.id IS NULL
OR t.name <> c.new_name
OR t.email <> c.new_email
OR t.updated_at < c.event_ts
);
(b) Duplicate application of the same event_id
- Detect duplicate event_id rows in cdc_log (possible replay) and detect if multiple state changes applied in target corresponding to same event_id (e.g., same updated_at or same change reapplied).
-- duplicates in cdc_log ingestion
SELECT event_id, COUNT(*) AS cnt
FROM cdc_log
GROUP BY event_id
HAVING COUNT(*) > 1;
-- duplicates resulting in multiple target changes:
-- find customers rows where same event_id appears multiple times in audit history table (if you have audit log)
-- if you don't have audit, detect same event_id causing no-op reapply (updated_at equal to event_ts multiple times)
SELECT c.event_id, c.id, COUNT(*) AS applied_count
FROM cdc_log c
JOIN customers t ON t.id = (regexp_replace(c.pk_values, '.*id=(\d+).*', '\1'))::bigint
WHERE c.table_name='customers' AND t.updated_at = c.event_ts
GROUP BY c.event_id, c.id
HAVING COUNT(*) > 1;
(c) Event ordering issues (out-of-order updates)
- Detect when a later event_ts was applied but an earlier event exists that arrived after and would overwrite prior state if applied now — i.e., a cdc_log row with event_ts < current customers.updated_at but whose change is not reflected (or applied after).
Query 1: find cdc events where event_ts < current updated_at but target does not match event payload (indicating the later event applied, earlier event possibly applied late or not applied):
WITH cdc AS (
SELECT
event_id,
(regexp_replace(pk_values, '.*id=(\d+).*', '\1'))::bigint AS id,
op_type, event_ts, new_name, new_email
FROM cdc_log
WHERE table_name='customers'
)
SELECT c.event_id, c.id, c.event_ts, t.updated_at, t.name, t.email
FROM cdc c
LEFT JOIN customers t ON t.id = c.id
WHERE t.updated_at IS NOT NULL
AND c.event_ts < t.updated_at
AND (
-- expected payload from earlier event differs from current target state
(c.new_name IS NOT NULL AND c.new_name <> t.name)
OR (c.new_email IS NOT NULL AND c.new_email <> t.email)
OR (c.op_type = 'DELETE' AND t.id IS NOT NULL) -- delete arrived late but row still exists
)
ORDER BY c.id, c.event_ts;
Query 2: detect sequence inversion in cdc_log itself (for same id, an event with larger event_ts logged before smaller event_ts)
- If you have ingestion sequence (ingest_ts, log_id), detect when ingest order differs from event_ts order:
-- assume cdc_log has ingest_ts
WITH seq AS (
SELECT
event_id,
(regexp_replace(pk_values, '.*id=(\d+).*', '\1'))::bigint AS id,
event_ts, ingest_ts
FROM cdc_log
WHERE table_name='customers'
)
SELECT s1.id, s1.event_id AS later_event, s1.event_ts AS later_ts, s1.ingest_ts AS later_ingest,
s2.event_id AS earlier_event, s2.event_ts AS earlier_ts, s2.ingest_ts AS earlier_ingest
FROM seq s1
JOIN seq s2 ON s1.id = s2.id AND s1.event_ts > s2.event_ts
-- but later event ingested before earlier event => ordering problem
WHERE s1.ingest_ts < s2.ingest_ts
ORDER BY s1.id, s1.event_ts DESC;
Reconciliation and repair strategy
- Preventive: make CDC idempotent and ordered at consumer (apply events by event_ts per primary key; use event_id dedupe).
- Audit: capture ingest_ts and maintain an applied_events table(event_id, applied_ts, status).
- Reconciliation steps:
- For each missing/unapplied event, reapply the event deterministically using an idempotent UPSERT/DELETE based on op_type and payload. Use a transaction and record applied_events to avoid double-apply.
- Example idempotent SQL (Postgres):
- For each missing/unapplied event, reapply the event deterministically using an idempotent UPSERT/DELETE based on op_type and payload. Use a transaction and record applied_events to avoid double-apply.
-- reapply update/insert idempotently
INSERT INTO customers (id, name, email, updated_at)
VALUES (:id, :name, :email, :event_ts)
ON CONFLICT (id) DO UPDATE
SET name = EXCLUDED.name,
email = EXCLUDED.email,
updated_at = GREATEST(customers.updated_at, EXCLUDED.updated_at);
- For duplicates: mark extra cdc_log rows as deduplicated in an audit table; only apply first successful event_id; if duplicates caused repeated state mutations, re-evaluate final desired state and reapply correct idempotent operation.
- For out-of-order: for each affected id, fetch all CDC events, sort by event_ts, and replay them in-order against a “staging” copy of the row, then write final state to customers with updated_at set to max(event_ts). Use transactional replay or batch job:
- Steps: lock row, compute final state by ordered application, upsert final state, record applied_event_ids with applied_ts.
- Logging & monitoring: record who/when reconciled, create alerts for thresholds (e.g., >100 mismatches), add periodic reconciliation job.
- Root cause: fix ingestion (ensure ordering guarantees, use watermarking, queue ordering or Kafka with key-partitioning), and improve schema (include event_id, event_ts, source_tx_id) to make repair deterministic.
Key points:
- Always apply CDC idempotently (use event_id dedupe and GREATEST(updated_at, event_ts)).
- Reconciliation should be careful with deletes and GDPR/immutability requirements—keep audit trail.
- Automate periodic reconciliation and keep small manual remediation for complex conflicts.
Create a test plan to validate the accuracy of migrated KPIs and dashboards before go-live. Include test categories (unit, integration, regression, user acceptance), example test cases for metric reconciliation, acceptance criteria, sample test data strategies, responsibilities, and ideas for automating these tests for frequent deployments.
Sample Answer
Overview: This test plan validates KPI and dashboard accuracy after migration (ETL, semantic layer, BI tool) before go-live. It covers unit, integration, regression, and UAT, with reconciliation test cases, acceptance criteria, test data approaches, responsibilities, and automation ideas for frequent deployments.
Test categories & focus
- Unit tests: validate ETL transformations, aggregation logic, date handling, filters at component level.
- Integration tests: end-to-end data flow (source → staging → warehouse → semantic layer → dashboard).
- Regression tests: compare critical KPIs/dashboards to baseline after changes.
- User Acceptance Testing (UAT): business sign-off on semantics, visuals, drill paths, and edge cases.
Example test cases (metric reconciliation)
- Row-count parity: compare source transactional rows vs. loaded rows after filtering. Acceptance: counts match expected business filters (±0%).
- Sum/aggregation check: for Sales Amount, compute SUM(sales) in source and compare to warehouse and dashboard aggregated value. Acceptance: values identical or within agreed rounding tolerance (e.g., 0.01%).
- Group-by reconciliation: compare top-N by region in source vs. BI. Acceptance: top 10 lists identical.
- Temporal alignment: monthly totals in source (based on transaction_date) match dashboard time buckets. Acceptance: same totals and periods.
- Null/late-arriving handling: verify NULLs, late events handled per spec. Acceptance: flagged rows count equals expectation.
- Filter/drill validation: applying region filter yields same subset as source query. Acceptance: subset matches.
Acceptance criteria (global)
- Critical KPIs match source/warehouse within tolerance defined per metric (usually 0% for monetary sums; up to 0.1% for floating aggregations).
- Visuals render correctly (labels, units, date granularity).
- Performance: dashboards load within SLA (e.g., <5s for executive pages).
- No data loss for last 90 days (or defined window).
- Business owners sign UAT checklist.
Sample test data strategies
- Synthetic data: generate controlled transactions to verify transformations (edge cases: zero amounts, negative refunds, out-of-range dates).
- Snapshot baseline: take pre-migration snapshots of source and warehouse for regression comparison.
- Masked production-like data: anonymize production extracts to validate scale and distributions.
- Time-window slices: test historical, incremental, and backfill scenarios.
Responsibilities
- BI Analyst: define KPI specs, create test cases, perform dashboard-level reconciliation, lead UAT with stakeholders.
- Data Engineer: unit & integration tests for ETL, provide test extracts, implement fixes.
- QA/Data QA: run reconciliation suites, automate comparisons, report defects.
- Product/Business Owner: review UAT results, approve acceptance.
- Release Manager: coordinate deployments and test runs.
Automation ideas for frequent deployments
- Create SQL-based reconciliation scripts that produce diff reports (row counts, sums, group-by) and fail CI when thresholds exceeded.
- Store baseline snapshots in a test schema and run automated comparisons in CI (e.g., GitLab CI, Jenkins) post-deploy to dev/staging.
- Use dbt tests for data quality (uniqueness, not_null, accepted_range) and custom assertions for KPI thresholds.
- Integrate BI tool APIs (Tableau/Power BI) to extract rendered values for automated UI checks (or use headless browsers for visual tests).
- Schedule nightly regression runs and alert on anomalies; store results in dashboard for test health tracking.
- Use parameterized test data factories to run edge-case scenarios in automation.
Reporting & exit criteria
- Generate a reconciliation report summarizing all test cases, diffs, and signatures.
- Exit to go-live only when all critical KPI tests pass, UAT signed off, and open defects are non-blocking with mitigation.
This plan balances technical validation and business acceptance while enabling repeatable automated checks for ongoing deployments.
Design a cross-functional 'BI Champion' program to accelerate adoption of a new analytics platform. Define champion selection criteria, responsibilities, incentives, training cadence, escalation path, and metrics to evaluate program effectiveness for the first 6 months.
Sample Answer
Objective: accelerate platform adoption, create trusted local experts, and surface feedback to improve product/UX and reporting quality.
Champion selection criteria:
- 1–2 per major function (Sales, Ops, Finance, Product, Customer Success) — 8–12 total
- Regular BI consumers with influence, medium technical aptitude (comfortable with SQL/ETL + tool), curiosity, and willingness to coach peers
- Manager endorsement + 3-month track record of data-driven decisions
Responsibilities:
- Serve as first-line support and internal evangelist: run office hours, create 1–2 role-specific templates, triage questions, gather feature requests
- Validate/report catalog items for their team; mentor 2–4 power-users
- Participate weekly sync with BI team; report adoption blockers and dataset/metric issues
Incentives:
- Quarterly visibility (present in leadership demo), small stipend or training budget, “BI Champion” badge on org directory, career development credit + possible bonus tied to adoption KPIs
Training cadence (first 6 months):
- Month 0: 2-day intensive onboarding (platform, governance, dataset catalogue, sample builds)
- Weeks 1–12: Weekly 1-hr workshops (advanced visualization, performance tuning, governance)
- Months 4–6: Biweekly advanced clinics + monthly cross-champion community of practice
Escalation path:
- Champion → BI Analyst on duty (SLAs: <24h for triage) → BI Product Owner (bugs/feature requests prioritized weekly) → Data Engineering for infra/issues (SLA 72h for critical)
Metrics (track weekly/monthly; report at months 1,3,6):
- Adoption: active users (DAU/MAU) in champion teams, dashboards viewed per user
- Productivity: time-to-insight (avg time from request to usable report), % self-serve requests
- Quality: number of data incidents reported vs resolved, catalog completeness
- Engagement: number of office hours held, templates created, champion NPS
Targets for 6 months: 50% increase in active users in pilot teams, 30% of reports self-serve, resolution SLA met 90% of time, champion NPS > 7/10.
Learning loop: monthly retros, update training and incentives based on metrics and qualitative feedback.
Design a monitoring dashboard and alerting plan for BI platform health. Define the key health metrics to show (ETL lag, failed jobs, query latency percentiles, dashboard load times, active users, dataset freshness), recommended alert thresholds and escalation flow, sample queries or SQL needed to compute these metrics, and runbook steps for investigators.
Sample Answer
Requirements & goals:
- Provide an at-a-glance dashboard tracking BI platform health for stakeholders (BI analysts, data engineers, SREs, product owners).
- Fast detection of data delays, failures, performance regressions, and usage trends.
- Automated alerts with clear escalation and runbooks for triage.
Key metrics to display (widgets + short description):
- ETL lag (per-pipeline): max/min/median and 95th percentile of delay between source event time and dataset update time.
- Failed jobs: count & recent failure list (last 24h), failure rate %
- Query latency percentiles: p50/p95/p99 per workspace/dashboard/user segment
- Dashboard load times: average and percentiles, plus 95th by dashboard
- Active users: DAU/WAU/MAU and concurrent sessions
- Dataset freshness: last_updated timestamp per dataset, freshness SLA compliance %
Recommended alert thresholds & severity:
- SEV1 (page): ETL lag > 4× SLA or > 4 hours for critical datasets; failed jobs > 5 within 15m; p99 query latency > 30s for production dashboards; dashboard load time p95 > 10s.
- SEV2 (notify + Slack): ETL lag 2× SLA or > 60m; failed jobs 2–5 in 30m; p95 query latency > 10s; dataset freshness breach for non-critical within 24h.
- SEV3 (email/digest): small degradations, rising trends (week-over-week +30%).
Escalation flow:
- Alert triggers → PagerDuty to on-call BI owner (SEV1) + Slack #data-ops.
- 15 min no ack → escalate to Data Engineering lead.
- 30 min unresolved → Eng Manager + SRE.
- Post-incident: blameless postmortem, ticket in Jira, notify stakeholders.
Sample SQLs (assume tables jobs(job_id,status,start_ts,end_ts,pipeline,dataset), queries(query_id,user,started_at,finished_at,duration_ms,dashboard_id), datasets(name,last_updated)):
-- ETL lag per pipeline (minutes)
SELECT pipeline,
MAX(EXTRACT(EPOCH FROM (NOW() - last_updated)))/60 AS lag_minutes,
PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY EXTRACT(EPOCH FROM (NOW()-last_updated))/60) AS p95_lag
FROM datasets
GROUP BY pipeline;
-- Failed jobs in last 24h
SELECT pipeline, COUNT(*) AS failures
FROM jobs
WHERE status = 'FAILED' AND end_ts >= NOW() - INTERVAL '24 hours'
GROUP BY pipeline
ORDER BY failures DESC;
-- Query latency percentiles per dashboard in last 1h
SELECT dashboard_id,
PERCENTILE_CONT(0.50) WITHIN GROUP (ORDER BY duration_ms) AS p50_ms,
PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY duration_ms) AS p95_ms,
PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY duration_ms) AS p99_ms
FROM queries
WHERE started_at >= NOW() - INTERVAL '1 hour'
GROUP BY dashboard_id;
-- Dashboard load time p95 and slow sessions
SELECT dashboard_id,
PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY duration_ms) AS p95_load_ms,
COUNT(*) FILTER (WHERE duration_ms > 10000) AS slow_loads
FROM dashboard_loads
WHERE ts >= NOW()-INTERVAL '1 hour'
GROUP BY dashboard_id;
Runbook steps for investigators (ordered checklist):
- Acknowledge alert, record time and alert details.
- Identify scope: which dataset/dashboard/pipeline affected; check recent deploys/PRs.
- Check job logs: open last failed job logs (jobs table + underlying orchestration UI: Airflow/DBT).
- Validate data: sample raw source vs dataset to confirm missing or late records.
- Query performance: run explain plans and current running queries on warehouse; check resource saturation (CPU, slots, concurrency).
- For ETL lag: restart failing tasks if transient; re-run backfill for missed windows; estimate data completeness impact and notify stakeholders with ETA.
- For slow dashboards: check query text generated by BI tool, add indexes/materialized views, cache results, reduce dashboard widgets or enable query caching.
- If infrastructure issue: escalate to SRE (include job ids, query ids, timestamps).
- Post-resolution: document root cause, fixes, timeline, mitigation, reopen tickets for long-term improvements.
Best practices & notes:
- Tag metrics by environment (prod/stage) and dataset criticality.
- Correlate alerts (e.g., warehouse CPU spike + many ETL failures).
- Maintain SLA catalog per dataset to drive appropriate thresholds.
- Implement alert suppression during known maintenance windows and add runbook links into alert payloads for faster triage.
Outline SQL queries and the analytic approach you would use to perform cohort analysis and retention curves to measure BI tool adoption. Assume you have events table(user_id, event_type, event_ts) and users(user_id, signup_date). Describe cohort definition, retention computation, visualization approach, and interpretation of common patterns.
Sample Answer
Cohort definition
- Use signup_date as cohort (weekly or monthly). Cohort_key = DATE_TRUNC('week', signup_date) or DATE_TRUNC('month', signup_date).
- Cohorts grouped by users who signed up in the same cohort window.
Step 1 — user cohort assignment
-- assign each user to a signup cohort (week)
SELECT
user_id,
signup_date,
DATE_TRUNC('week', signup_date)::date AS cohort_week
FROM users;
Step 2 — retention events normalized to cohort-relative periods
WITH cohorts AS (
SELECT user_id, DATE_TRUNC('week', signup_date)::date AS cohort_week
FROM users
),
events_in_period AS (
SELECT
e.user_id,
c.cohort_week,
DATE_TRUNC('week', e.event_ts)::date AS event_week
FROM events e
JOIN cohorts c USING (user_id)
WHERE e.event_type = 'use_tool' -- define adoption event(s)
),
user_weeks AS (
SELECT DISTINCT user_id, cohort_week, event_week
FROM events_in_period
),
retention AS (
SELECT
cohort_week,
(event_week - cohort_week)/7 AS week_number, -- integer weeks since signup
COUNT(DISTINCT user_id) AS active_users
FROM user_weeks
GROUP BY 1,2
),
cohort_sizes AS (
SELECT cohort_week, COUNT(DISTINCT user_id) AS cohort_size
FROM cohorts
GROUP BY 1
)
SELECT
r.cohort_week,
r.week_number,
r.active_users,
cs.cohort_size,
ROUND(100.0 * r.active_users / cs.cohort_size, 2) AS retention_pct
FROM retention r
JOIN cohort_sizes cs USING (cohort_week)
ORDER BY cohort_week, week_number;
Key choices & reasoning
- event_type selection: adoption could be any meaningful event (open app, run query, share report). Be explicit.
- Period granularity: weekly recommended for BI tools; monthly for longer lifecycles.
- Use DISTINCT user_id so multiple events in a period count once.
Visualization approach
- Retention table -> heatmap (cohort on y-axis, week_number on x-axis, color = retention_pct). This quickly shows decay and long-term engagement.
- Retention curve: pick a cohort and plot retention_pct over time (line chart) to compare cohorts.
- Sticky metric: compute DAU/WAU/MAU and weeks-to-second-week retention.
- Funnel overlay: conversion from signup -> activation (first meaningful event) -> retained at 1/4/12 weeks.
Interpretation of common patterns
- Rapid drop then long tail: typical; means many try once, a subset become power users.
- High week-1 but steep decline: good onboarding but poor long-term value or missing features.
- Improving retention across cohorts: product changes/marketing improved engagement.
- Declining newer cohorts: onboarding regressions or product-market mismatch in newer segments.
- Flat low retention: fundamental product fit issue.
Edge cases & validation
- Exclude test accounts; handle timezone and midnight cutoffs; account for users with later first event than signup (activation window).
- Consider survival analysis / Kaplan-Meier for censored data if users churn unknown.
- Add segmentation (plan, source, region) to identify drivers and prioritize interventions.
Unlock Full Question Bank
Get access to all 44 Technology Evaluation and Vendor Management interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.