Code Room
Vibe codingHardvc-g397
Subject Ai code comprehensionLevel Senior–Staff~19 minCommon in Algorithms & data structures interviewsIndustries Software development, Technology

Question

You ask an AI to explain this Rust config loader before wiring it into a long-running server. The agent says: "It gracefully loads config and returns a Result, so any parse error or missing file propagates to the caller for handling — no way it can crash the process." Is that explanation accurate, and how do you verify the no-crash claim before depending on it in a service that must stay up?

rust
fn load_config(path: &str) -> Result<Config, ConfigError> {    let text = std::fs::read_to_string(path).unwrap();    let cfg: Config = serde_json::from_str(&text).expect("valid config");    Ok(cfg)}
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it — tests, edge cases, reading critically — and how you’d re-prompt or decompose to get it right.

Describe your solution

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.