About this Question Bank
This panel collects every question from the course in one place: 480 moderate-level questions with answers and the answer key for 160 MCQs from 32 chapters and projects, plus 20 Solidity interview questions. Use it for revision before the certificate examination.
Solidity Interview Questions and Answers
References: Solidity Team. (n.d.). Solidity Documentation (latest). · Solidity Team. (n.d.). Contracts (creating contracts, visibility and getters, function modifiers, constant and immutable, functions, events, custom errors, inheritance, abstract contracts, interfaces, libraries). Solidity Documentation. · Solidity Team. (n.d.). Security Considerations. Solidity Documentation. · ethereum.org. (n.d.). Introduction to smart contracts. Ethereum Developer Documentation. · Antonopoulos, A. M., & Wood, G. (2018). Mastering Ethereum: Building Smart Contracts and DApps. O’Reilly Media.
Prerequisite : Prerequisite : Programming Basics for Solidity
Read the notes, watch the video & take the MCQ test »
uint count = 10;.is keyword, including multiple inheritance.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Solidity source code is converted into EVM bytecode by: | B. The solc compiler |
| 2 | In Solidity, a contract is most similar to which OOP concept? | C. Class |
| 3 | A statically typed language checks variable types: | A. At compile time |
| 4 | Which statement about deployed smart-contract code is TRUE? | D. It is immutable once deployed |
| 5 | 1 ether is equal to: | C. 10^18 wei |
Ch-1 : Solidity / Remix : Solidity and Remix IDE Setup
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Solidity is designed to target: | B. The Ethereum Virtual Machine |
| 2 | Which file describes a contract’s functions so a front end can call it? | A. ABI |
| 3 | Which Remix environment is an in-browser test blockchain with pre-funded accounts? | C. Remix VM |
| 4 | Solidity was proposed in 2014 by: | D. Gavin Wood |
| 5 | Calling a function that changes a state variable requires: | B. A transaction that costs gas |
Ch-2 : Basic Syntax : Solidity Basic Syntax
Read the notes, watch the video & take the MCQ test »
pragma solidity ^0.8.20;, states which compiler versions are allowed to compile the file.// SPDX-License-Identifier: MIT to declare their licence in a machine-readable way.UNLICENSED, i.e. // SPDX-License-Identifier: UNLICENSED.import "./Token.sol"; imports all symbols, and import {Token} from "./Token.sol"; imports only the named symbol.MAX_SUPPLY.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which line is normally the first line of a Solidity file? | A. // SPDX-License-Identifier: MIT |
| 2 | Which compiler version is NOT allowed by pragma solidity ^0.8.20;? | D. 0.9.0 |
| 3 | SPDX identifiers describe a file’s: | B. Software licence |
| 4 | Which comment style is used for NatSpec documentation? | C. /// comment |
| 5 | According to the Solidity style guide, a constant should be named: | D. MAX_SUPPLY |
Ch-3 : DataTypes : Solidity Data Types
Read the notes, watch the video & take the MCQ test »
.balance.address payable has the .transfer() and .send() members for sending Ether to it. A plain address is converted with payable(addr).uint is an alias for uint256, and int is an alias for int256.type(T).max, for example type(uint8).max returns 255; type(T).min returns the minimum.fixed and ufixed can be declared but values cannot be assigned to or from them, so decimals are represented with integers, such as amounts in wei.mapping(KeyType => ValueType) name;, for example mapping(address => uint) balances;.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which of the following is a REFERENCE type? | C. string |
| 2 | An Ethereum address occupies: | A. 20 bytes |
| 3 | What is the default value of a bool variable? | D. false |
| 4 | What is the maximum value of uint8? | B. 255 |
| 5 | Which member is available on address payable but not on plain address? | C. .transfer() |
Ch-4 : Variable : Solidity Variables and Data Locations
Read the notes, watch the video & take the MCQ test »
uint x = 5;), inside the constructor at deployment, or later through a setter function called by a transaction.msg.sender (address of the current caller) and block.timestamp (timestamp of the current block). Others include msg.value and block.number.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which data location is READ-ONLY? | C. calldata |
| 2 | A variable declared at contract level outside any function is a: | A. State variable |
| 3 | Which keyword declares a value assigned once in the constructor and never changed? | D. immutable |
| 4 | Assigning a storage array to a memory variable: | B. Creates an independent copy |
| 5 | Which of these is a global variable? | C. msg.sender |
Ch-5 : Scope of Variables : Scope and Visibility of Variables
Read the notes, watch the video & take the MCQ test »
{ } block, following C99 scoping rules. It cannot be used outside that block.publicData(). For arrays and mappings the getter takes an index or key as a parameter.p.publicData().publicData). Calling the getter with this.publicData() would make an external call, which is unnecessary and costs more gas.function balances(address) external view returns (uint), which takes a key and returns the stored value.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which visibility automatically creates a getter function? | C. public |
| 2 | The default visibility of a state variable is: | A. internal |
| 3 | A private variable of a parent contract is accessible in: | D. Only the contract that defines it |
| 4 | A local variable declared inside a for-loop body can be used: | B. Only inside that loop body block |
| 5 | Which statement about private state variables is TRUE? | C. Their values can still be read by anyone off-chain |
Ch-6 : Operators : Solidity Operators
Read the notes, watch the video & take the MCQ test »
7 % 2 = 1.unchecked { ... } disables overflow/underflow checks inside the block, so results wrap around and gas is saved. It should be used only when overflow is impossible, for example a loop counter with a known small bound.a && b, b is not evaluated when a is false; in a || b, b is not evaluated when a is true. Ordering conditions well can save gas and avoid unnecessary calls.condition ? valueIfTrue : valueIfFalse, e.g. uint larger = (a > b) ? a : b;.x << n moves bits left n places, multiplying by 2^n (12 << 1 = 24); x >> n moves bits right, dividing by 2^n (12 >> 2 = 3).-7 / 2 = -3 (truncated towards zero) and -7 % 2 = -1 (the remainder takes the sign of the left operand).keccak256(bytes(a)) == keccak256(bytes(b)).total += price;MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | For uint values, 9 / 4 evaluates to: | B. 2 |
| 2 | In Solidity 0.8, uint8 x = 255; x = x + 1; (outside unchecked) will: | C. Revert the transaction |
| 3 | Which operator returns true only if both conditions are true? | A. && |
| 4 | What is 12 >> 2? | D. 3 |
| 5 | Which statement about unchecked { } is correct? | A. It disables overflow checks so values wrap around |
Ch-7 : Decision Making : Decision Making (if, else if, else)
Read the notes, watch the video & take the MCQ test »
if (condition) { /* code to run if condition is true */ }if (condition) { /* true block */ } else { /* false block */ }if (c1) { ... } else if (c2) { ... } else if (c3) { ... } else { ... } – the first true condition’s block runs and the others are skipped.if (count) is a compile error; write if (count != 0).marks >= 40 were tested before marks >= 90, a score of 95 would wrongly receive the lower grade.return marks >= 40 ? "Pass" : "Fail";. Complex logic is clearer with if…else.if (n % 2 == 0) { /* even */ }.if (marks >= 40 && marks < 60) { ... }.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which of these conditions is VALID in Solidity? | B. if (count != 0) |
| 2 | Solidity’s replacement for a switch statement is: | C. an if…else if…else chain |
| 3 | With the GradeCalculator, grade(80) returns: | A. A |
| 4 | In an if…else if chain, how many blocks run at most? | D. One |
| 5 | marks >= 40 ? "Pass" : "Fail" with marks = 35 returns: | A. "Fail" |
Ch-8 : Loop : Loops in Solidity
Read the notes, watch the video & take the MCQ test »
for (initialisation; condition; update) { ... } – the initial value of the counter, the test condition and the increment/decrement step.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which loop always executes its body at least once? | C. do…while |
| 2 | Which statement exits a loop immediately? | B. break |
| 3 | The main risk of looping over a user-growable array in a transaction is: | D. Exceeding the gas limit |
| 4 | What does sumTo(5) return? | C. 15 |
| 5 | In a for loop, which part runs after each iteration? | B. Update (increment/decrement) |
Ch-9 : String : Strings in Solidity
Read the notes, watch the video & take the MCQ test »
bytes(s).length. This returns the number of bytes, which can be larger than the number of characters for non-ASCII text.keccak256(bytes(a)) == keccak256(bytes(b)). The == operator is not defined for strings.string.concat(a, b, ...), available from Solidity 0.8.12. Older code used string(abi.encodePacked(a, b)).bytes memory bstr = new bytes(10); string memory message = string(bstr);bytes(s)[0] returns the first byte as bytes1.unicode"नमस्ते ₹". Regular string literals may contain only printable ASCII characters (plus escape sequences).bytes(s).length == 0.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which expression correctly compares two strings a and b? | C. keccak256(bytes(a)) == keccak256(bytes(b)) |
| 2 | bytes("Hello").length returns: | C. 5 |
| 3 | Which function joins strings in Solidity 0.8.12 and later? | B. string.concat |
| 4 | Which data location is read-only and suited to external string parameters? | D. calldata |
| 5 | Solidity strings are encoded as: | A. UTF-8 |
Ch-10 : Array : Arrays in Solidity
Read the notes, watch the video & take the MCQ test »
<type>[size] name; e.g. uint[5] marks;. Dynamic arrays: <type>[] name; e.g. uint[] scores;.arr.length - 1, because indexing starts at 0.uint[] memory a = new uint[](n);. Its length is fixed once created, so push and pop are not available.x[start:end] is a view of part of an array, from start up to (not including) end. Slices are currently supported only for calldata arrays.scores(0). To return the whole array, write a function returning uint[] memory.uint total; for (uint i = 0; i < scores.length; i++) { total += scores[i]; }uint[][] grid; or uint[3][2] table;. Note that uint[3][2] is two arrays of three elements each (the notation is reversed compared with some other languages).MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which declaration creates a FIXED-size array of 5 unsigned integers? | C. uint[5] a; |
| 2 | After delete arr[1] on a 4-element uint array, the length is: | A. 4 |
| 3 | Which operation is NOT available on a memory array created with new? | D. arr.push(x) |
| 4 | Array slices like data[0:2] are supported for: | A. calldata arrays |
| 5 | Accessing arr[arr.length] will: | B. Revert with a Panic error |
Ch-11 : Enum : Enums in Solidity
Read the notes, watch the video & take the MCQ test »
enum Status { Placed, Shipped, Delivered }.uint(status) converts to an integer, and Status(n) converts an integer back. Implicit conversion is not allowed.type(Status).min and type(Status).max.enum candidateCode {AJIT, ASHISH, MAYANK, KUNAL, NOTA}. It gives each candidate a readable name that is converted to a number to use as the key of the candidate mapping.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | For enum Color { Red, Green, Blue }, what is uint(Color.Blue)? | D. 2 |
| 2 | The default value of an enum variable is: | A. Its first member |
| 3 | The maximum number of members in an enum is: | C. 256 |
| 4 | Converting Status(10) when Status has 4 members will: | B. Revert |
| 5 | In the ABI, an enum value is passed as: | D. uint8 |
Ch-12 : Mapping : Mapping in Solidity
Read the notes, watch the video & take the MCQ test »
mapping(KeyType => ValueType) visibility name;, for example mapping(address => uint) public balances;.balances(address) that takes a key and returns the corresponding value.mapping(address => mapping(address => uint)) allowance;, used in ERC-20 tokens to store how much each owner allows each spender to use.mapping(key => bool) isRegistered or a struct with an exists flag.mapping(address user => uint balance) balances;. The names do not change behaviour.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which of these CANNOT be used as a mapping key? | D. struct |
| 2 | Reading balances[x] for an address never set returns: | A. 0 |
| 3 | Mappings can be stored in: | C. storage only |
| 4 | Which statement is TRUE about mappings? | B. They cannot be iterated directly |
| 5 | mapping(address => mapping(address => uint)) is an example of a: | A. Nested mapping |
Ch-13 : Struct : Structs in Solidity
Read the notes, watch the video & take the MCQ test »
struct StructName { type1 member1; type2 member2; }Student("Asha", 101, 92); named arguments: Student({name: "Ravi", roll: 102, marks: 85}); or declare an empty memory struct and assign each member separately.Student[] students; and use students.push(s), or declare mapping(uint => Student) byRoll; and assign byRoll[roll] = s.s.marks or students[0].name.students(0) returns name, roll and marks.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | A struct is used to: | B. Group related variables of different types |
| 2 | Which statement updates a stored struct permanently? | B. Student storage s = students[0]; s.marks = 90; |
| 3 | Student({name: "Ravi", roll: 2, marks: 80}) creates a struct using: | C. Named arguments |
| 4 | Structs declared outside a contract are shared with other files using: | D. import |
| 5 | A struct cannot directly contain: | D. A member of its own type |
Ch-14 : Global Variables : Global Variables and Special Functions
Read the notes, watch the video & take the MCQ test »
address(this).balance, which returns the balance in wei.payable(msg.sender).MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Alice calls contract A, which calls contract B. Inside B, msg.sender is: | C. Contract A |
| 2 | Which global variable should be used for access control? | A. msg.sender |
| 3 | Which keyword was removed in Solidity 0.7.0? | B. now |
| 4 | 1 ether equals: | D. 10^18 wei |
| 5 | Which value replaced block.difficulty after the move to Proof-of-Stake? | C. block.prevrandao |
Ch-15 : Functions : Functions in Solidity
Read the notes, watch the video & take the MCQ test »
function name(parameters) visibility [mutability] [modifiers] [returns (types)] { ... }, e.g. function add(uint a, uint b) public pure returns (uint) { return a + b; }.function divide(uint a, uint b) public pure returns (uint q, uint r) { q = a / b; r = a % b; } returns both the quotient and remainder.(uint q, ) = divide(17, 5);.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | A function that reads state but does not modify it should be marked: | B. view |
| 2 | Which visibility allows calls ONLY from the same contract (not children)? | D. private |
| 3 | Which function can receive Ether? | A. function pay() external payable {} |
| 4 | Two functions named area with different parameter lists is an example of: | C. Overloading |
| 5 | In the example, useDivide() returns: | B. 3 |
Ch-16 : Contracts : Contracts in Solidity
Read the notes, watch the video & take the MCQ test »
// SPDX-License-Identifier: MIT declares the file’s licence.Wallet w = new Wallet(msg.sender, label);. This deploys a new instance and returns a reference to it.address(w). Inside a contract, address(this) gives its own address.wallets[index].owner(); this performs an external message call.Wallet[] wallets), and they can be converted to and from addresses.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | A contract in Solidity is a combination of: | A. Functions and state at an address |
| 2 | Which keyword deploys a contract from another contract? | C. new |
| 3 | An abstract contract: | B. Cannot be deployed directly |
| 4 | Which unit has NO state of its own and provides reusable functions? | D. Library |
| 5 | In this course, BOP stands for: | A. Block Oriented Programming |
Ch-17 : Constructor : Constructors in Solidity
Read the notes, watch the video & take the MCQ test »
constructor() {}.contract B is A(10) {}, or in the derived constructor’s header, e.g. constructor(uint x) A(x) { }.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | A constructor runs: | B. Once, at deployment |
| 2 | How many constructors can a Solidity contract have? | A. One |
| 3 | Which keyword lets a constructor receive Ether during deployment? | D. payable |
| 4 | Since Solidity 0.7.0, to prevent direct deployment of a base contract you: | C. Mark the contract abstract |
| 5 | contract B is A(10) {} passes 10 to: | A. A’s constructor |
Ch-18 : Inheritance : Inheritance in Solidity
Read the notes, watch the video & take the MCQ test »
is keyword.contract B is A.contract C is A, B. Solidity supports this, unlike Java.super.functionName(), which calls the next contract in the linearization, or explicitly with ParentName.functionName().contract C is A, B.contract B is A(5), or in its own constructor header, e.g. constructor(string memory n) Person(n) {}.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which keyword declares that contract B inherits from contract A? | C. is |
| 2 | To allow a function to be overridden, the parent function must be marked: | B. virtual |
| 3 | A parent contract with several child contracts is: | D. Hierarchical inheritance |
| 4 | Which members of a parent are NOT accessible in a child contract? | B. private |
| 5 | If B inherits from A, which declaration is valid? | D. contract C is A, B |
Ch-19 : Interfaces : Interfaces in Solidity
Read the notes, watch the video & take the MCQ test »
contract Counter is ICounter { function increment() external override { ... } }.ICounter(addr).increment();.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which of these CAN be declared inside an interface? | C. An event |
| 2 | All functions in an interface must be: | A. external |
| 3 | ICounter(addr).increment() does what? | B. Calls increment on the contract at addr |
| 4 | Which is TRUE about interfaces and abstract contracts? | D. Neither can be deployed |
| 5 | An interface can inherit from: | D. Only other interfaces |
Ch-20 : Events : Events in Solidity
Read the notes, watch the video & take the MCQ test »
event Deposited(address indexed from, uint amount);, and trigger it inside a function with emit Deposited(msg.sender, msg.value);.contract.getPastEvents('EventName', { filter, fromBlock, toBlock }), which returns matching events and their returnValues.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which keyword triggers an event? | A. emit |
| 2 | Event data is stored in: | B. Transaction logs |
| 3 | Up to how many parameters of a normal event can be indexed? | D. Three |
| 4 | Which statement about events is TRUE? | C. Contracts cannot read events |
| 5 | Indexed event parameters are stored as: | A. Topics |
Ch-21 : Error Handling : Error Handling in Solidity
Read the notes, watch the video & take the MCQ test »
require(msg.value > 0, "Send Ether");. A false condition reverts with the given message.if (x > y) revert TooLarge(x);.error InsufficientBalance(uint available, uint required);, and raised with revert. They cost less gas than long error strings and can carry useful data.catch (bytes memory data) block, because custom errors are not Error(string) or Panic(uint); they are delivered as raw encoded error data.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which statement is best for validating user input at the start of a function? | B. require |
| 2 | A failing assert produces which error type? | A. Panic(uint256) |
| 3 | When a transaction reverts, the state changes it made are: | D. Undone completely |
| 4 | Custom errors were introduced in Solidity version: | C. 0.8.4 |
| 5 | try/catch in Solidity can be used with: | A. External calls and contract creation |
Ch-22 : Modifier : Function Modifiers in Solidity
Read the notes, watch the video & take the MCQ test »
_; symbol (also called the placeholder). It is replaced by the body of the function the modifier is applied to, marking where that body executes.modifier onlyOwner() { require(msg.sender == owner, "Only owner"); _; }, applied as function withdraw() public onlyOwner { ... }.modifier costs(uint price) { require(msg.value == price, "Wrong amount"); _; }, used as function buy() external payable costs(0.01 ether) { ... }.onlyOwner and onlyOwner() are accepted.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | In a modifier, the symbol _; represents: | B. The function body being inserted |
| 2 | Code written AFTER _; in a modifier runs: | A. After the function body |
| 3 | function f() public onlyOwner whenOpen – which modifier runs first? | D. onlyOwner |
| 4 | If a require inside a modifier fails: | C. The whole call reverts |
| 5 | Which modifier pattern protects against reentrancy? | B. nonReentrant |
Ch-23 : Fallback/Receive : Fallback and Receive Functions
Read the notes, watch the video & take the MCQ test »
fallback() external [payable], that runs when a call does not match any function in the contract, or when Ether is sent with empty calldata and no receive function exists.receive() external payable that runs when the contract receives plain Ether with empty calldata, for example via send, transfer or a wallet transfer.function() external payable { }. Since 0.6.0 it is split into receive() and fallback().fallback(bytes calldata input) external returns (bytes memory output); otherwise msg.data can be read inside a fallback with no parameters.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | A plain Ether transfer with empty calldata to a contract that has receive() runs: | A. receive() |
| 2 | A call to a function name that does not exist in the contract runs: | C. fallback() |
| 3 | receive() must be declared as: | D. external payable |
| 4 | How much gas do transfer() and send() forward to the recipient? | D. 2300 |
| 5 | If a contract has neither receive() nor a payable fallback(), sending it plain Ether will: | B. Revert |
Ch-24 : Payable Functions : Payable Functions and Sending Ether
Read the notes, watch the video & take the MCQ test »
require(msg.value > 0) or require(msg.value == price).address(this).balance, which returns the balance in wei.payable(addr).addr.transfer(amount), addr.send(amount) and addr.call{value: amount}("").address.call{value: amount}(""); gas can be set with {value: amount, gas: g}.1 ether, 0.01 ether or 1 gwei.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which keyword allows a function to receive Ether? | B. payable |
| 2 | Which method returns false instead of reverting when sending fails? | B. send |
| 3 | The recommended way to send Ether in modern Solidity is: | C. addr.call{value: x}("") with a success check |
| 4 | In checks-effects-interactions, Ether should be sent: | D. After updating state |
| 5 | address(this).balance returns: | A. The contract’s Ether balance in wei |
Project 1 : Smart Contract Election System : Project 1 : Smart Contract for Election System
Read the notes, watch the video & take the MCQ test »
blockAdmin = msg.sender;, so the deploying account becomes the admin.struct Candidate { string candidateName; string candidateParty; uint voteCount; }, defined at file level in CandidateMaster.sol and imported into VotePanelContract.sol.uint(type(candidateCode).max) + 1. The last enum member NOTA has value 4, so the total is 5.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | In the Election contract, who becomes the BlockAdmin? | B. The account that deploys the contract |
| 2 | uint(type(candidateCode).max) + 1 evaluates to: | C. 5 |
| 3 | Which modifier prevents double voting? | A. checkVoterCasting() |
| 4 | Where are the addresses of voters stored? | D. In the dynamic array votersList |
| 5 | Which data structure gives a constant-cost “has voted” check? | A. mapping(address => bool) |
Project 2 : Smart Contract Lottery System : Project 2 : Smart Contract for Lottery System
Read the notes, watch the video & take the MCQ test »
struct UserRecord { address useraddress; string username; uint amount; uint winningAmount; }, defined in UserRecord.sol.uint(keccak256(abi.encodePacked(msg.sender, block.timestamp, startvalue))) % userlimit – a hash of the caller, the block timestamp and a constant, reduced modulo 5.mapping(address => bool) hasTicket, which checks in constant time whether an address has already bought a ticket.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | In the teaching version, the winner index is calculated modulo: | B. userlimit (5) |
| 2 | Which function combines values into bytes before hashing? | A. abi.encodePacked |
| 3 | Which source gives verifiable randomness to smart contracts? | C. A VRF oracle |
| 4 | Which modifier stops the same address from buying two tickets? | D. checkTicketUserCount |
| 5 | To accept real Ether for a ticket, the purchase function must be: | A. payable |
Project 3 : Smart Contract Bidding/e-Auction System : Project 3 : Smart Contract for Bidding / e-Auction System
Read the notes, watch the video & take the MCQ test »
auctionManager.transfer(msg.value), which requires an address payable.checkBidValue(uint bidderValue) requires the new bid to be greater than maxBidValue, otherwise the bid is rejected.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | In the AuctionContract, each new bid must be: | C. Greater than the current maximum |
| 2 | checkBidValue(uint bidderValue) is an example of: | C. A modifier with an argument |
| 3 | A winning bid of 3 (ETH) requires msg.value of: | D. 3 × 10^18 wei |
| 4 | Which function must be payable for the winner to pay? | B. transferBidAmount |
| 5 | In an escrow auction, out-bid users get their Ether back by: | A. Calling a withdraw/refund function |
Project 4- Smart Contract Crowdfunding System : Project 4 : Smart Contract for Crowdfunding System
Read the notes, watch the video & take the MCQ test »
fundManager = payable(msg.sender);.mapping(uint => FundTicket) campaigns with a campaign counter, and pass the campaign ID to donate and release functions.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | In the Crowdfunding contract, donated Ether is first sent to: | B. The Fund Manager |
| 2 | A donor calls DonateNow(4). msg.value must be: | C. 4 × 10^18 wei |
| 3 | Which data should NOT be stored on a public blockchain? | D. Personal ID card numbers |
| 4 | Which modifier prevents a second active campaign? | B. checkFundTicketStatus |
| 5 | A trust-minimised improvement would keep donations: | D. In the contract (escrow) until release conditions are met |
Project 5- Smart Contract Badminton Tournament : Project 5 : Smart Contract for Badminton Tournament System
Read the notes, watch the video & take the MCQ test »
string.concat("Match Over : ", pname, " (WINNER)"), which joins strings (Solidity 0.8.12+).MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Who can add points in the BadmintonTournament contract? | C. Only the Match Referee |
| 2 | A game (round) ends in the contract when a player reaches: | B. 21 points |
| 3 | Which function joins strings to build the winner message? | A. string.concat |
| 4 | What prevents scoring after the match is over? | D. roundNumber set to 9 with checkRoundStatus |
| 5 | Player slots PLAYER1 and PLAYER2 are defined using: | A. An enum |
Project 6 : Smart Contract Web3.js - Jquery Cookies : Project 6 : Solidity with Web3.js and jQuery Cookies
Read the notes, watch the video & take the MCQ test »
{expires : 7}.http://127.0.0.1:7545, a local development blockchain.window.ethereum.request({ method: 'eth_requestAccounts' }), which prompts the user to connect and returns the selected account address.MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | Which Web3.js method reads a view function without creating a transaction? | C. call() |
| 2 | In this project, cookies store: | A. The user’s account address and name |
| 3 | Ganache’s default RPC URL used in the project is: | D. http://127.0.0.1:7545 |
| 4 | To create a contract object, Web3.js needs the ABI and the: | A. Contract address |
| 5 | On a public network, who signs a transaction sent with send()? | B. The user’s wallet |
Project 7 : Smart Contract Web3.js - CarPooling dApp : Project 7 : EcoRide – A Carpooling dApp
Read the notes, watch the video & take the MCQ test »
MCQ Answer Key
| No. | Question | Correct Answer |
|---|---|---|
| 1 | In EcoRide, which field counts seats already booked on a ride? | C. nopstatus |
| 2 | The amount for a booking is calculated as: | D. Seats × ride charges |
| 3 | Search functions return results as: | D. A memory array of structs plus a count |
| 4 | Which improvement prevents one user from cancelling another user’s ride? | A. Using msg.sender and ownership checks |
| 5 | What does ridepaymentupdates() do in the teaching version? | B. Sets the booking’s payment status flag to true |