Production Readiness and Professional Standards Questions
Addresses the engineering expectations and practices that make software safe and reliable in production and reflect professional craftsmanship. Topics include writing production suitable code with robust error handling and graceful degradation, attention to performance and resource usage, secure and defensive coding practices, observability and logging strategies, release and rollback procedures, designing modular and testable components, selecting appropriate design patterns, ensuring maintainability and ease of review, deployment safety and automation, and mentoring others by modeling professional standards. At senior levels this also includes advocating for long term quality, reviewing designs, and establishing practices for low risk change in production.
Sample Answer
Sample Answer
Sample Answer
def validate_feature_vector(fv: dict) -> (bool, list):
"""
Validate a feature vector dict.
Returns (is_valid, error_codes_list).
Error codes: MISSING_<KEY>, TYPE_<KEY>, RANGE_<KEY>, MISSING_HEADER, HEADER_NOT_TRUSTED
"""
errors = []
# required keys and expected types
required = {
"user_id": str,
"timestamp": (int, float),
"features": dict, # nested map of numeric features
"model_version": str,
}
# numeric ranges for particular features (min, max)
feature_ranges = {
"click_rate": (0.0, 1.0),
"session_length": (0.0, 36000.0), # seconds
"age": (0, 120),
}
# header flag indicating trusted ingestion
header = fv.get("headers", {})
if not header:
errors.append("MISSING_HEADER")
elif header.get("trusted") is not True:
errors.append("HEADER_NOT_TRUSTED")
# top-level required & types
for k, expected in required.items():
if k not in fv:
errors.append(f"MISSING_{k.upper()}")
continue
if not isinstance(fv[k], expected):
errors.append(f"TYPE_{k.upper()}")
# features presence/type/range checks
feats = fv.get("features")
if isinstance(feats, dict):
for fname, (lo, hi) in feature_ranges.items():
if fname not in feats:
errors.append(f"MISSING_FEATURE_{fname.upper()}")
continue
val = feats[fname]
if not isinstance(val, (int, float)):
errors.append(f"TYPE_FEATURE_{fname.upper()}")
continue
if not (lo <= float(val) <= hi):
errors.append(f"RANGE_FEATURE_{fname.upper()}")
else:
# if features missing/type already flagged, avoid duplicate
if "TYPE_FEATURES" not in errors:
errors.append("TYPE_FEATURES")
return (len(errors) == 0, errors)Sample Answer
Sample Answer
Unlock Full Question Bank
Get access to hundreds of Production Readiness and Professional Standards interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.