PrepIQ Certified Web3 Blockchain Developer CW3BD Ultimate Exam, Exams of Technology

The PrepIQ Certified Web3 Blockchain Developer CW3BD Ultimate Exam validates expertise in decentralized application development, blockchain programming, smart contracts, and Web3 integration frameworks. The certification covers Solidity programming, blockchain APIs, decentralized finance development, and secure blockchain architectures. It is ideal for blockchain developers, software engineers, and Web3 professionals seeking advanced blockchain development expertise.

Typology: Exams

2025/2026

Available from 06/03/2026

shilpi-jain-3
shilpi-jain-3 🇮🇳

2.5

(11)

80K documents

1 / 86

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
PrepIQ Certified Web3 Blockchain
Developer CW3BD Ultimate Exam
**Question 1.** Which pragma directive is recommended to ensure compatibility
with Solidity compiler version 0.8.17 and later minor releases?
A) pragma solidity ^0.8.0;
B) pragma solidity >=0.8.17 <0.9.0;
C) pragma solidity =0.8.17;
D) pragma solidity ^0.8.17;
Answer: D
Explanation: The caret (^) allows any version from 0.8.17 up to, but not including,
0.9.0, ensuring compatibility with future minor releases.
**Question 2.** In Solidity, which data type is best suited for storing a fixed-size
20-byte Ethereum address?
A) bytes20
B) address
C) uint160
D) string
Answer: B
Explanation: The `address` type is a 20-byte value specifically designed for
Ethereum addresses and includes useful member functions.
**Question 3.** What is the default visibility of state variables in Solidity if no
visibility keyword is specified?
A) public
B) internal
C) private
D) external
Answer: B
Explanation: State variables are `internal` by default, meaning they are accessible
within the contract and derived contracts but not externally.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56

Partial preview of the text

Download PrepIQ Certified Web3 Blockchain Developer CW3BD Ultimate Exam and more Exams Technology in PDF only on Docsity!

Developer CW3BD Ultimate Exam

Question 1. Which pragma directive is recommended to ensure compatibility with Solidity compiler version 0.8.17 and later minor releases? A) pragma solidity ^0.8.0; B) pragma solidity >=0.8.17 <0.9.0; C) pragma solidity =0.8.17; D) pragma solidity ^0.8.17; Answer: D Explanation: The caret (^) allows any version from 0.8.17 up to, but not including, 0.9.0, ensuring compatibility with future minor releases. Question 2. In Solidity, which data type is best suited for storing a fixed-size 20 - byte Ethereum address? A) bytes B) address C) uint D) string Answer: B Explanation: The address type is a 20-byte value specifically designed for Ethereum addresses and includes useful member functions. Question 3. What is the default visibility of state variables in Solidity if no visibility keyword is specified? A) public B) internal C) private D) external Answer: B Explanation: State variables are internal by default, meaning they are accessible within the contract and derived contracts but not externally.

Developer CW3BD Ultimate Exam

Question 4. Which of the following statements correctly declares a dynamic array of unsigned integers in Solidity? A) uint[] public numbers; B) uint[ ] public numbers; C) uint[dynamic] public numbers; D) uint[] memory numbers; Answer: A Explanation: uint[] declares a dynamic array; adding public makes a getter automatically generated. Question 5. How does the calldata data location differ from memory for function parameters? A) calldata is mutable, memory is immutable. B) calldata is cheaper for external calls and immutable, memory is mutable. C) calldata can only be used for state variables. D) calldata automatically persists after the function ends. Answer: B Explanation: calldata is read-only and resides in the transaction input, making it cheaper for external function parameters; memory is a temporary mutable copy. Question 6. Which modifier should be used to restrict a function so that only the contract owner can call it? A) onlyOwner B) onlyAdmin C) onlyCreator D) onlyDeployer Answer: A Explanation: The conventional OpenZeppelin onlyOwner modifier checks that msg.sender equals the stored owner address.

Developer CW3BD Ultimate Exam

