












































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













































































Question 1. What is the primary function of a blockchain's distributed ledger? A) To centralize transaction records for quick access B) To ensure data integrity and transparency across multiple participants C) To reduce transaction costs by eliminating miners D) To encrypt all data with a single cryptographic key Answer: B Explanation: A distributed ledger allows multiple participants to maintain a synchronized, transparent record of transactions, ensuring data integrity and reducing the need for a central authority. Question 2. Which type of blockchain is accessible to anyone and allows permissionless transactions? A) Private blockchain B) Consortium blockchain C) Public blockchain D) Federated blockchain Answer: C Explanation: Public blockchains are open to all participants, allowing anyone to join, validate transactions, and view the ledger, exemplified by Bitcoin and Ethereum. Question 3. In blockchain architecture, what is stored within each block? A) Only transaction hashes B) Transactions, timestamp, and a reference to the previous block C) The entire blockchain history D) User account balances Answer: B Explanation: Each block contains a set of transactions, a timestamp, and a cryptographic hash linking it to the previous block, forming the chain.
Question 4. Which consensus mechanism requires miners to solve computational puzzles to add new blocks? A) Proof-of-Stake B) Proof-of-Work C) Delegated Proof-of-Stake D) Practical Byzantine Fault Tolerance Answer: B Explanation: Proof-of-Work (PoW) involves miners solving complex cryptographic puzzles to validate and add new blocks, ensuring security through computational effort. Question 5. What is a key implication of blockchain immutability? A) Transactions can be easily reversed B) Once data is recorded, it cannot be altered or deleted C) Data can be edited with proper permissions D) It reduces the need for cryptographic hashes Answer: B Explanation: Immutability means that once data is added to the blockchain, it cannot be changed or deleted, ensuring data integrity and trustworthiness. Question 6. Which principle best describes decentralization in blockchain? A) Control and decision-making are concentrated in a single authority B) Power is distributed among multiple participants, reducing single points of failure C) Transactions are processed only by trusted intermediaries D) Data is stored on centralized servers Answer: B Explanation: Decentralization distributes control across multiple nodes, enhancing security, censorship resistance, and fault tolerance.
Question 10. Which cryptographic method is primarily used for generating key pairs in blockchain? A) Symmetric encryption B) Public-key cryptography (RSA, ECC) C) Hashing algorithms D) Steganography Answer: B Explanation: Public-key cryptography generates a pair of keys—public and private—that are used for secure signing and verification in blockchain systems. Question 11. Why is the private key considered critical to blockchain security? A) It is used to encrypt all transactions publicly B) It grants control over the associated account and must remain secret C) It is shared among all network participants D) It is used to generate transaction IDs Answer: B Explanation: The private key allows the owner to sign transactions and access funds; its secrecy is essential to prevent unauthorized access. Question 12. What is a Merkle tree primarily used for in blockchain? A) To encrypt transaction data B) To efficiently verify the integrity of large data sets C) To generate random numbers D) To replace cryptographic hashes Answer: B Explanation: Merkle trees enable efficient and secure verification of data integrity by hashing transactions in a hierarchical structure.
Question 13. Which platform introduced the Ethereum Virtual Machine (EVM)? A) Bitcoin B) Ethereum C) Hyperledger Fabric D) Ripple Answer: B Explanation: Ethereum's EVM is a runtime environment for smart contracts, enabling platform-agnostic execution of code on the Ethereum blockchain. Question 14. What is the primary purpose of "gas" in Ethereum? A) To measure the computational effort required for transactions and smart contract execution B) To serve as a cryptocurrency token C) To encrypt transactions D) To store user account balances Answer: A Explanation: Gas quantifies the computational resources consumed by transactions, preventing abuse and incentivizing miners. Question 15. Which type of Ethereum account is controlled solely by a private key and can initiate transactions? A) Contract account B) Externally Owned Account (EOA) C) Multisignature account D) Delegated account Answer: B
Explanation: Structs in Solidity enable grouping related data of various types into a single composite data structure. Question 19. Which Solidity data type is used to create a fixed-size sequence of elements? A) Array B) Struct C) Enum D) Mapping Answer: A Explanation: Arrays in Solidity are used to store ordered collections of elements, either fixed or dynamic in size. Question 20. How does "require" differ from "assert" in Solidity error handling? A) "Require" checks for conditions before execution; "assert" is for internal errors B) "Require" is used for internal errors; "assert" checks user input C) They are interchangeable D) "Require" consumes more gas than "assert" Answer: A Explanation: "Require" validates external input and conditions, reverting on failure with a reason, while "assert" checks for invariants and internal errors. Question 21. What is the purpose of a Solidity modifier? A) To restrict access to functions or add pre/post conditions B) To declare a new data type C) To optimize gas usage D) To handle errors Answer: A
Explanation: Modifiers alter function behavior, often used for access control or input validation. Question 22. Which Solidity keyword is used to declare a function that can only be called from within the contract or its derivatives? A) public B) external C) internal D) private Answer: C Explanation: "internal" restricts function access to the contract itself and derived contracts. Question 23. What is the main purpose of fallback and receive functions in Solidity? A) To handle data validation B) To process plain Ether transfers and fallback logic when no other function matches C) To deploy contracts D) To manage ownership Answer: B Explanation: "receive" handles plain Ether transfers, while "fallback" manages calls to non-existent functions or data. Question 24. Which of the following is a primary gas optimization technique in Solidity? A) Using dynamic arrays excessively B) Minimizing storage writes C) Avoiding use of "require" D) Using "assert" for validation Answer: B
Explanation: The Checks-Effects-Interactions pattern ensures state changes occur before external calls, mitigating reentrancy. Question 28. Which cryptographic property ensures that a hash function produces a unique output for each unique input? A) Pre-image resistance B) Collision resistance C) Determinism D) Non-reversibility Answer: B Explanation: Collision resistance prevents different inputs from producing the same hash, ensuring data uniqueness. Question 29. Which elliptic curve cryptography standard is commonly used in blockchain digital signatures? A) RSA B) ECC (e.g., secp256k1) C) DES D) AES Answer: B Explanation: ECC, specifically secp256k1, is used for generating compact, secure signatures in blockchain systems like Bitcoin and Ethereum. Question 30. What is the primary purpose of a Merkle root in a block header? A) To identify the miner B) To summarize all transactions' hashes for quick integrity verification C) To encrypt transaction data
D) To store the block timestamp Answer: B Explanation: The Merkle root summarizes all transaction hashes, enabling efficient and secure verification of block data. Question 31. Which network type is suitable for deploying smart contracts during development and testing? A) Mainnet B) Testnet C) Mainframe D) Private network only Answer: B Explanation: Testnets like Goerli or Sepolia are used for development and testing without risking real assets. Question 32. Which tool is primarily used for deploying and testing Solidity smart contracts locally? A) Remix IDE B) MySQL C) Visual Studio Code D) Postman Answer: A Explanation: Remix IDE is a popular web-based environment for writing, compiling, deploying, and testing Solidity contracts locally. Question 33. What is the purpose of an ABI (Application Binary Interface) in Ethereum? A) To encrypt smart contract data B) To define how to interact with a deployed contract's functions and data
B) send() C) sendTransaction() D) transact() Answer: B Explanation: The "send()" method initiates a state-changing transaction on the blockchain. Question 37. When building a frontend UI for a smart contract, which wallet integration allows users to sign transactions? A) MetaMask B) MyEtherWallet C) Coinbase Wallet D) All of the above Answer: D Explanation: All listed options enable users to connect, sign, and approve transactions via wallet integrations. Question 38. What is one of the main challenges addressed by smart contract upgradability patterns? A) Contract size limitations B) Immutability preventing bug fixes or feature additions C) Gas cost reduction D) Enhancing cryptographic security Answer: B Explanation: Upgradability patterns enable modification or replacement of smart contracts despite their inherent immutability. Question 39. Which pattern involves deploying a proxy contract that delegates calls to an implementation contract?
A) Factory pattern B) Upgradeable proxy pattern C) Singleton pattern D) Observer pattern Answer: B Explanation: The upgradeable proxy pattern uses a proxy contract to delegate calls, allowing upgrades by changing the implementation address. Question 40. Which DeFi activity involves providing assets to earn interest or rewards? A) Lending B) Borrowing C) Swapping D) Staking Answer: A Explanation: Lending involves depositing assets into protocols to generate interest and liquidity rewards. Question 41. What is the core standard for creating non-fungible tokens (NFTs)? A) ERC- 20 B) ERC- 721 C) ERC- 1155 D) ERC- 777 Answer: B Explanation: ERC-721 defines the standard interface for non-fungible tokens, ensuring uniqueness and transferability. Question 42. How does ERC-1155 differ from ERC-721?
A) Hardware oracle B) Software oracle C) Consensus oracle D) All of the above Answer: D Explanation: Different oracle types—hardware, software, and consensus—provide external data to smart contracts securely. Question 46. What is a common approach to achieve cross-chain communication? A) Using centralized exchanges B) Implementing interoperability protocols and cross-chain bridges C) Relying solely on smart contract upgrades D) Using private blockchains only Answer: B Explanation: Cross-chain interoperability often employs protocols and bridges to facilitate communication between different blockchain networks. Question 47. Which Layer-2 scaling solution involves aggregating multiple transactions into a single batch processed off-chain? A) Rollups B) Sidechains C) State channels D) All of the above Answer: D Explanation: All listed Layer-2 solutions—rollups, sidechains, and state channels—aim to increase scalability by processing transactions off the main chain.
Question 48. What is the primary challenge that Layer-2 solutions aim to address? A) Transaction privacy B) Network congestion and high gas fees C) Data immutability D) Consensus mechanism complexity Answer: B Explanation: Layer-2 solutions reduce network congestion and lower transaction costs by handling transactions off-chain. Question 49. Which process involves auditing smart contracts for security vulnerabilities before deployment? A) Formal verification B) Code review and static analysis C) Penetration testing D) Both B and A Answer: D Explanation: Both static analysis and formal verification are critical in identifying vulnerabilities and ensuring contract security. Question 50. Which is an example of a static analysis tool commonly used for Solidity? A) MythX B) OpenZeppelin Defender C) Remix IDE D) Hardhat Answer: A Explanation: MythX is a popular static analysis tool that scans Solidity code for security vulnerabilities.
Question 54. What is the main purpose of formal verification in smart contract development? A) To optimize gas costs B) To mathematically prove correctness and security properties C) To generate ABI files D) To deploy contracts faster Answer: B Explanation: Formal verification uses mathematical methods to ensure a contract's logic adheres to specified security and correctness properties. Question 55. Which legal consideration is relevant when deploying smart contracts? A) Intellectual property rights B) Regulatory compliance C) Liability and enforceability D) All of the above Answer: D Explanation: Smart contracts may have legal implications regarding IP, compliance, and enforceability, depending on jurisdiction. Question 56. Which development environment is often used for writing, testing, and deploying Solidity contracts? A) Visual Studio Code with Hardhat or Truffle B) Eclipse IDE C) IntelliJ IDEA D) Notepad++ Answer: A Explanation: Visual Studio Code combined with tools like Hardhat or Truffle provides a comprehensive environment for Solidity development.
Question 57. What is the primary purpose of a deployment script in smart contract development? A) To automate the deployment process across networks B) To compile smart contracts C) To write unit tests D) To manage user interfaces Answer: A Explanation: Deployment scripts automate deploying contracts, managing network configurations, and recording deployment details. Question 58. How can developers test smart contracts efficiently? A) Manual testing on mainnet B) Writing unit and integration tests using frameworks like Mocha and Chai C) Deploying to production without testing D) Relying solely on code reviews Answer: B Explanation: Automated testing with frameworks enables thorough, repeatable, and efficient validation of contract behavior. Question 59. Which network is commonly used for testing smart contracts without risking real assets? A) Ethereum mainnet B) Goerli or Sepolia testnets C) Binance Smart Chain mainnet D) Private network only Answer: B Explanation: Testnets like Goerli or Sepolia simulate mainnet conditions for safe testing of contracts.