Blockchain Developer FREE Blockchain Developer Decentralized Application (dApp) Architecture Questions and Answers 2 — Questions and Answers
Question 1: Which layer in a typical dApp architecture is responsible for storing transaction history immutably?
- Presentation layer
- Blockchain data layer (Correct answer)
- API gateway layer
- Caching layer
Correct answer: Blockchain data layer
The blockchain data layer stores all transaction records in an immutable, append-only ledger that cannot be altered after confirmation.
Question 2: What is the primary purpose of an oracle service in dApp architecture?
- To compile Solidity code into bytecode
- To provide off-chain data to smart contracts (Correct answer)
- To manage user authentication tokens
- To optimize gas fees for transactions
Correct answer: To provide off-chain data to smart contracts
Oracles bridge the gap between blockchains and external systems by feeding real-world data into smart contracts that cannot natively access off-chain information.
Question 3: In a dApp using the proxy pattern for upgradability, what does the proxy contract primarily store?
- The application business logic
- The state variables and a pointer to the logic contract (Correct answer)
- Only event logs for the frontend
- Compiled ABI definitions for the UI
Correct answer: The state variables and a pointer to the logic contract
A proxy contract holds the application state and delegates calls to a separate logic contract, allowing the logic to be replaced without losing stored data.
Question 4: Why do many production dApps use a subgraph via The Graph protocol instead of reading directly from the blockchain?
- Direct blockchain reads are forbidden by EVM rules
- Subgraphs automatically fix smart contract bugs
- Indexed subgraphs allow fast, complex queries that are impractical with raw RPC calls (Correct answer)
- Subgraphs eliminate the need for smart contracts entirely
Correct answer: Indexed subgraphs allow fast, complex queries that are impractical with raw RPC calls
The Graph indexes blockchain events into a queryable GraphQL API, enabling complex filtering and pagination that raw RPC endpoints handle poorly.
Question 5: Which architectural pattern allows a dApp frontend to function even when the user's RPC provider experiences downtime?
- Singleton contract pattern
- Multi-provider failover with fallback RPC endpoints (Correct answer)
- Removing all blockchain dependencies from the UI
- Using only WebSocket connections
Correct answer: Multi-provider failover with fallback RPC endpoints
Configuring multiple RPC providers with automatic failover ensures the dApp can switch to an available node if the primary provider goes offline.
Question 6: What is the main security risk of storing sensitive application configuration directly inside a smart contract's state variables?
- State variables consume too much gas to read
- All on-chain data is publicly readable regardless of Solidity visibility modifiers (Correct answer)
- State variables cannot be updated after deployment
- Ethereum nodes refuse to store large strings
Correct answer: All on-chain data is publicly readable regardless of Solidity visibility modifiers
Blockchain state is publicly accessible to anyone inspecting the chain, so marking a variable as private only restricts contract-level access, not external visibility.
Which layer in a typical dApp architecture is responsible for storing transaction history immutably?