B) while C) do-while D) foreach Answer: D Explanation: Solidity supports for, while, and do-while loops, but not a foreach construct. Question 11. Which of the following is the correct way to emit an event named Transfer with two indexed parameters? A) emit Transfer(address indexed from, address indexed to); B) emit Transfer(from, to); C) Transfer.emit(from, to); D) emit Transfer({from: from, to: to}); Answer: B Explanation: After defining event Transfer(address indexed from, address indexed to);, you emit it with emit Transfer(from, to);. Question 12. What does the override keyword indicate when used in a derived contract function? A) The function hides a state variable. B) The function replaces a function with the same name in a base contract. C) The function can be called only by the owner. D) The function is virtual. Answer: B Explanation: override tells the compiler that this function intentionally replaces a virtual function from a parent contract. Question 13. Which OpenZeppelin contract provides role-based access control without using onlyOwner? A) Ownable B) AccessControl

Developer CW3BD Ultimate Exam

C) Pausable D) ReentrancyGuard Answer: B Explanation: AccessControl allows defining multiple roles and granting/revoking them dynamically. Question 14. In Hardhat, which command compiles the contracts using the configured Solidity version? A) npx hardhat compile B) npx hardhat build C) npx hardhat test D) npx hardhat deploy Answer: A Explanation: hardhat compile triggers compilation according to the hardhat.config.js settings. Question 15. When using Truffle, where are migration scripts typically stored? A) /contracts B) /migrations C) /scripts D) /test Answer: B Explanation: Truffle looks for migration files in the migrations directory. Question 16. Which network ID corresponds to the Ethereum mainnet? A) 1 B) 3 C) 4 D) 42 Answer: A

Developer CW3BD Ultimate Exam

Question 20. Which pattern is recommended to prevent re-entrancy in a withdrawal function? A) Checks-Effects-Interactions B) Pull-Payment only C) Using tx.origin for authentication D) Storing Ether in a separate contract Answer: A Explanation: Performing state changes before external calls (Checks-Effects-Interactions) mitigates re-entrancy risks. Question 21. In the context of ERC-20 tokens, what does the decimals function return? A) The token's total supply. B) The number of decimal places the token uses. C) The token's symbol. D) The token's name. Answer: B Explanation: decimals() indicates how many decimal places the token balances are divided by, typically 18. Question 22. Which interface must a contract implement to be ERC- 721 compliant? A) IERC B) IERC C) IERC D) IERC Answer: B Explanation: ERC-721 defines the IERC721 interface that includes balanceOf, ownerOf, transferFrom, etc.

Developer CW3BD Ultimate Exam

Question 23. What is the purpose of the tokenURI(uint256 tokenId) function in ERC-721? A) Returns the token's owner address. B) Returns the metadata URI for the token. C) Returns the total supply of tokens. D) Returns the token's balance. Answer: B Explanation: tokenURI provides a link (often IPFS) to JSON metadata describing the NFT. Question 24. Which Solidity data location is most appropriate for a function that returns a struct to the caller? A) storage B) memory C) calldata D) payable Answer: B Explanation: Returning complex types requires copying them to memory because external callers cannot access storage directly. Question 25. In an ERC-1155 contract, what does the uri(uint256 id) function typically return? A) A base URI with {id} placeholder. B) The token's owner address. C) The total supply of token id. D) The contract's address. Answer: A Explanation: ERC-1155 defines a single URI with {id} that clients replace with the actual token ID.

Developer CW3BD Ultimate Exam

Question 29. What is the primary security risk of using tx.origin for authentication? A) It can be spoofed by miners. B) It enables phishing through contract calls. C) It does not work on testnets. D) It consumes excessive gas. Answer: B Explanation: tx.origin reflects the original external account, allowing a malicious contract to trick a user into calling it, bypassing intended access controls. Question 30. In a Uniswap V2 pair contract, which function is used to add liquidity? A) addLiquidity B) mint C) swap D) burn Answer: B Explanation: The pair contract's mint function is called by the router to mint LP tokens when liquidity is added. Question 31. Which constant in Solidity represents the maximum value of a uint256? A) type(uint256).max B) UINT256_MAX C) MAX_UINT D) 2**256 - 1 Answer: A Explanation: type(uint256).max returns the maximum value for the type, introduced in Solidity 0.8.0.

