# Rustの基礎 (Rust) > 変数、可変性、プリミティブ型、関数、式、control flow、pattern matching - 25 面接問題 - Junior - [面接問題: Rust](https://sharpskill.dev/ja/technologies/rust/interview-questions.md) ## 1. Rust では、変数はデフォルトでどのように宣言されますか? **回答** Rust では、let で宣言されたすべての変数はデフォルトでイミュータブル(不変)です。この設計は、意図しない変更を防ぐことで安全性と並行性を高めます。変数をミュータブル(可変)にするには、let の後に mut キーワードを明示的に使用します。 ## 2. Rust における let と const の違いは何ですか? **回答** const は型注釈が必須でコンパイル時に評価される定数を宣言するのに対し、let は型推論が可能で実行時に評価される変数を宣言します。定数はコンパイル時に既知の値を持つ必要があり、配列のサイズなどのコンパイル時コンテキストで使用できます。 ## 3. Rust における shadowing とは何ですか? **回答** shadowing は let を使って同じ名前の変数を再宣言し、以前の変数を隠す新しい変数を作成できる機能です。mut とは異なり、shadowing では変数の型を変更できます。これは同じ論理的な名前を保ちながら値を変換するのに便利です。 ## さらに22問利用可能 - Rust のデフォルトの符号付き整数型は何ですか? - Rust における isize と i64 の違いは何ですか? 無料で登録: https://sharpskill.dev/ja/login ## その他のRust面接トピック - [Ownership & Borrowing](https://sharpskill.dev/ja/technologies/rust/interview-questions/ownership-borrowing.md): 22問, Junior - [Structs & Enums](https://sharpskill.dev/ja/technologies/rust/interview-questions/structs-enums.md): 20問, Junior - [エラー処理](https://sharpskill.dev/ja/technologies/rust/interview-questions/error-handling.md): 18問, Junior - [コレクション](https://sharpskill.dev/ja/technologies/rust/interview-questions/collections.md): 20問, Junior - [モジュールとパッケージ](https://sharpskill.dev/ja/technologies/rust/interview-questions/modules-packages.md): 18問, Junior - [Traits](https://sharpskill.dev/ja/technologies/rust/interview-questions/traits.md): 22問, Mid-Level - [Generics](https://sharpskill.dev/ja/technologies/rust/interview-questions/generics.md): 20問, Mid-Level - [Lifetimes](https://sharpskill.dev/ja/technologies/rust/interview-questions/lifetimes.md): 20問, Mid-Level - [Iterators & Closures](https://sharpskill.dev/ja/technologies/rust/interview-questions/iterators-closures.md): 22問, Mid-Level - [Smart Pointers](https://sharpskill.dev/ja/technologies/rust/interview-questions/smart-pointers.md): 22問, Mid-Level - [Concurrency Basics](https://sharpskill.dev/ja/technologies/rust/interview-questions/concurrency-basics.md): 20問, Mid-Level - [async/await](https://sharpskill.dev/ja/technologies/rust/interview-questions/async-await.md): 22問, Mid-Level - [Testing](https://sharpskill.dev/ja/technologies/rust/interview-questions/testing.md): 18問, Mid-Level - [Cargo & Ecosystem](https://sharpskill.dev/ja/technologies/rust/interview-questions/cargo-ecosystem.md): 18問, Mid-Level - [Pattern Matching](https://sharpskill.dev/ja/technologies/rust/interview-questions/pattern-matching.md): 18問, Mid-Level - [マクロ](https://sharpskill.dev/ja/technologies/rust/interview-questions/macros.md): 20問, Mid-Level - [Serde とシリアライゼーション](https://sharpskill.dev/ja/technologies/rust/interview-questions/serde-serialization.md): 20問, Mid-Level - [Unsafe Rust](https://sharpskill.dev/ja/technologies/rust/interview-questions/unsafe-rust.md): 20問, Senior - [高度なトレイト](https://sharpskill.dev/ja/technologies/rust/interview-questions/advanced-traits.md): 22問, Senior - [高度な lifetime](https://sharpskill.dev/ja/technologies/rust/interview-questions/advanced-lifetimes.md): 20問, Senior - [Type System](https://sharpskill.dev/ja/technologies/rust/interview-questions/type-system.md): 20問, Senior - [Tokio & Async I/O](https://sharpskill.dev/ja/technologies/rust/interview-questions/tokio-async.md): 22問, Senior - [パフォーマンス最適化](https://sharpskill.dev/ja/technologies/rust/interview-questions/performance-optimization.md): 20問, Senior - [Memory Management](https://sharpskill.dev/ja/technologies/rust/interview-questions/memory-management.md): 20問, Senior - [Web Frameworks](https://sharpskill.dev/ja/technologies/rust/interview-questions/web-frameworks.md): 22問, Senior - [Database Integration](https://sharpskill.dev/ja/technologies/rust/interview-questions/database-integration.md): 20問, Senior - [Rust デザインパターン](https://sharpskill.dev/ja/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/ja/technologies/rust/interview-questions/rust-basics