Blockchain Developer Decentralized Application Architecture 3 — Questions and Answers
Question 1: What architectural problem does an oracle solve for a dApp?
- It increases block size
- It securely brings off-chain real-world data onto the blockchain (Correct answer)
- It compresses transaction data
- It manages user sessions
Correct answer: It securely brings off-chain real-world data onto the blockchain
Oracles feed external data (prices, weather, events) to smart contracts, which cannot access off-chain data natively.
Question 2: A dApp needs the current ETH/USD price for a lending protocol. What is the safest design choice?
- Hardcode the price in the contract
- Use a decentralized oracle network with multiple data sources (Correct answer)
- Let the contract deployer update it manually each block
- Fetch it from a single centralized API on-chain
Correct answer: Use a decentralized oracle network with multiple data sources
Decentralized oracle networks aggregate multiple sources to resist manipulation and single points of failure.
Question 3: Why are smart contracts considered deterministic in dApp architecture?
- They run faster than normal code
- Every node must produce the identical result given the same inputs and state (Correct answer)
- They can call random external services
- They use floating-point math
Correct answer: Every node must produce the identical result given the same inputs and state
Determinism is required so all nodes reach consensus on the same state after execution.
Question 4: What is a common reason to split a dApp's logic into a proxy contract and an implementation contract?
- To make transactions cheaper to read
- To enable upgradeability of the logic while preserving state and address (Correct answer)
- To hide the source code permanently
- To bypass gas fees
Correct answer: To enable upgradeability of the logic while preserving state and address
The proxy pattern keeps a stable address and storage while the implementation logic can be swapped/upgraded.
Question 5: In an event-driven dApp frontend, how does the UI usually learn that an on-chain action succeeded?
- By polling the user's email
- By listening to events/logs emitted by the smart contract (Correct answer)
- By reading the miner's mempool directly
- By querying the DNS server
Correct answer: By listening to events/logs emitted by the smart contract
Contracts emit events/logs that frontends and indexers subscribe to for state updates.
Question 6: What does 'composability' mean in the context of dApp architecture?
- The ability to write contracts in multiple languages
- Smart contracts can permissionlessly call and build on one another like money legos (Correct answer)
- The ability to compress contract bytecode
- Storing UI components in a library
Correct answer: Smart contracts can permissionlessly call and build on one another like money legos
Composability lets contracts interact and integrate freely, enabling DeFi 'money legos'.
Question 7: Why might a dApp use a relayer to enable gasless (meta) transactions for users?
- To eliminate the need for any signatures
- So users can sign transactions while a third party pays the gas, improving UX (Correct answer)
- To make transactions reversible
- To skip consensus validation
Correct answer: So users can sign transactions while a third party pays the gas, improving UX
Meta-transactions let a relayer submit and pay gas for a user-signed message, lowering onboarding friction.
What architectural problem does an oracle solve for a dApp?