[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"me":3,"catalog:en:backend\u002Frs-error-handling-result-option":4,"config":274},null,{"field_key":5,"field_name":6,"seniority":7,"topic_key":8,"topic_name":9,"spec_key":7,"spec_name":7,"locale":10,"cell_total":11,"field_total":12,"seniorities":13,"topics":17,"specs":166,"samples":189},"backend","Backend","","rs-error-handling-result-option","Rs Error Handling Result Option","en",75,3750,[14,15,16],"junior","mid","senior",[18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,151,154,157,160,163],{"key":19,"name":20,"count":11},"api-design","API Design",{"key":22,"name":23,"count":11},"caching","Caching",{"key":25,"name":26,"count":11},"concurrency","Concurrency",{"key":28,"name":29,"count":11},"csharp-concurrency-async","Csharp Concurrency Async",{"key":31,"name":32,"count":11},"csharp-exceptions","Csharp Exceptions",{"key":34,"name":35,"count":11},"csharp-generics-interfaces","Csharp Generics Interfaces",{"key":37,"name":38,"count":11},"csharp-memory-performance","Csharp Memory Performance",{"key":40,"name":41,"count":11},"csharp-stdlib-http","Csharp Stdlib Http",{"key":43,"name":44,"count":11},"csharp-testing-tooling","Csharp Testing Tooling",{"key":46,"name":47,"count":11},"databases-sql","Databases \u002F SQL",{"key":49,"name":50,"count":11},"go-concurrency","Go Concurrency",{"key":52,"name":53,"count":11},"go-errors","Go Errors",{"key":55,"name":56,"count":11},"go-interfaces-generics","Go Interfaces Generics",{"key":58,"name":59,"count":11},"go-memory-performance","Go Memory Performance",{"key":61,"name":62,"count":11},"go-stdlib-http","Go Stdlib Http",{"key":64,"name":65,"count":11},"go-testing-tooling","Go Testing Tooling",{"key":67,"name":68,"count":11},"java-concurrency","Java Concurrency",{"key":70,"name":71,"count":11},"java-exceptions","Java Exceptions",{"key":73,"name":74,"count":11},"java-generics-interfaces","Java Generics Interfaces",{"key":76,"name":77,"count":11},"java-memory-jvm","Java Memory Jvm",{"key":79,"name":80,"count":11},"java-stdlib-http","Java Stdlib Http",{"key":82,"name":83,"count":11},"java-testing-tooling","Java Testing Tooling",{"key":85,"name":86,"count":11},"messaging-queues","Messaging \u002F Queues",{"key":88,"name":89,"count":11},"networking-http","Networking \u002F HTTP",{"key":91,"name":92,"count":11},"nodejs-error-handling","Nodejs Error Handling",{"key":94,"name":95,"count":11},"nodejs-event-loop-async","Nodejs Event Loop Async",{"key":97,"name":98,"count":11},"nodejs-memory-performance","Nodejs Memory Performance",{"key":100,"name":101,"count":11},"nodejs-modules-streams","Nodejs Modules Streams",{"key":103,"name":104,"count":11},"nodejs-stdlib-http","Nodejs Stdlib Http",{"key":106,"name":107,"count":11},"nodejs-testing-tooling","Nodejs Testing Tooling",{"key":109,"name":110,"count":11},"php-concurrency-async","Php Concurrency Async",{"key":112,"name":113,"count":11},"php-exceptions","Php Exceptions",{"key":115,"name":116,"count":11},"php-generics-interfaces","Php Generics Interfaces",{"key":118,"name":119,"count":11},"php-memory-performance","Php Memory Performance",{"key":121,"name":122,"count":11},"php-stdlib-http","Php Stdlib Http",{"key":124,"name":125,"count":11},"php-testing-tooling","Php Testing Tooling",{"key":127,"name":128,"count":11},"python-concurrency-async","Python Concurrency Async",{"key":130,"name":131,"count":11},"python-errors-context","Python Errors Context",{"key":133,"name":134,"count":11},"python-memory-performance","Python Memory Performance",{"key":136,"name":137,"count":11},"python-stdlib-http","Python Stdlib Http",{"key":139,"name":140,"count":11},"python-testing-tooling","Python Testing Tooling",{"key":142,"name":143,"count":11},"python-typing-oop","Python Typing Oop",{"key":145,"name":146,"count":11},"rs-async-runtime-futures","Rs Async Runtime Futures",{"key":148,"name":149,"count":11},"rs-concurrency-send-sync","Rs Concurrency Send Sync",{"key":8,"name":9,"count":11},{"key":152,"name":153,"count":11},"rs-memory-smart-pointers-unsafe","Rs Memory Smart Pointers Unsafe",{"key":155,"name":156,"count":11},"rs-ownership-borrowing-lifetimes","Rs Ownership Borrowing Lifetimes",{"key":158,"name":159,"count":11},"rs-traits-generics-dispatch","Rs Traits Generics Dispatch",{"key":161,"name":162,"count":11},"security","Security",{"key":164,"name":165,"count":11},"testing","Testing",[167,171,174,177,180,183,186],{"key":168,"name":169,"count":170},"csharp","C#\u002F.NET",450,{"key":172,"name":173,"count":170},"go","Go",{"key":175,"name":176,"count":170},"java","Java",{"key":178,"name":179,"count":170},"nodejs","Node.js",{"key":181,"name":182,"count":170},"php","PHP",{"key":184,"name":185,"count":170},"python","Python",{"key":187,"name":188,"count":170},"rust","Rust",[190,208,222,235,248,261],{"id":191,"topic":9,"difficulty":192,"body":193,"options":194,"correct_key":199,"explanation":207},"01a0608e-d2c8-7528-840a-87f967a525d8",1,"```rust\nfn save() -> Result\u003C(), String> {\n    Err(\"disk full\".to_string())\n}\n\nfn main() {\n    save();\n    println!(\"done\");\n}\n```\nWhat happens when this is built and run with `cargo run`?",[195,198,201,204],{"key":196,"text":197},"a","Compilation stops: a `Result` returned by `save()` has to be matched or propagated with `?`",{"key":199,"text":200},"b","It compiles, since an unused `Result` is only a warning, then prints `done`",{"key":202,"text":203},"c","It compiles cleanly and panics at runtime with the message `disk full`",{"key":205,"text":206},"d","It compiles cleanly and prints `done`; ignoring a `Result` is silent in Rust","`Result` is marked `#[must_use]`, so dropping one without inspecting it produces the warning `unused Result that must be used`. A warning is not an error: the binary builds, `save()` runs, its `Err` value is discarded, and `done` is printed. Nothing panics, because an `Err` value only panics if you call `unwrap`\u002F`expect` on it.",{"id":209,"topic":9,"difficulty":210,"body":211,"options":212,"correct_key":205,"explanation":221},"01a0608e-d2c9-76ff-85d8-9a1966c8b067",2,"```rust\nfn first(v: &[i32]) -> Result\u003Ci32, String> {\n    let x = v.first()?;\n    Ok(*x)\n}\n```\nWhat does the compiler say about this function?",[213,215,217,219],{"key":196,"text":214},"It compiles; `?` on an `Option` inside a `Result` function converts `None` into `Err(String::new())`",{"key":199,"text":216},"It compiles; `?` returns `Err(\"None\".to_string())` when the slice is empty",{"key":202,"text":218},"It fails with E0308 because `v.first()` returns `Option\u003C&i32>` while `x` is used as `i32`",{"key":205,"text":220},"It fails with E0277: `?` cannot be used on an `Option` in a function that returns `Result`","The `?` operator is tied to the return type of the enclosing function. In a function returning `Result`, `?` accepts only `Result` values; applying it to `v.first()` (an `Option\u003C&i32>`) yields E0277 with the message \"the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`\". The fix is `v.first().ok_or_else(|| \"empty\".to_string())?`. Rust never invents an error value from `None`.",{"id":223,"topic":9,"difficulty":192,"body":224,"options":225,"correct_key":196,"explanation":234},"01a0608e-d2ca-7f22-aed1-ca0ed4a05def","```rust\nfn main() {\n    let n: i32 = \"1\".parse()?;\n    println!(\"{}\", n);\n}\n```\nWhy does this not compile?",[226,228,230,232],{"key":196,"text":227},"`?` needs the enclosing function to return `Result` or `Option`, but this `main` returns `()`",{"key":199,"text":229},"`?` cannot be applied to `parse()`: its error type is not `Box\u003Cdyn Error>`",{"key":202,"text":231},"`?` is not allowed in `main`; only functions called from `main` may use it",{"key":205,"text":233},"`?` requires an explicit type annotation such as `parse::\u003Ci32>()` to pick the error type","The error is E0277: \"the `?` operator can only be used in a function that returns `Result` or `Option`\". `?` desugars to an early `return Err(From::from(e))`, which is impossible when the function returns `()`. Changing the signature to `fn main() -> Result\u003C(), Box\u003Cdyn std::error::Error>>` and ending with `Ok(())` makes it compile. `main` is allowed to use `?`, and the `let n: i32` annotation already fixes the parse target.",{"id":236,"topic":9,"difficulty":210,"body":237,"options":238,"correct_key":202,"explanation":247},"01a0608e-d2cd-7653-b92c-3df5e1ebf01b","```rust\nfn main() {\n    let cfg: Option\u003C&str> = None;\n    let v = cfg.unwrap();\n    println!(\"{}\", v);\n}\n```\nWhat is observed at runtime?",[239,241,243,245],{"key":196,"text":240},"The program prints an empty line: `unwrap` on `None` yields the type's default value",{"key":199,"text":242},"It exits with code 1 after writing `Error: None` to stderr",{"key":202,"text":244},"The thread panics with `called `Option::unwrap()` on a `None` value` and the process exits with code 101",{"key":205,"text":246},"Compilation fails: `unwrap` on an `Option` whose state is unknown is rejected","`Option::unwrap` returns the inner value for `Some` and panics for `None` with exactly the message `called `Option::unwrap()` on a `None` value`. An uncaught panic in the main thread terminates the process with exit status 101. The compiler does not track whether the value is `None`; defaults come only from `unwrap_or_default`, and the `Error: ...` line with status 1 is what `main` returning `Err` produces, not a panic.",{"id":249,"topic":9,"difficulty":210,"body":250,"options":251,"correct_key":202,"explanation":260},"01a0608e-d2ce-72af-9f1b-d1c6e9e52f36","```rust\nfn main() {\n    let r: Result\u003Ci32, String> = Err(\"disk full\".to_string());\n    let v = r.expect(\"reading config\");\n    println!(\"{}\", v);\n}\n```\nWhich panic message does this produce?",[252,254,256,258],{"key":196,"text":253},"`reading config`",{"key":199,"text":255},"`called `Result::unwrap()` on an `Err` value: \"disk full\"`",{"key":202,"text":257},"`reading config: \"disk full\"`",{"key":205,"text":259},"`disk full: reading config`","`Result::expect(msg)` panics with the custom message followed by a colon and the `Debug` rendering of the error: `reading config: \"disk full\"`. The quotes come from `String`'s `Debug` output. Plain `unwrap()` would instead print `called `Result::unwrap()` on an `Err` value: \"disk full\"`. The custom text always comes first, and it is never dropped.",{"id":262,"topic":9,"difficulty":210,"body":263,"options":264,"correct_key":196,"explanation":273},"01a0608e-d2cf-750d-a6e2-ab888a353abe","```rust\nfn parse(s: &str) -> Result\u003Ci32, String> {\n    s.parse::\u003Ci32>().map_err(|e| format!(\"bad input {:?}: {}\", s, e))\n}\n\nfn main() {\n    println!(\"{:?}\", parse(\"4x\"));\n}\n```\nWhat is printed?",[265,267,269,271],{"key":196,"text":266},"`Err(\"bad input \\\"4x\\\": invalid digit found in string\")`",{"key":199,"text":268},"`Err(\"bad input 4x: ParseIntError { kind: InvalidDigit }\")`",{"key":202,"text":270},"`Err(ParseIntError { kind: InvalidDigit })`",{"key":205,"text":272},"`Ok(4)`, as `parse` reads the leading digits and stops at `x`","`map_err` replaces the error type: the closure receives the `ParseIntError` and returns a `String`, so the function now yields `Result\u003Ci32, String>`. Inside the closure `{:?}` on `s` adds quotes (`\"4x\"`) and `{}` on the error uses its `Display` text `invalid digit found in string`. The outer `{:?}` on the `Result` then prints the `String` with escaped quotes. `str::parse` never accepts trailing garbage, so `\"4x\"` is a full failure, not a partial `Ok(4)`.",{"fields":275,"seniorities":495,"interview_shapes":496,"locales":503,"oauth":505,"question_count":508,"coach_enabled":509,"jd_match_enabled":509},[276,288,308,326,350,363,382,401,421,440,455,477],{"key":5,"name_tr":6,"name_en":6,"sort":192,"specializations":277},[278,281,282,283,284,285,286,287],{"key":279,"name":280,"field":5},"general","Genel",{"key":172,"name":173,"field":5},{"key":184,"name":185,"field":5},{"key":175,"name":176,"field":5},{"key":168,"name":169,"field":5},{"key":178,"name":179,"field":5},{"key":181,"name":182,"field":5},{"key":187,"name":188,"field":5},{"key":289,"name_tr":290,"name_en":290,"sort":210,"specializations":291},"frontend","Frontend",[292,293,296,299,302,305],{"key":279,"name":280,"field":289},{"key":294,"name":295,"field":289},"javascript","JavaScript",{"key":297,"name":298,"field":289},"typescript","TypeScript",{"key":300,"name":301,"field":289},"react","React",{"key":303,"name":304,"field":289},"vue","Vue",{"key":306,"name":307,"field":289},"angular","Angular",{"key":309,"name_tr":310,"name_en":310,"sort":311,"specializations":312},"fullstack","Fullstack",3,[313,314,315,316,317,318,319,320,321,322,323,324,325],{"key":279,"name":280,"field":309},{"key":172,"name":173,"field":5},{"key":184,"name":185,"field":5},{"key":175,"name":176,"field":5},{"key":168,"name":169,"field":5},{"key":178,"name":179,"field":5},{"key":181,"name":182,"field":5},{"key":187,"name":188,"field":5},{"key":294,"name":295,"field":289},{"key":297,"name":298,"field":289},{"key":300,"name":301,"field":289},{"key":303,"name":304,"field":289},{"key":306,"name":307,"field":289},{"key":327,"name_tr":328,"name_en":328,"sort":329,"specializations":330},"devops-cloud","DevOps \u002F Cloud",4,[331,332,335,338,341,344,347],{"key":279,"name":280,"field":327},{"key":333,"name":334,"field":327},"aws","AWS",{"key":336,"name":337,"field":327},"gcp","GCP",{"key":339,"name":340,"field":327},"azure","Azure",{"key":342,"name":343,"field":327},"kubernetes","Kubernetes",{"key":345,"name":346,"field":327},"terraform","Terraform",{"key":348,"name":349,"field":327},"linux","Linux",{"key":351,"name_tr":352,"name_en":352,"sort":353,"specializations":354},"ai-engineer","AI Engineer",5,[355,356,357,360],{"key":279,"name":280,"field":351},{"key":184,"name":185,"field":351},{"key":358,"name":359,"field":351},"llm-rag","LLM\u002FRAG",{"key":361,"name":362,"field":351},"mlops","MLOps",{"key":364,"name_tr":365,"name_en":366,"sort":367,"specializations":368},"database","Veritabanı","Database",6,[369,370,373,376,379],{"key":279,"name":280,"field":364},{"key":371,"name":372,"field":364},"postgresql","PostgreSQL",{"key":374,"name":375,"field":364},"mysql","MySQL",{"key":377,"name":378,"field":364},"mongodb","MongoDB",{"key":380,"name":381,"field":364},"redis","Redis",{"key":383,"name_tr":384,"name_en":385,"sort":386,"specializations":387},"mobile","Mobil","Mobile",7,[388,389,392,395,398],{"key":279,"name":280,"field":383},{"key":390,"name":391,"field":383},"ios-swift","iOS (Swift)",{"key":393,"name":394,"field":383},"android-kotlin","Android (Kotlin)",{"key":396,"name":397,"field":383},"flutter","Flutter",{"key":399,"name":400,"field":383},"react-native","React Native",{"key":161,"name_tr":402,"name_en":162,"sort":403,"specializations":404},"Güvenlik",8,[405,406,409,412,415,418],{"key":279,"name":280,"field":161},{"key":407,"name":408,"field":161},"appsec","AppSec",{"key":410,"name":411,"field":161},"offensive-pentest","Offensive \u002F Pentest",{"key":413,"name":414,"field":161},"cloud-security","Cloud Security",{"key":416,"name":417,"field":161},"devsecops","DevSecOps",{"key":419,"name":420,"field":161},"blue-team-incident","Blue Team \u002F Incident",{"key":422,"name_tr":423,"name_en":424,"sort":425,"specializations":426},"qa-test-automation","QA \u002F Test Otomasyonu","QA \u002F Test Automation",9,[427,428,431,434,437],{"key":279,"name":280,"field":422},{"key":429,"name":430,"field":422},"test-automation","Test Automation",{"key":432,"name":433,"field":422},"sdet","SDET",{"key":435,"name":436,"field":422},"performance-testing","Performance Testing",{"key":438,"name":439,"field":422},"mobile-qa","Mobile QA",{"key":441,"name_tr":442,"name_en":442,"sort":443,"specializations":444},"data-engineer","Data Engineer",10,[445,446,449,452],{"key":279,"name":280,"field":441},{"key":447,"name":448,"field":441},"pipelines-etl","Pipelines \u002F ETL",{"key":450,"name":451,"field":441},"streaming","Streaming",{"key":453,"name":454,"field":441},"warehousing","Warehousing",{"key":456,"name_tr":457,"name_en":458,"sort":459,"specializations":460},"game-dev","Oyun Geliştirme","Game Development",11,[461,462,465,468,471,474],{"key":279,"name":280,"field":456},{"key":463,"name":464,"field":456},"unity-csharp","Unity (C#)",{"key":466,"name":467,"field":456},"unreal-cpp","Unreal (C++)",{"key":469,"name":470,"field":456},"gameplay","Gameplay",{"key":472,"name":473,"field":456},"graphics-rendering","Graphics \u002F Rendering",{"key":475,"name":476,"field":456},"multiplayer-netcode","Multiplayer \u002F Netcode",{"key":478,"name_tr":479,"name_en":479,"sort":480,"specializations":481},"ml-engineer","ML Engineer",12,[482,483,486,489,492],{"key":279,"name":280,"field":478},{"key":484,"name":485,"field":478},"classical-ml","Classical ML",{"key":487,"name":488,"field":478},"feature-engineering","Feature Engineering",{"key":490,"name":491,"field":478},"deep-learning","Deep Learning",{"key":493,"name":494,"field":478},"training-infrastructure","Training Infrastructure",[14,15,16],{"junior":497,"mid":499,"placement":500,"senior":502},{"questions":498,"median_sec":3},20,{"questions":498,"median_sec":3},{"questions":501,"median_sec":3},24,{"questions":498,"median_sec":3},[504,10],"tr",[506,507],"google","github",29400,true]