# Structs & Enums (Rust) > Struct definition, methods, associated functions, tuple structs, enums, Option, Result - 20 interview questions - Junior - [Interview Questions: Rust](https://sharpskill.dev/en/technologies/rust/interview-questions.md) ## 1. What is a struct in Rust? **Answer** A struct in Rust is a custom data type that allows grouping multiple related values under a single name. It is similar to classes in other languages but without inheritance. Structs are fundamental for modeling structured data and are widely used throughout any Rust program. ## 2. How to declare a struct named Point with two fields x and y of type i32? **Answer** The syntax for declaring a struct in Rust uses the struct keyword followed by the name and fields in curly braces. Each field specifies its name followed by a colon and its type. This syntax is the standard form for defining named structs in Rust. ## 3. What is a tuple struct in Rust? **Answer** A tuple struct is a struct whose fields are identified by position rather than by name. It is declared with parentheses instead of curly braces and allows creating a distinct new type from a tuple. Tuple structs are useful for creating newtypes or when field names would be redundant. ## 17 more questions available - How to access the fields of a tuple struct Color(u8, u8, u8)? - What is an impl block in Rust? Sign up for free: https://sharpskill.dev/en/login ## Other Rust interview topics - [Rust Basics](https://sharpskill.dev/en/technologies/rust/interview-questions/rust-basics.md): 25 questions, Junior - [Ownership & Borrowing](https://sharpskill.dev/en/technologies/rust/interview-questions/ownership-borrowing.md): 22 questions, Junior - [Error Handling](https://sharpskill.dev/en/technologies/rust/interview-questions/error-handling.md): 18 questions, Junior - [Collections](https://sharpskill.dev/en/technologies/rust/interview-questions/collections.md): 20 questions, Junior - [Modules & Packages](https://sharpskill.dev/en/technologies/rust/interview-questions/modules-packages.md): 18 questions, Junior - [Traits](https://sharpskill.dev/en/technologies/rust/interview-questions/traits.md): 22 questions, Mid-Level - [Generics](https://sharpskill.dev/en/technologies/rust/interview-questions/generics.md): 20 questions, Mid-Level - [Lifetimes](https://sharpskill.dev/en/technologies/rust/interview-questions/lifetimes.md): 20 questions, Mid-Level - [Iterators & Closures](https://sharpskill.dev/en/technologies/rust/interview-questions/iterators-closures.md): 22 questions, Mid-Level - [Smart Pointers](https://sharpskill.dev/en/technologies/rust/interview-questions/smart-pointers.md): 22 questions, Mid-Level - [Concurrency Basics](https://sharpskill.dev/en/technologies/rust/interview-questions/concurrency-basics.md): 20 questions, Mid-Level - [async/await](https://sharpskill.dev/en/technologies/rust/interview-questions/async-await.md): 22 questions, Mid-Level - [Testing](https://sharpskill.dev/en/technologies/rust/interview-questions/testing.md): 18 questions, Mid-Level - [Cargo & Ecosystem](https://sharpskill.dev/en/technologies/rust/interview-questions/cargo-ecosystem.md): 18 questions, Mid-Level - [Pattern Matching](https://sharpskill.dev/en/technologies/rust/interview-questions/pattern-matching.md): 18 questions, Mid-Level - [Macros](https://sharpskill.dev/en/technologies/rust/interview-questions/macros.md): 20 questions, Mid-Level - [Serde & Serialization](https://sharpskill.dev/en/technologies/rust/interview-questions/serde-serialization.md): 20 questions, Mid-Level - [Unsafe Rust](https://sharpskill.dev/en/technologies/rust/interview-questions/unsafe-rust.md): 20 questions, Senior - [Advanced Traits](https://sharpskill.dev/en/technologies/rust/interview-questions/advanced-traits.md): 22 questions, Senior - [Advanced Lifetimes](https://sharpskill.dev/en/technologies/rust/interview-questions/advanced-lifetimes.md): 20 questions, Senior - [Type System](https://sharpskill.dev/en/technologies/rust/interview-questions/type-system.md): 20 questions, Senior - [Tokio & Async I/O](https://sharpskill.dev/en/technologies/rust/interview-questions/tokio-async.md): 22 questions, Senior - [Performance Optimization](https://sharpskill.dev/en/technologies/rust/interview-questions/performance-optimization.md): 20 questions, Senior - [Memory Management](https://sharpskill.dev/en/technologies/rust/interview-questions/memory-management.md): 20 questions, Senior - [Web Frameworks](https://sharpskill.dev/en/technologies/rust/interview-questions/web-frameworks.md): 22 questions, Senior - [Database Integration](https://sharpskill.dev/en/technologies/rust/interview-questions/database-integration.md): 20 questions, Senior - [Rust Design Patterns](https://sharpskill.dev/en/technologies/rust/interview-questions/design-patterns.md): 20 questions, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/en/technologies/rust/interview-questions/structs-enums