Certified Blockchain Developer - Ethereum (CBDE) — Questions and Answers
Question 1: What is slippage in the context of DEX trading?
- The delay between transaction submission and confirmation
- The difference between the expected price and the executed price of a trade (Correct answer)
- The loss of tokens sent to the wrong address
- The fee charged by liquidity providers
Correct answer: The difference between the expected price and the executed price of a trade
Slippage occurs because large trades move the pool's price, causing the execution price to differ from the quoted price.
Question 2: How much Ether would you have to pay the miner if you interacted with a smart contract and saw a gas usage of 50,000 gas at a cost of 15 Gwei?
- 750,000,000 Wei
- 750,000,000,000,000 Wei (Correct answer)
- A single charge of 1 Ether
- 750,000,000,000 Wei
Correct answer: 750,000,000,000,000 Wei
To calculate the total Ether paid, multiply the gas usage by the gas price. Given 50,000 gas and 15 Gwei (15 * 10^9 Wei), the total cost is 50,000 * 15 * 10^9 Wei. This calculation results in 750,000,000,000,000 Wei, which is the amount paid to the miner for executing the transaction.
Question 3: Which EIP number applies to the Hybrid Casper FFG proposal?
- 1010
- 1011 (Correct answer)
- 1110
- 1000
Correct answer: 1011
EIP-1011, titled 'Hybrid Casper FFG', proposed a significant change to Ethereum's consensus mechanism. This Ethereum Improvement Proposal outlined a hybrid approach that would combine the existing Proof-of-Work (PoW) chain with a Proof-of-Stake (PoS) 'Friendly Finality Gadget' (FFG), serving as a transitional step towards a full PoS system.
Question 4: What is the key distinction between ERC-20 and ERC-721 tokens?
- ERC-721 allows batch transfers by default
- ERC-721 tokens are non-fungible and each has a unique ID (Correct answer)
- ERC-721 tokens have higher decimal precision
- ERC-20 tokens represent ownership of NFTs
Correct answer: ERC-721 tokens are non-fungible and each has a unique ID
ERC-721 tokens are non-fungible, meaning each token has a unique identifier and cannot be exchanged 1:1 with another.
Question 5: In Solidity, what is a `mapping`?
- A hash table that maps keys to values (Correct answer)
- A linked list data structure
- An ordered array of key-value pairs
- A pointer to a storage slot
Correct answer: A hash table that maps keys to values
A `mapping` in Solidity is a hash table that maps keys of one type to values of another type.
Question 6: How does Solidity handle integer division by default?
- It returns a floating-point result
- It rounds to the nearest integer
- It truncates toward zero with no remainder (Correct answer)
- It throws a runtime error
Correct answer: It truncates toward zero with no remainder
Solidity integer division truncates the result toward zero, discarding any fractional part.
Question 7: What does the `nonce` in an Ethereum transaction represent?
- The amount of gas pre-authorized for the transaction
- The number of transactions sent from the sender's address, used to order and deduplicate transactions (Correct answer)
- A random value used in proof-of-work mining
- A timestamp preventing transaction replay
Correct answer: The number of transactions sent from the sender's address, used to order and deduplicate transactions
The nonce is a sequential counter for each account ensuring transactions execute in order and preventing replay attacks.
Question 8: To prevent problems during updates to the Ethereum platform
- It's a good idea to send out a newsletter informing users of the updates.
- Ethereum does not make platform upgrades. It is fixed and complete.
- The ability to suspend a contract is useful for managing the risky capital. (Correct answer)
Correct answer: The ability to suspend a contract is useful for managing the risky capital.
The ability to pause or suspend a smart contract is a critical feature for managing risk, especially during platform upgrades or in response to discovered vulnerabilities. This mechanism allows developers to temporarily halt contract operations, preventing further funds from being locked or exploited. It provides a safety net to protect user capital and allows time for necessary fixes or adjustments to be implemented.
Question 9: Which of the following is NOT a valid data location in the EVM?
- Cache (Correct answer)
- Memory
- Storage
- Stack
Correct answer: Cache
The EVM has four data locations—stack, memory, storage, and calldata—cache does not exist as a distinct EVM data location.
Question 10: What is a Solidity `modifier` used for?
- Reusing pre- and post-condition logic across multiple functions (Correct answer)
- Changing the return type of a function
- Optimizing gas usage automatically
- Declaring abstract methods
Correct answer: Reusing pre- and post-condition logic across multiple functions
Modifiers wrap function execution with reusable guard logic, like access control checks, using `_;` as a placeholder.
Question 11: What is the purpose of Foundry's `forge test` command?
- To run Solidity-native unit tests written directly in Solidity (Correct answer)
- To compile contracts and check for syntax errors
- To generate ABI files for all contracts in the project
- To simulate gas costs for a deployment
Correct answer: To run Solidity-native unit tests written directly in Solidity
`forge test` runs test contracts written in Solidity using Foundry's testing framework, providing fast and native EVM-level testing.
Question 12: Address.send() and address.transfer() differ in that
- While .transfer throws an exception on error, .send returns a Boolean. Sending full gas along, as opposed to.transfer, which just transmits the gas stipend of 2300 gas, is what makes send risky.
- Because they send all gas along, the low-level functions .send and .transfer are also harmful. Utilizing address.call.value()() is preferable for gas-amount control.
- On error, .transfer returns a Boolean, while .send throws an exception. Both are just forwarding the 2300 gas limit and are regarded as being safe from re-entry.
- On error, .transfer throws an exception while .send returns a Boolean. Both are regarded as safe against re-entry because they only forward the gas stipend of 2300 gas. (Correct answer)
Correct answer: On error, .transfer throws an exception while .send returns a Boolean. Both are regarded as safe against re-entry because they only forward the gas stipend of 2300 gas.
`address.transfer()` and `address.send()` both forward a limited gas stipend of 2300, making them safer against re-entrancy attacks compared to `call.value()()`. The key difference lies in error handling: `transfer()` automatically throws an exception and reverts the transaction on failure, whereas `send()` returns a boolean value (true for success, false for failure) requiring manual error checking by the developer.
Question 13: What is yield farming in DeFi?
- Mining new tokens by validating transactions
- Maximizing returns by strategically deploying assets across lending and liquidity protocols (Correct answer)
- Generating income by selling NFT royalties
- Staking ETH to earn validator rewards
Correct answer: Maximizing returns by strategically deploying assets across lending and liquidity protocols
Yield farming involves actively moving funds between DeFi protocols to maximize interest, fees, and token rewards.
Question 14: What is the purpose of the `CREATE2` opcode in Ethereum?
- To clone an existing contract's bytecode to a new address
- To deploy a contract at a deterministic address based on the deployer, salt, and init code (Correct answer)
- To create two contracts in a single transaction
- To deploy upgradeable proxy contracts only
Correct answer: To deploy a contract at a deterministic address based on the deployer, salt, and init code
`CREATE2` allows predetermining a contract's deployment address before it exists, enabling counterfactual contract instantiation.
Question 15: What is the purpose of the `payable` keyword in a Solidity function?
- It allows the function to receive Ether (Correct answer)
- It locks the function from being overridden
- It enables the function to return Ether
- It makes the function free to call
Correct answer: It allows the function to receive Ether
The `payable` keyword allows a function to receive Ether as part of a transaction.
Question 16: What does `eth_estimateGas` return?
- The current base fee per gas on the network
- The maximum gas a block can hold
- The gas used by the last confirmed transaction
- An estimate of the gas required to execute a given transaction (Correct answer)
Correct answer: An estimate of the gas required to execute a given transaction
`eth_estimateGas` simulates a transaction and returns an approximate gas cost without submitting it to the network.
Question 17: What is Ethereum's EVM (Ethereum Virtual Machine)?
- An off-chain execution environment for testing contracts before deployment
- A compiler that converts Solidity to machine code
- A virtual machine for running Ethereum nodes on cloud platforms
- A sandboxed runtime environment that executes smart contract bytecode on every Ethereum node (Correct answer)
Correct answer: A sandboxed runtime environment that executes smart contract bytecode on every Ethereum node
The EVM is a stack-based virtual machine that executes bytecode deterministically on all nodes, ensuring consistent contract execution across the network.
Question 18: What is a stablecoin in the Ethereum ecosystem?
- A governance token with a fixed supply
- An NFT representing a real-world asset
- A token designed to maintain a stable value, usually pegged to a fiat currency like USD (Correct answer)
- A token that cannot be transferred once issued
Correct answer: A token designed to maintain a stable value, usually pegged to a fiat currency like USD
Stablecoins reduce volatility by pegging their value to a reference asset, enabling predictable DeFi participation and payments.
Question 19: What is the role of an oracle in a DeFi smart contract?
- To audit smart contracts for security vulnerabilities
- To provide off-chain real-world data (like prices) to smart contracts on-chain (Correct answer)
- To validate transactions before they are included in a block
- To relay transactions to layer-2 networks
Correct answer: To provide off-chain real-world data (like prices) to smart contracts on-chain
Oracles bridge the gap between on-chain contracts and off-chain data sources, supplying information like asset prices.
Question 20: What is a storage collision problem in upgradeable proxy contracts?
- When the proxy and implementation use the same storage slots, causing data corruption during upgrades (Correct answer)
- When a contract exceeds the 2^256 storage slot limit
- When two contracts attempt to write to the same storage slot simultaneously
- When SSTORE opcodes from different transactions conflict in the mempool
Correct answer: When the proxy and implementation use the same storage slots, causing data corruption during upgrades
Storage collision occurs when the proxy contract's own variables occupy the same storage slots as the implementation's variables, corrupting state.
Question 21: What is the maximum stack depth of the EVM?
- 4096 items
- 1024 items (Correct answer)
- 512 items
- 2048 items
Correct answer: 1024 items
The EVM stack has a maximum depth of 1024 items; exceeding this limit causes a stack overflow and reverts execution.
Question 22: What is an Ethereum layer-2 (L2) solution?
- A sidechain that runs independently with its own consensus
- A protocol built on top of Ethereum that processes transactions off-chain while inheriting mainnet security (Correct answer)
- An alternative client implementation of the Ethereum node
- A smart contract upgrade mechanism for existing dApps
Correct answer: A protocol built on top of Ethereum that processes transactions off-chain while inheriting mainnet security
Layer-2 solutions execute transactions off the Ethereum mainnet to increase throughput and reduce fees, periodically settling proofs or data on L1.
Question 23: When developing a game like battleship poker, where you must conceal the values of your opponents,
- Using personal state variables. In this manner, only the smart contract itself and no one else can view the data.
- With agreements outside of the company holding such principles. By doing this, we can ensure that the information flow follows a clear logic and that no one else has access to it.
- Since the information on the blockchain is public and only the call is private, only other smart contracts would be able to access it. This means that nothing can be hidden on the blockchain. (Correct answer)
Correct answer: Since the information on the blockchain is public and only the call is private, only other smart contracts would be able to access it. This means that nothing can be hidden on the blockchain.
All information stored on a public blockchain, including smart contract state variables and transaction data, is inherently transparent and publicly accessible to anyone. There is no mechanism to truly 'hide' data on the blockchain itself. For applications requiring hidden information, such as card games, developers must employ off-chain solutions or cryptographic techniques like commitment schemes, where only hashes are stored on-chain and actual values are revealed later.
Question 24: What is Ethereum bytecode?
- A JSON encoding of contract events
- Human-readable Solidity source code
- Low-level instructions executed directly by the EVM (Correct answer)
- The ABI specification of a contract
Correct answer: Low-level instructions executed directly by the EVM
Bytecode is the compiled, low-level instruction set that the EVM directly interprets and executes during transactions.
Question 25: What does the `emit` keyword do in Solidity?
- Sends Ether to an address
- Fires an event that gets logged on the blockchain (Correct answer)
- Calls an external contract function
- Destroys a contract
Correct answer: Fires an event that gets logged on the blockchain
The `emit` keyword triggers an event, recording a log entry in the transaction receipt on the blockchain.
Question 26: In solidity, the outcome of dividing number -5 by integer 2 is
- -2.5 as a result of the automated casting or conversion into a float.
- -3 as it is always rounded.
- Since Solidity only understands unsigned integers, it is not possible.
- -2 due to the truncated decimal (rounded to zero) (Correct answer)
Correct answer: -2 due to the truncated decimal (rounded to zero)
In Solidity, integer division truncates any decimal part, effectively rounding the result towards zero. Therefore, when dividing -5 by 2, the mathematical result is -2.5, but Solidity's integer division truncates this to -2. This behavior is standard for integer arithmetic in many programming languages.
Question 27: What does `eth_call` do in contrast to `eth_sendTransaction`?
- eth_call simulates a call without modifying state; eth_sendTransaction writes to the chain (Correct answer)
- eth_call is deprecated and replaced by eth_sendTransaction
- eth_call requires a signed transaction; eth_sendTransaction does not
- eth_call sends ETH while eth_sendTransaction calls functions
Correct answer: eth_call simulates a call without modifying state; eth_sendTransaction writes to the chain
`eth_call` executes a function locally without creating a transaction, while `eth_sendTransaction` broadcasts a state-changing transaction.
Question 28: Which Solidity keyword is used to declare a function that cannot modify contract state?
- pure
- immutable
- constant
- view (Correct answer)
Correct answer: view
The `view` keyword declares a function that can read but not modify state variables.
Question 29: How does using Solidity `library` contracts reduce deployment gas costs?
- Libraries bypass the EVM's gas metering
- Libraries store their state in calldata instead of storage
- Libraries are compiled to more efficient opcodes
- Library code is deployed once and reused via delegatecall, shrinking the calling contract's bytecode (Correct answer)
Correct answer: Library code is deployed once and reused via delegatecall, shrinking the calling contract's bytecode
External library functions are deployed once on-chain; contracts that use them reference the single deployment via DELEGATECALL, reducing each contract's bytecode size and deployment cost.
Question 30: What is a flash loan in DeFi?
- An uncollateralized loan that must be borrowed and repaid within a single transaction (Correct answer)
- A loan that expires after one block
- A loan with a very low interest rate
- A loan backed by NFT collateral
Correct answer: An uncollateralized loan that must be borrowed and repaid within a single transaction
Flash loans allow users to borrow any amount without collateral as long as the loan is repaid within the same transaction block.
Question 31: What major change did the Ethereum Merge (2022) introduce?
- Replaced Proof of Work with Proof of Stake consensus (Correct answer)
- Merged Ethereum mainnet with Polygon
- Implemented sharding for parallel transaction processing
- Increased the block size to reduce fees
Correct answer: Replaced Proof of Work with Proof of Stake consensus
The Merge transitioned Ethereum from energy-intensive Proof of Work mining to Proof of Stake, where validators stake ETH to propose blocks.
Certified Blockchain Developer - Ethereum (CBDE)
The CBDE is a performance-based certification that validates practical Ethereum development skills including Solidity smart contract development, EVM mechanics, gas optimization, token standards, DeFi protocols, and Layer 2 scaling solutions. Offered by the Blockchain Training Alliance (BTA).
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds