Rust has fixed-size integers, floats, booleans, and characters. Type inference works locally but functions often need explicit signatures.
Common scalars
i32,u64— signed/unsigned integersf64— default floatbool—true/falsechar— Unicode scalar in single quotes
Important interview questions and answers
- Q: Default integer type?
A:i32when unspecified in many contexts.
Self-check
- Name a signed and unsigned integer type.
- What type is
'🦀'?