# Smart Pointers (Rust) > Box, Rc, Arc, RefCell, interior mutability, Deref 및 Drop trait - 22 면접 질문 - Mid-Level - [면접 질문: Rust](https://sharpskill.dev/ko/technologies/rust/interview-questions.md) ## 1. Rust에서 Box의 주요 사용 사례는 무엇입니까? **답변** Box는 데이터를 stack이 아닌 heap에 할당합니다. 이는 컴파일 시점에 크기를 알 수 없는 타입(재귀적 타입), 큰 데이터의 ownership을 복사 없이 이전하는 경우, 또는 trait object를 생성하는 경우에 유용합니다. Box 포인터 자체는 stack에서 고정 크기를 가집니다. ## 2. Rust에서 연결 리스트와 같은 재귀적 타입을 어떻게 정의합니까? **답변** enum List { Cons(i32, List), Nil }와 같은 직접적인 재귀적 타입은 컴파일러가 크기를 결정할 수 없기 때문에 컴파일되지 않습니다. Box를 사용하면 고정 크기(포인터)의 간접 참조가 생성되어 컴파일러가 타입의 크기를 계산할 수 있습니다. ## 3. Rc와 Arc의 주요 차이점은 무엇입니까? **답변** Rc(Reference Counted)는 비atomic 참조 카운터를 사용하므로 성능이 더 좋지만 단일 스레드로 제한됩니다. Arc(Atomically Reference Counted)는 카운터에 atomic 연산을 사용하여 스레드 간 공유가 가능하지만 약간의 성능 오버헤드가 있습니다. ## 19개 추가 질문 이용 가능 - Rust에서 Deref trait는 무엇을 가능하게 합니까? - Rust에서 interior mutability(내부 가변성)란 무엇입니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Rust 면접 주제 - [Rust 기초](https://sharpskill.dev/ko/technologies/rust/interview-questions/rust-basics.md): 25개 질문, Junior - [Ownership & Borrowing](https://sharpskill.dev/ko/technologies/rust/interview-questions/ownership-borrowing.md): 22개 질문, Junior - [Structs & Enums](https://sharpskill.dev/ko/technologies/rust/interview-questions/structs-enums.md): 20개 질문, Junior - [에러 처리](https://sharpskill.dev/ko/technologies/rust/interview-questions/error-handling.md): 18개 질문, Junior - [컬렉션](https://sharpskill.dev/ko/technologies/rust/interview-questions/collections.md): 20개 질문, Junior - [모듈과 패키지](https://sharpskill.dev/ko/technologies/rust/interview-questions/modules-packages.md): 18개 질문, Junior - [Traits](https://sharpskill.dev/ko/technologies/rust/interview-questions/traits.md): 22개 질문, Mid-Level - [Generics](https://sharpskill.dev/ko/technologies/rust/interview-questions/generics.md): 20개 질문, Mid-Level - [Lifetimes](https://sharpskill.dev/ko/technologies/rust/interview-questions/lifetimes.md): 20개 질문, Mid-Level - [Iterators & Closures](https://sharpskill.dev/ko/technologies/rust/interview-questions/iterators-closures.md): 22개 질문, Mid-Level - [Concurrency Basics](https://sharpskill.dev/ko/technologies/rust/interview-questions/concurrency-basics.md): 20개 질문, Mid-Level - [async/await](https://sharpskill.dev/ko/technologies/rust/interview-questions/async-await.md): 22개 질문, Mid-Level - [Testing](https://sharpskill.dev/ko/technologies/rust/interview-questions/testing.md): 18개 질문, Mid-Level - [Cargo & Ecosystem](https://sharpskill.dev/ko/technologies/rust/interview-questions/cargo-ecosystem.md): 18개 질문, Mid-Level - [Pattern Matching](https://sharpskill.dev/ko/technologies/rust/interview-questions/pattern-matching.md): 18개 질문, Mid-Level - [매크로](https://sharpskill.dev/ko/technologies/rust/interview-questions/macros.md): 20개 질문, Mid-Level - [Serde와 직렬화](https://sharpskill.dev/ko/technologies/rust/interview-questions/serde-serialization.md): 20개 질문, Mid-Level - [Unsafe Rust](https://sharpskill.dev/ko/technologies/rust/interview-questions/unsafe-rust.md): 20개 질문, Senior - [고급 트레잇](https://sharpskill.dev/ko/technologies/rust/interview-questions/advanced-traits.md): 22개 질문, Senior - [고급 lifetime](https://sharpskill.dev/ko/technologies/rust/interview-questions/advanced-lifetimes.md): 20개 질문, Senior - [Type System](https://sharpskill.dev/ko/technologies/rust/interview-questions/type-system.md): 20개 질문, Senior - [Tokio & Async I/O](https://sharpskill.dev/ko/technologies/rust/interview-questions/tokio-async.md): 22개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/rust/interview-questions/performance-optimization.md): 20개 질문, Senior - [Memory Management](https://sharpskill.dev/ko/technologies/rust/interview-questions/memory-management.md): 20개 질문, Senior - [Web Frameworks](https://sharpskill.dev/ko/technologies/rust/interview-questions/web-frameworks.md): 22개 질문, Senior - [Database Integration](https://sharpskill.dev/ko/technologies/rust/interview-questions/database-integration.md): 20개 질문, Senior - [Rust 디자인 패턴](https://sharpskill.dev/ko/technologies/rust/interview-questions/design-patterns.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/rust/interview-questions/smart-pointers