Coursera was launched in 2012 by Daphne Koller and Andrew Ng with the goal of giving life-changing learning experiences to students all around the world. In the modern day, Coursera is a worldwide online learning platform that provides anybody, anywhere with access to online courses and degrees from top institutions and corporations.
Decentralized Applications (Dapps) Week 1 Quiz Answers
Quiz 1: Self-Check
Q1. What does the following figure represent?
<image: https://d3c33hcgiwev3.cloudfront.net/imageAssetProxy.v1/dOPgAT5lEeieJwrYiMRpMg_2f2537fe24b88fce11b454b70a980f04_Dapp-stack.PNG?expiry=1642809600000&hmac=Cc–mpHV8jShw57HMS_yMk05_PMU3JuH0vRyuDBLyc4>
- Dapp stack
- Service layer
- Server
- Blockchain stack
Q2. Blockchain server provides access to infrastructure hardware and blockchain services. True or False?
- False
- True
Q3. What does the enode address represent?
- Addresses of the ethereum accounts
- Hash of your accounts
- Address of the ethereum node
- Address of the coinbase
Q4. What is the use of enode address?
- Used by account to receive money from others
- Used by nodes to connect and form a p2p network
- Used by account to send money to others
- Used by the system to communicate with its coinbase;
Quiz 2: Self-Check
Q1. What is the CLI command used to send ethers after the nodes have been initialized?
- eth.submitTransaction()
- eth.sendRawTransaction()
- eth.sendTransaction()
- eth.sendIBANTransaction()
Q2. In this lesson, what port do we expose the RPC for the Ethereum network on?
- 8544
- 8545
- 7545
- 9545
Q3. To access smart contracts from the Dapp web interfaces we need the Web3 script. True or False?
- False
- True;
Quiz 3: Self-Check
Q1. What does API stand for?
- Application Protocol Interface
- Automatic Process Initiator
- Application Performance Indicator
- Application Programming Interface
Q2. Which of these are Ethereum APIs?
- eth
- admin
- enode
- miner
Q3. What library/API is used for smart contract deployment and invocation from Dapp ?
- web3
- contract
- eth
- admin;
Quiz 4: Decentralized Applications (Dapps) – Week 1
Q1. For a web application we associate a web server, for a mobile application we associate a mobile server. For a decentralized application we associate a ____.
- Distributed communication server
- Blockchain server
- Distributed application server
- Centralized Server
Q2. What is the network id for Ethereum’s testnet server, Rinkeby?
- 1
- 2
- 3
- 4
Q3. What does the web3 library do to help DApps to communicate with the ethereum network?
- SOAP Requests;
- RPC Calls
- REST Requests
- POST Requests
Q4. Which is one of the main use of APIs?
- Providing access to data and services
- Deploying smart contracts
- VoIP services
- Build DApp front ends
Q5. Which of these APIs you can use to see the nodes connected to the network?
- admin.peers()
- admin.nodeInfo()
- eth.viewPeers()
- admin.stats()
Q6. Which API can you use to start mining on your computer once a node is setup?
- user.startMiner()
- admin.startMiner()
- miner.start()
- eth.startMiner()
Q7. Which of these APIs can you use to create a new account on the Ethereum network?
- user.createAccount()
- user.newAccount()
- personal.createAccount()
- personal.newAccount()
Q8. You can use the Eth API to view your balance. Which of these functions would you call to do that?
- eth.getBalance()
- eth.viewBalance()
- eth.balance()
- eth.myBalance();
Decentralized Applications (Dapps) Week 2 Quiz Answers
Quiz 1: Self-Check
Q1. What are the steps in Dapp development process?
- Analyze problem, prototype smart contract on remix, develop and test in truffle
- Prototype smart contract on remix, develop and test in truffle, deploy
- Analyze problem, develop and test in truffle, deploy
- Analyze problem, prototype smart contract on remix, develop and test in truffle, deploy
Q2. What does truffle init do?
- Starts the truffle network for you
- Downloads a sample Dapp
- Creates a base directory and initializes templates with base Dapp code
- Connects to node running in your local
Q3. What is the RPC port for test chain deployed by “truffle develop”?
- 8545
- 8544
- 7545
- 9545
Q4. What does the option –reset in truffle migrate do?
- Runs the latest migration
- Run all migrations from beginning
- Clears the intermediate transactions
- Start execution from the last but one migration
Quiz 2: Self-Check
Q1. What is a positive test case in test-driven development?
- You provide valid values for input and test passes if the system behavior is correct and valid for the given input
- You provide invalid values for input and test passes if the system behavior is correct and valid
- You provide valid values for input and test passes if the system behavior is incorrect and invalid for the given input
- You provide invalid values for input and test passes if the system behavior is incorrect and invalid
Q2. What is the command for running test scripts ?
- truffle test.js
- test test.js
- truffle test
- test truffle
Q3. What is a negative test case in test-driven development?
- You provide valid values for input and test passes if the system behavior is correct and valid for the given input
- You provide invalid values for input and test fails
- You provide valid values for input and test passes if the system behavior is incorrect and invalid for the given input
- You provide invalid values for input and test passes if the system catches and flags the invalid inputs;
Quiz 3: Self-Check
Q1. What role does app.js play in the Dapp design?
- Instantiates object needed for the web client to communicate with the blockchain node
- Deploys smart contracts
- Handles business logic of Dapp
- Initiates the blockchain network
Q2. How are accounts in the test chain created by truffle develop connected to the Dapp?
- Ganache
- Truffle CLI
- Metamask
- Web3 script
Q3. What is the command to start web server for the Dapp in our lesson?
- npm run dev
- npm start server
- npm start
- npm dev run;
Quiz 4: Truffle Development – Week 2
Q1. Once you initialize a Truffle directory, the default directory structure contains which of the following?
- contracts/ – containing the Solidity source files for our smart contracts.
- migrations/ – to handle smart contract deployment.
- test/ – contains both JavaScript and Solidity tests.
- All of the above.
Q2. How do you interact with accounts of a Dapp from a browser?
- Through Ganache
- Through Remix
- Through MetaMask
- Through Oraclize
Q3. In what language is the test program for testing the Ballot2 Dapp written in the lesson discussed?
- Python
- Solidity;
- Java
- Javascript
Q4. What is the benefit of writing the test program in Javascipt over Solidity language?
- JS can handle Smart Contract addresses
- JS is easy to code
- JS is used in web programming
Q5. What can you use to create an empty truffle project?
- truffle init
- truffle start
- truffle create
- truffle compile
Q6. What command is used to convert solidity code to byte code for the EVM to execute?
- truffle convert2byte
- truffle convert
- truffle compile
- truffle execute
Q7. What can you use to deploy truffle’s built-in blockchain test chain?
- truffle switch
- truffle init
- truffle develop
- truffle compile
Q8. What command is used to redeploy Dapp’s contracts?
- truffle develop
- truffle compile
- truffle alter
- truffle migrate –reset
Q9. How can you test your smart contracts on truffle?
- truffle test
- truffle test_contract
- truffle contract
- truffle test contract
Decentralized Applications (Dapps) Week 3 Quiz Answers
Quiz 1: Self-Check
Q1. What type of variable is assigned to a local array inside a function by default?
- storage
- referenced
- persistent
- memory
Q2. How is a smart contract identified?
- Its name
- Its address
- Deployer’s address
- ABI
Q3. You can not change the ownership of a smart contract
- True
- False
Q4. Using which keyword you associate an interface with a smart contract
- pragma
- contract
- import
- library
Quiz 2: Self-Check
Q1. How is an event defined?
- They are defined same as functions
- They are defined as a state inside the contract
- They are defined with name and parameters
Q2. In the Coin Dapp we discussed, what is event sent used for?
- Pushing a notification that coins have been transferred between sender and receiver
- To invoke eth.sendTransaction() from front end
- For debugging purpose
- Sending coins from sender to receiver
Q3. What are the parameters for the sent event in coin smart contract?
- Address from, Address to, uint Amount
- Address to, uint Amount
- uint from, uint to, uint Amount
- String from, String to, uint Amount
Q4. What is an event used for?
- For debugging purpose
- Sending coins from sender to receiver
- Pushing smart contract state changes to any monitoring applications
- To invoke eth.sendTransaction() from front end
Quiz 3: Self-Check
Q1. What is the purpose of a callback function, when using Oraclize?
- Batch processing of data request
- Synchronous processing of data request
- Asynchronous processing of data request
- To send data request to Oraclize
Q2. What is Oraclize as described in the lesson?
- Means for smart contracts to access data from external sources securely
- Means for smart contracts to push data to external sources securely
- To check if a smart contract is mined and confirmed
- Communication between two different blockchain network;
Quiz 4: Design Improvements – Week 3
Q1. How can smart contracts access the data from different websites or APIs?
- By using Truffle
- By requesting the websites directly for the data
- It’s not possible for the smart contracts to access the data
- By using Oraclize
Q2. How can the blockchain applications trust the data response they get from Oraclize?
- By accepting data inputs from more than one untrusted or partially trusted party and then executing the data-dependent action only after a number of them have provided the same answer.
- Oraclize shows that the data is genuine by providing a document called authenticity proof along with the actual returned data.
- None of the above.
- By verifying from other third party sources.
Q3. Logs of events are stored in _______ .
- Server node;
- One node
- Client node
- All nodes
Q4. What is the maximum number of parameters can be indexed for a given event specification?
- No such limit
- 2
- 3
- 1
Q5. Which of the following is true for using Libraries in blockchain?
- Libraries are not stateless
- Libraries can store ethers
- Libraries can receive ethers
- Libraries are stateless
Q6. By default which type of variable is assigned to arrays and structs in solidity smart contracts?
- Memory or Storage depending on whether it is local or global
- No default assignment of variable type
- Memory variable
- Storage variable
Q7. What happens when a contract calls selfdestruct ?
- Remaining ethers are sent to a designated address and storage and code are removed from state
- Contract becomes inaccessible at a given address
- Contract can still be accessed but you can no longer send or receive ethers;
Decentralized Applications (Dapps) Week 4 Quiz Answers
Quiz 1: Self-Check
Q1. What kind of Dapp did Bitcoin enable ?
- P2P payment system
- Anonymous payment system
- Private payment system
- Dysfunctional payment system
Q2. What is a DAO?
- Decentralized Autonomous Oraclize
- Autonomous Oraclize
- Distributed Autonomous Organization
- Decentralized Autonomous Organization
Q3. Is DAO a smart contract?
- False
- True
Q4. What are ICOs primarily used for ?
- Trading
- Comparing different coins
- Fundraising
- Solving business logics
Quiz 2: Self-Check
Q1. How do you make your token ERC 20 compliant?
- Use the latest version of solidity compiler
- Token smart contract must implement ERC 20 interface functions
- ERC 20 smart contract must implement Token interface functions
- Use ERC 20 tokens instead of ethers
Q2. Which of the following is true about ERC 20 and ERC 721 tokens?
- ERC 20 is fungible, ERC 721 is non fungible
- Both are fungible
- ERC 20 is non fungible, ERC 721 is fungible
- Both are non fungible
Q3. You can use a blockchain token to ____.
- buy votes to be a chairman
- quickly monetize an idea or service
- enable mining
Q4. Token is a smart contract
- True
- False
Q5. Explain importance of standardization to Dapps.
- So that they follow certain conventions
- So that they can implement certain methods
- So that they can all be the same
Q6. Which one of the following is ERC 20 compliant ?
- REP
- Coinbase
- Exodus
- Jaxx
Q7. On etherscan when you hover over a ERC 20 token such as SALT what message shows up?
- Standard ERC-20 Token
- ERC 721 Token
- ERC Token Compliant;
Quiz 3: Application Models & Standards – Week 4
Q1. What does EIP stand for?
- Ethereum International Protocol
- Ethereum Integration Proposal
- Ethereum Improvement Protocol
- Ethereum Improvement Proposal
Q2. What is ERC 20?
- It is an EIP protocol which defines how to carry out transactions
- It defines a common set of rules and functions for all ERC20 Ethereum tokens to follow, allowing easy integration of new tokens
- It defines rules for the authentication and privacy of Ethereum transactions.
- None
Q3. Review the ERC20 Interface from this link. Which are the functions below do you need to implement to make your token ERC 20 compliant? Select all the functions needed.
- totalSupply()
- balanceOf()
- transfer()
- approve()
Q4. What does ERC stand for?
- Ethereum Replacement of Code
- Ethereum Requisite for Code
- Ethereum Request for Comments
- Ethereum Revision Comments
Q5. Which of the following is true regarding a fungible token?
- Its intrinsic value can change
- It is not mutually interchangeable1:1 to another of its kind
- It is a mutually interchangeable 1:1 to another of its kind
Q6. What is a famous example of a nonfungible token?
- Cryptokitties
- Zcash
- Augur
- US Dollar
Q7. What is ICO?
- Independent Coin Offering
- Initial Coin Offering
- Inferred Coin Offering
- Independent Code Ordering
Q8. What significant event did Ethereum Decentralized Autonomous Organization (DAO) precipitate?
- Change of consensus algorithm
- Hard fork of Ethereum
- Soft fork of Ethereum;
.
Review:
Based on our knowledge, we urge you to enroll in this course so you can pick up new skills from specialists. It will be worthwhile, we trust.