
Rust Basics
Variables, mutability, primitive types, functions, expressions, control flow, pattern matching
1By default, how are variables declared in Rust?
By default, how are variables declared in Rust?
Jawaban
In Rust, all variables are immutable by default when declared with let. This design promotes safety and concurrency by preventing accidental modifications. To make a variable mutable, explicitly use the mut keyword after let.
2What is the difference between let and const in Rust?
What is the difference between let and const in Rust?
Jawaban
const declares a compile-time constant with mandatory type annotation, while let declares a runtime variable with possible type inference. Constants must have values known at compile time and can be used in compilation contexts like array sizes.
3What is shadowing in Rust?
What is shadowing in Rust?
Jawaban
Shadowing allows redeclaring a variable with the same name using let, creating a new variable that hides the previous one. Unlike mut, shadowing allows changing the variable type. This is useful for transforming a value while keeping the same logical name.
What is the default signed integer type in Rust?
What is the difference between isize and i64 in Rust?
+22 pertanyaan wawancara
Topik wawancara Rust lainnya
Ownership & Borrowing
Structs & Enums
Error Handling
Collections
Modules & Packages
Traits
Generics
Lifetimes
Iterators & Closures
Smart Pointers
Concurrency Basics
async/await
Testing
Cargo & Ecosystem
Pattern Matching
Macros
Serde & Serialization
Unsafe Rust
Advanced Traits
Advanced Lifetimes
Type System
Tokio & Async I/O
Performance Optimization
Memory Management
Web Frameworks
Database Integration
Rust Design Patterns
Kuasai Rust untuk wawancara berikutnya
Akses semua pertanyaan, flashcards, tes teknis, latihan code review dan simulator wawancara.
Mulai gratis