Easy-level Polkadot interview questions covering blockchain basics, Substrate, and parachains. Q1: What is Polkadot and how does it work? Answer: Polkadot is a heterogeneous multi-chain protocol. graph TB A[Polkadot] --> B[Relay Chain] A --> C[Parachains] A --> D[Parathreads] B --> E[Validators] B --> F[Collators] B …
Read MoreEasy-level Solana interview questions covering blockchain basics, programs, and development. Q1: What is Solana and how does it work? Answer: Solana is a high-performance blockchain designed for scalability. graph TB A[Solana] --> B[Proof of History<br/>PoH] A --> C[Tower BFT<br/>Consensus] A --> D[Gulf …
Read MoreMedium-level Solana interview questions covering advanced program development, optimization, and architecture. Q1: How do you implement cross-program invocations (CPIs)? Answer: CPI Basics: 1use solana_program::{ 2 program::invoke, 3 account_info::AccountInfo, 4}; 5 6pub fn call_other_program( 7 program_id: &Pubkey, 8 …
Read MoreEssential Rust patterns covering ownership, borrowing, error handling, iterators, and common idioms. Master these to write idiomatic Rust code. Use Case Use these patterns when you need to: Understand Rust's ownership system Handle errors properly Work with iterators and collections Write safe, concurrent code …
Read MoreCommon code smells in Rust and how to fix them. Unwrap/Expect Abuse 1// ❌ Bad 2let value = some_option.unwrap(); 3let result = some_result.expect("failed"); 4 5// ✅ Good 6let value = some_option.ok_or(Error::MissingValue)?; 7let result = some_result?; Clone Instead of Borrow 1// ❌ Bad 2fn process(data: Vec<String>) { 3 …
Read MoreSecure coding practices for Rust applications. SQL Injection Prevention 1// ❌ Vulnerable 2let username = req.param("username"); 3let query = format!("SELECT * FROM users WHERE username = '{}'", username); 4conn.query(&query); 5 6// ✅ Secure (using sqlx) 7let username = req.param("username"); 8let user = …
Read MoreTools for checking vulnerabilities in Rust code. Cargo Audit 1# Install 2cargo install cargo-audit 3 4# Check vulnerabilities 5cargo audit 6 7# Fix vulnerabilities 8cargo audit fix 9 10# JSON output 11cargo audit --json Cargo Deny 1# Install 2cargo install cargo-deny 3 4# Initialize config 5cargo deny init 6 7# Check …
Read More