Developer CW3BD Ultimate Exam

Question 32. Which of the following is NOT a valid way to declare an enum in Solidity? A) enum State { Pending, Active, Closed } B) enum State { Pending = 0, Active = 1, Closed = 2 } C) enum State { Pending, Active, Closed, } D) enum State { Pending, Active, Closed = 3 } Answer: D Explanation: Enum members cannot be assigned explicit integer values; they are automatically assigned sequentially. Question 33. In a Solidity contract, which function modifier is automatically applied to the fallback function in versions >=0.6.0? A) payable B) external C) view D) pure Answer: B Explanation: Fallback functions must be declared external; they are implicitly external if not specified. Question 34. Which of the following statements about selfdestruct is correct? A) It refunds all remaining gas to the caller. B) It transfers the contract's Ether balance to a specified address and removes bytecode from the chain. C) It can only be called by the contract creator. D) It permanently locks the contract’s storage. Answer: B Explanation: selfdestruct(address payable recipient) sends remaining Ether to recipient and deletes the contract’s code and storage.

Developer CW3BD Ultimate Exam

A) Disables overflow/underflow checks within the block. B) Prevents the function from being called. C) Forces the compiler to ignore warnings. D) Marks the code as unauditable. Answer: A Explanation: unchecked { … } tells the compiler not to insert overflow checks for arithmetic inside the block. Question 39. Which of the following events is emitted by an ERC-20 token when tokens are transferred? A) Transfer(address indexed from, address indexed to, uint256 value) B) Sent(address indexed from, address indexed to, uint256 amount) C) Move(address indexed sender, address indexed receiver, uint256 tokens) D) TokenTransfer(address from, address to, uint256 amount) Answer: A Explanation: The ERC-20 standard defines the Transfer event with those parameters. Question 40. In the context of gas, why is it advisable to use uint256 instead of uint8 for loop counters? A) uint256 is cheaper because it aligns with the 32-byte word size. B) uint8 causes overflow errors more often. C) uint256 reduces the number of opcode executions. D) There is no gas difference. Answer: A Explanation: The EVM operates on 256-bit words; using smaller integer types does not save gas and may add extra conversion cost. Question 41. Which function selector (first 4 bytes of calldata) corresponds to the ERC-20 balanceOf(address) function? A) 0x70a

Developer CW3BD Ultimate Exam

B) 0xa9059cbb C) 0x095ea7b D) 0xdd62ed3e Answer: A Explanation: balanceOf(address) has selector keccak256("balanceOf(address)") [:4] = 0x70a08231. Question 42. In a Solidity contract, which storage location is most gas-efficient for a large, read-only constant string? A) storage B) memory C) calldata D) immutable Answer: D Explanation: Declaring a string public constant or bytes constant stores the data in the contract bytecode, which is cheaper than a storage variable. Question 43. Which of the following is the correct way to declare an immutable address that is set in the constructor? A) address immutable owner; B) address public immutable owner; C) immutable address public owner; D) address public owner immutable; Answer: B Explanation: The syntax is address public immutable owner; and it can be assigned once inside the constructor. Question 44. When using Hardhat's ethers plugin, which method returns a signer object for the first account? A) ethers.getSigner() B) ethers.getSigners()[0]

Developer CW3BD Ultimate Exam

