Polkadot Interview Questions - Easy

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.

Key Components:

  • Relay Chain: Main chain providing security
  • Parachains: Independent chains with dedicated slots
  • Parathreads: Pay-as-you-go parachains
  • Bridges: Connect to external chains

Consensus: Nominated Proof of Stake (NPoS)


Q2: What is Substrate and how do you build with it?

Answer:

Substrate is a blockchain framework for building custom chains.

Basic Runtime:

 1// runtime/src/lib.rs
 2pub struct Runtime;
 3
 4impl Config for Runtime {
 5    type Block = Block;
 6    type RuntimeCall = RuntimeCall;
 7}
 8
 9// Define modules (pallets)
10construct_runtime!(
11    pub enum Runtime {
12        System: frame_system,
13        Balances: pallet_balances,
14    }
15);

Build Chain:

1# Create new substrate node
2substrate-node-new my-chain
3
4# Build
5cargo build --release
6
7# Run
8./target/release/my-chain --dev

Q3: What are Polkadot validators and nominators?

Answer:

Validators:

  • Produce blocks on Relay Chain
  • Validate parachain blocks
  • Stake DOT tokens
  • Earn rewards

Nominators:

  • Stake DOT to validators
  • Share in rewards
  • Help secure network

Staking:

1# Bond DOT
2polkadot-js-apps -> Staking -> Account actions -> Bond
3
4# Nominate validators
5polkadot-js-apps -> Staking -> Nominate

Q4: How do parachains work?

Answer:

Parachain Architecture:

  • Independent chains with own state
  • Connected to Relay Chain
  • Share security with Relay Chain
  • Can communicate with other parachains

Parachain Slot:

  • Auctioned for 96 weeks
  • Requires DOT bond
  • Provides dedicated block space

Collators:

  • Collect transactions
  • Produce blocks
  • Submit to validators

Q5: What are Substrate pallets?

Answer:

Pallets are runtime modules.

Example Pallet:

 1#[pallet]
 2pub mod pallet {
 3    use frame_support::pallet_prelude::*;
 4    
 5    #[pallet::config]
 6    pub trait Config: frame_system::Config {
 7        type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
 8    }
 9    
10    #[pallet::storage]
11    pub type MyStorage<T: Config> = StorageValue<_, u32>;
12    
13    #[pallet::call]
14    impl<T: Config> Pallet<T> {
15        #[pallet::weight(10_000)]
16        pub fn my_function(origin: OriginFor<T>) -> DispatchResult {
17            // Implementation
18            Ok(())
19        }
20    }
21}

Q6: How does XCM (Cross-Consensus Messaging) work?

Answer:

XCM enables communication between parachains.

Send XCM:

 1use xcm::prelude::*;
 2
 3let message = Xcm(vec![
 4    WithdrawAsset(assets),
 5    BuyExecution { fees, weight_limit },
 6    DepositAsset { assets, beneficiary },
 7]);
 8
 9// Send to parachain
10XcmPallet::send(origin, dest, message)?;

Q7: How do you interact with Polkadot using polkadot.js?

Answer:

Basic Interaction:

 1import { ApiPromise, WsProvider } from '@polkadot/api';
 2
 3// Connect
 4const provider = new WsProvider('wss://rpc.polkadot.io');
 5const api = await ApiPromise.create({ provider });
 6
 7// Get balance
 8const balance = await api.query.balances.account(accountAddress);
 9
10// Send transaction
11const tx = api.tx.balances.transfer(recipient, amount);
12await tx.signAndSend(signer);

Q8: What is the difference between parachains and parathreads?

Answer:

Parachains:

  • Dedicated slot (auctioned)
  • Guaranteed block space
  • Higher cost
  • Better for high-throughput

Parathreads:

  • Pay-per-block model
  • No dedicated slot
  • Lower cost
  • Better for occasional use

Q9: How does Polkadot governance work?

Answer:

Governance Bodies:

  • Council: Elected representatives
  • Technical Committee: Technical experts
  • Referendum: Public voting

Proposal Process:

  1. Submit proposal
  2. Council/Technical Committee review
  3. Public referendum
  4. Execution if passed

Q10: How do you test Substrate pallets?

Answer:

Unit Tests:

 1#[cfg(test)]
 2mod tests {
 3    use super::*;
 4    
 5    #[test]
 6    fn test_my_function() {
 7        new_test_ext().execute_with(|| {
 8            // Test logic
 9            assert_ok!(Pallet::my_function(Origin::signed(1)));
10        });
11    }
12}

Related Snippets