More in AI & ML — page 7
Explain false positives and negatives for churn
WHAT IT TESTS: translating errors into business cost. OUTLINE: false positive flags a loyal customer (wasted incentive), false negative misses a leaver (lost customer), tie to threshold choice.
Catalyst Optimizer and Project Tungsten in Spark
WHAT IT TESTS: knowledge of Spark SQL internals. OUTLINE: Catalyst transforms logical plans with rules, picks physical plans by cost; Tungsten optimizes execution with off-heap memory and codegen.
Primary metric up, guardrail down: ship or not?
WHAT IT TESTS: handling metric trade-offs. OUTLINE: tie metrics to business value, weigh short-term lift against retention damage, use guardrails and an overall evaluation criterion.
Handle source schema changes without downtime
WHAT IT TESTS: schema-evolution strategy. OUTLINE: add columns as nullable additive changes, version the schema, use formats like Iceberg or Parquet that support evolution, backfill new types safely. RED FLAG: an in-place destructive ALTER that breaks readers.
Design a SQL upsert from a staging table
WHAT IT TESTS: knowledge of idempotent loads. OUTLINE: define a stable key, use MERGE or INSERT ON CONFLICT, dedupe the staging set first, run in a transaction. RED FLAG: a naive INSERT that duplicates or a delete-then-insert race.
Explain KNN or MICE imputation principles
WHAT IT TESTS: understanding that imputation should preserve correlations. OUTLINE: KNN borrows from similar rows, MICE models each variable from the others iteratively and creates multiple datasets. RED FLAG: treating all imputation as filling means.
When should you keep outliers, not drop them?
WHAT IT TESTS: judgment about when outliers are signal. OUTLINE: keep them in fraud or anomaly detection, use robust models and metrics. RED FLAG: blindly deleting anything beyond three standard deviations.
pandas .apply() versus vectorized operations
WHAT IT TESTS: pandas performance literacy. OUTLINE: apply runs a Python function per row or column, flexible but slow due to per-element looping; prefer vectorized ops; use apply only for custom logic with no vectorized equivalent.
Risks of optimizing recommendations only for CTR
WHAT IT TESTS: metric design and Goodhart's law. OUTLINE: CTR-only invites clickbait, low satisfaction, and long-term churn; add counter-metrics like dwell time, satisfaction, retention, and diversity.
Federated learning architecture, risks, and defenses
WHAT IT TESTS: privacy-preserving distributed training. OUTLINE: devices train locally and send updates not data, a server aggregates; gradients still leak, enabling inversion or membership inference; defend with secure aggregation and DP.
Differential privacy, epsilon, and noisy aggregates
WHAT IT TESTS: rigorous privacy guarantees. OUTLINE: define DP as bounded output change when one record is added or removed, explain epsilon as the privacy-accuracy knob, add calibrated noise scaled to sensitivity.
k-anonymity and its limits against linkage attacks
WHAT IT TESTS: anonymization fundamentals. OUTLINE: define k-anonymity via indistinguishable quasi-identifier groups, apply generalization and suppression, then show homogeneity or linkage attacks break it.
Right to be forgotten and machine unlearning
WHAT IT TESTS: deletion in trained models. OUTLINE: delete raw data everywhere, then remove influence via full retraining, SISA sharded retraining, or approximate unlearning; note cost and verification.
Quantifying performance disparity across subgroups
WHAT IT TESTS: fairness evaluation beyond accuracy. OUTLINE: compute per-group precision, recall, FPR, FNR, compare via fairness metrics; visualize with grouped bars or per-group confusion matrices. RED FLAG: trusting one global accuracy number.
Programmatically detect and redact PII in text
WHAT IT TESTS: PII handling in text pipelines. OUTLINE: regex for structured PII plus NER for names and places, redact or tokenize, then validate recall. RED FLAG: relying on regex alone or trusting one pass without measuring misses.
Minimizing model prediction latency end to end
WHAT IT TESTS: latency optimization across layers. OUTLINE: shrink the model via quantization, pruning, distillation, compilation; cut infra latency via caching, edge, faster runtimes. RED FLAG: only buying bigger hardware or ignoring accuracy tradeoffs.
Zero-downtime model updates with blue-green or canary
WHAT IT TESTS: safe rollout design. OUTLINE: blue-green swaps full traffic after validation, canary ramps a small slice; both need health, latency, and quality monitoring plus instant rollback. RED FLAG: only watching system metrics, not model quality.
Why version data and model artifacts, not just code
WHAT IT TESTS: reproducibility discipline. OUTLINE: code alone cannot reproduce a model; data and artifact versioning enable rollback, debugging, audit. RED FLAG: thinking Git on code suffices, or ignoring rollback and regulatory traceability.
CPU versus GPU serving: cost, latency, throughput
WHAT IT TESTS: inference hardware tradeoffs. OUTLINE: GPUs win on throughput for batched parallel work but cost more; CPUs suit low-volume or small models. RED FLAG: claiming GPU is always faster or ignoring batching and utilization.
ML CI/CD versus traditional software CI/CD
WHAT IT TESTS: MLOps pipeline understanding. OUTLINE: validates code plus data plus the model, auto-trains and evaluates, adds continuous training and monitoring. RED FLAG: describing only code CI/CD and ignoring data, model gates, and retraining.