D) import "@openzeppelin/token/ERC721.sol"; Answer: A Explanation: The official path is @openzeppelin/contracts/token/ERC721/ERC721.sol. Question 48. What is the purpose of the nonReentrant modifier provided by OpenZeppelin's ReentrancyGuard? A) Prevents the function from being called by contracts. B) Blocks recursive calls to the same function within the same transaction. C) Limits the gas usage of the function. D) Ensures the function can only be called once per address. Answer: B Explanation: nonReentrant sets a status flag that prevents re-entrancy into the guarded function. Question 49. Which of the following best describes a “front-running” attack in DeFi? A) An attacker submits a transaction with a higher gas price to be mined before a victim’s pending transaction. B) An attacker steals private keys from the victim. C) An attacker manipulates the contract’s storage directly. D) An attacker calls a function after the deadline has passed. Answer: A Explanation: Front-running exploits the mempool ordering by paying higher gas, causing the attacker’s transaction to be mined first. Question 50. In an ERC-20 token contract, which function must return true when the token transfer succeeds? A) transfer(address to, uint256 amount) B) approve(address spender, uint256 amount) C) allowance(address owner, address spender)

Developer CW3BD Ultimate Exam

D) totalSupply() Answer: A Explanation: The ERC-20 transfer function returns a boolean indicating success. Question 51. Which of the following is a recommended practice when writing a Solidity library? A) Use using Library for *; to attach library functions to any type. B) Store library state variables in storage. C) Deploy the library as a proxy contract. D) Include a constructor that sets global variables. Answer: A Explanation: Libraries are stateless; using Library for *; enables syntactic sugar without storing state. Question 52. What is the primary advantage of using delegatecall over call? A) It forwards msg.sender and msg.value unchanged. B) It executes code in the context of the calling contract’s storage. C) It guarantees gas refunds. D) It prevents re-entrancy attacks. Answer: B Explanation: delegatecall runs the callee’s code while preserving the caller’s storage, allowing upgradeable patterns. Question 53. Which function in a Uniswap V3 pool contract is used to set a new fee tier? A) setFee(uint24 newFee) B) setProtocolFee(uint24 fee) C) setFeeTier(uint24 fee) D) setSwapFee(uint24 fee) Answer: B

Developer CW3BD Ultimate Exam

Explanation: A timelock enforces a delay after a proposal succeeds, giving participants time to react. Question 57. Which of the following best describes the purpose of the IERC165 interface? A) To provide a standard way to query contract support for interfaces. B) To define the ERC-20 token standard. C) To implement re-entrancy protection. D) To handle token metadata. Answer: A Explanation: IERC165 defines supportsInterface(bytes4 interfaceId) for interface discovery. Question 58. In the context of gas optimization, which of the following statements is true about constant variables? A) They are stored in storage and cost gas to read. B) Their value is hard-coded into the bytecode, saving gas on reads. C) They can be changed after deployment. D) They must be declared as public. Answer: B Explanation: constant values are embedded in the contract bytecode, making reads free of storage access. Question 59. Which of the following events is emitted by an ERC-721 contract when a token is transferred? A) Transfer(address indexed from, address indexed to, uint256 indexed tokenId) B) Sent(address indexed from, address indexed to, uint256 tokenId) C) TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value) D) TokenMoved(address from, address to, uint256 id) Answer: A

Developer CW3BD Ultimate Exam

Explanation: ERC-721 defines a Transfer event with the tokenId indexed. Question 60. Which of the following is a correct way to make a function that can only be called by a contract that implements a specific interface? A) require(IERC20(msg.sender).balanceOf(msg.sender) >= 0); B) require(msg.sender.isContract()); C) require(msg.sender == address(this)); D) require(msg.sender.supportsInterface(type(IERC20).interfaceId)); Answer: D Explanation: Using ERC-165’s supportsInterface allows checking if msg.sender implements a given interface. Question 61. What does the keccak256 function return in Solidity? A) A 256-bit hash as bytes32. B) A 128-bit hash as bytes16. C) A string representation of the hash. D) An integer modulo 2^256. Answer: A Explanation: keccak256 computes the Keccak-256 hash and returns a bytes32 value. Question 62. Which of the following is the correct way to declare a Solidity interface that only contains function signatures? A) interface IMyInterface { function foo() external; } B) contract IMyInterface { function foo() external; } C) abstract IMyInterface { function foo() external; } D) library IMyInterface { function foo() external; } Answer: A Explanation: Interfaces are declared with the interface keyword and contain only function signatures without implementations.