[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"me":3,"catalog:en:backend\u002Frs-memory-smart-pointers-unsafe":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-memory-smart-pointers-unsafe","Rs Memory Smart Pointers Unsafe","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,153,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":151,"name":152,"count":11},"rs-error-handling-result-option","Rs Error Handling Result Option",{"key":8,"name":9,"count":11},{"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-d2ee-7e83-abe1-f993e715cdd5",1,"```rust\nenum List {\n    Cons(i32, List),\n    Nil,\n}\nfn main() {\n    let _l = List::Nil;\n}\n```\nWhat does `rustc` (edition 2021) do with this program?",[195,198,201,204],{"key":196,"text":197},"a","It compiles; `List::Nil` occupies 0 bytes so no heap allocation is needed for the empty list",{"key":199,"text":200},"b","`E0072`: `List` has infinite size; the variant needs an indirection such as `Box\u003CList>`",{"key":202,"text":203},"c","It compiles, but constructing any `Cons` node at runtime overflows the stack and panics",{"key":205,"text":206},"d","It fails with `E0382` since the inner `List` is moved into `Cons` while still being defined","An enum must have a known, finite size at compile time. `Cons(i32, List)` stores a `List` inline, so the size of `List` would depend on itself. The compiler rejects this with `E0072` (measured on rustc 1.98). Putting the recursive part behind a pointer (`Cons(i32, Box\u003CList>)`) gives the variant a fixed 8-byte field, and the whole enum then measures 16 bytes on a 64-bit target. There is no runtime stage here at all: the program never gets past type checking.",{"id":209,"topic":9,"difficulty":210,"body":211,"options":212,"correct_key":205,"explanation":221},"01a0608e-d2ef-76af-bc58-c1702b268ea1",2,"```rust\nuse std::mem::size_of;\nfn main() {\n    println!(\"{} {}\", size_of::\u003COption\u003CBox\u003Ci32>>>(), size_of::\u003COption\u003Ci32>>());\n}\n```\nOn a 64-bit target, what does this print?",[213,215,217,219],{"key":196,"text":214},"`16 8`: the `Option` always adds an 8-byte tag in front of the `Box` pointer, while `i32` gets a 4-byte tag",{"key":199,"text":216},"`16 16`: every `Option` carries a separate discriminant, so both are one word larger than their payload",{"key":202,"text":218},"`8 4`: `Option\u003Ci32>` reuses the sign bit of the integer as its `None` marker",{"key":205,"text":220},"`8 8`: `None` reuses the null pointer that `Box` never produces, while `i32` needs a separate tag","Measured: `8 8`. `Box\u003Ci32>` is a non-null pointer, and the compiler uses that forbidden bit pattern (the \"niche\") to represent `None`, so `Option\u003CBox\u003Ci32>>` is exactly one pointer wide. `i32` uses every one of its 2^32 bit patterns, so there is no spare value for `None`; the discriminant goes in a separate byte and the whole thing is padded to 8 bytes because of the 4-byte alignment. The same niche trick applies to `&T` and `Rc\u003CT>`.",{"id":223,"topic":9,"difficulty":210,"body":224,"options":225,"correct_key":205,"explanation":234},"01a0608e-d2f0-7705-97c7-173ba8498bbd","```rust\nuse std::rc::Rc;\nfn main() {\n    let a = Rc::new(String::from(\"x\"));\n    let b = Rc::clone(&a);\n    let v = vec![a.clone(), a.clone()];\n    println!(\"{} {}\", Rc::strong_count(&a), Rc::ptr_eq(&a, &b));\n    drop(v);\n    drop(b);\n    println!(\"{}\", Rc::strong_count(&a));\n}\n```\nWhat is printed?",[226,228,230,232],{"key":196,"text":227},"`3 true` then `0`: the original `a` is not counted, and dropping `b` releases the last reference",{"key":199,"text":229},"`4 false` then `1`: `Rc::clone` copies the `String` into a fresh allocation, so the pointers differ",{"key":202,"text":231},"`1 true` then `1`: the counter tracks distinct owners, and `v` holds two handles to the same owner",{"key":205,"text":233},"`4 true` then `1`: each clone bumps one shared counter, and the drops bring it back down","Measured output: `4 true` \u002F `1`. `Rc::clone` (and `.clone()` on an `Rc`) never copies the `String`; it increments the strong count and hands back another pointer to the same heap block, which is why `Rc::ptr_eq` is `true`. `a`, `b` and the two elements of `v` are four strong handles. Dropping `v` releases two, dropping `b` releases one, leaving `a` alone with a count of 1. The value itself is freed only when that last count reaches 0.",{"id":236,"topic":9,"difficulty":210,"body":237,"options":238,"correct_key":202,"explanation":247},"01a0608e-d2f1-74ca-8a6c-334aaabe1407","```rust\nuse std::cell::RefCell;\nfn main() {\n    let c = RefCell::new(vec![1]);\n    let r1 = c.borrow();\n    let r2 = c.borrow();\n    println!(\"{} {}\", r1.len(), r2.len());\n    let m = c.borrow_mut();\n    println!(\"{}\", m.len());\n}\n```\nWhat happens when this runs?",[239,241,243,245],{"key":196,"text":240},"Prints `1 1` then `1`: `RefCell` allows any mix of borrows as long as they happen on one thread",{"key":199,"text":242},"Compile error `E0502`: `r1` and `r2` are still alive when `borrow_mut` asks for exclusive access",{"key":202,"text":244},"Prints `1 1`, then panics with `already borrowed` since two shared `Ref` guards are still alive",{"key":205,"text":246},"Prints `1 1` then `1`: `r1` and `r2` are released automatically as soon as `borrow_mut` is called","Measured: `1 1` is printed, then the program panics with `RefCell already borrowed`. `RefCell` moves the borrow rules from compile time to run time: it keeps a borrow counter, and `borrow_mut` checks that no `Ref` or `RefMut` guard is alive. `r1` and `r2` still live until the end of `main`, so the check fails and panics. `try_borrow_mut` returns an `Err` instead of panicking, and dropping the guards (or scoping them in a block) before `borrow_mut` makes the code run through.",{"id":249,"topic":9,"difficulty":192,"body":250,"options":251,"correct_key":202,"explanation":260},"01a0608e-d2f2-7267-9bd2-42b863946afb","```rust\nuse std::cell::Cell;\nfn bump(c: &Cell\u003Cu32>) {\n    c.set(c.get() + 1);\n}\nfn main() {\n    let c = Cell::new(1);\n    bump(&c);\n    bump(&c);\n    println!(\"{} {} {}\", c.get(), c.take(), c.get());\n}\n```\nWhat does this print?",[252,254,256,258],{"key":196,"text":253},"Compile error `E0596`: `bump` receives a shared reference, so `set` cannot mutate through it",{"key":199,"text":255},"`3 3 3`: `take` returns a copy of the value and leaves the cell unchanged",{"key":202,"text":257},"`3 3 0`: `set` works through `&Cell`, and `take` swaps the value out for `u32::default()`",{"key":205,"text":259},"`1 1 0`: mutations made through a shared reference are discarded when `bump` returns","Measured: `3 3 0`. `Cell\u003CT>` is the simplest form of interior mutability: `set` and `get` take `&self`, so a plain `&Cell\u003Cu32>` is enough to change the value. There is no runtime borrow flag either, since `get` copies the value out and `set` copies a new one in (this is why `Cell::get` requires `T: Copy`). `take` returns the current value and stores `Default::default()`, which for `u32` is 0, hence the final `0`.",{"id":262,"topic":9,"difficulty":210,"body":263,"options":264,"correct_key":196,"explanation":273},"01a0608e-d2f2-7e6d-9430-d396442e54dc","```rust\nstruct D(&'static str);\nimpl Drop for D {\n    fn drop(&mut self) { println!(\"drop {}\", self.0); }\n}\nfn main() {\n    let a = D(\"a\");\n    let b = D(\"b\");\n    std::mem::forget(a);\n    drop(b);\n    println!(\"end\");\n}\n```\nWhat is the complete output?",[265,267,269,271],{"key":196,"text":266},"`drop b` then `end`: `forget` never runs `a`'s destructor, `drop` runs `b`'s right away",{"key":199,"text":268},"`drop b`, `end`, `drop a`: `forget` only postpones `a`'s destructor to the end of `main`",{"key":202,"text":270},"`drop a`, `drop b`, `end`: both calls consume their argument, and consuming a value runs `Drop`",{"key":205,"text":272},"Compile error `E0382`: `a` is used after `forget` moved it, since `Drop` types cannot be forgotten","Measured output: `drop b` \u002F `end`. `std::mem::drop` is literally `fn drop\u003CT>(_x: T) {}`: it takes ownership and lets the value fall out of scope right there, so `b`'s destructor runs at that line. `std::mem::forget` also takes ownership but deliberately never runs the destructor, so `drop a` is never printed and any heap memory `a` owned would leak. Leaking is considered safe in Rust (no memory unsafety), which is exactly why `forget` is not an `unsafe` function.",{"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]