ExamGecko
Home Home / Blockchain / CBDE

Blockchain CBDE Practice Test - Questions Answers, Page 10

Question list
Search
Search

Truffle has an integrated in-memory blockchain which makes unit-testing very easy:

A.
True, but it's still good to use Ganache, or even a real private network for testing.
A.
True, but it's still good to use Ganache, or even a real private network for testing.
Answers
B.
False, it's necessary to use Ganache or even a real private network for testing.
B.
False, it's necessary to use Ganache or even a real private network for testing.
Answers
Suggested answer: A

Using truffle-contract over Web3.js:

A.
is a must for every developer, because Web3.js changes so often.
A.
is a must for every developer, because Web3.js changes so often.
Answers
B.
is a convenient way because Web3.js is currently still in beta and truffle-contract can handle transactions with JavaScript-promises.
B.
is a convenient way because Web3.js is currently still in beta and truffle-contract can handle transactions with JavaScript-promises.
Answers
C.
they are both completely different things. Truffle-Contract is a framework while Web3.js is a library.
C.
they are both completely different things. Truffle-Contract is a framework while Web3.js is a library.
Answers
Suggested answer: B

Why is Unit-

Testing so important?

A.
It helps you to find bugs, regression bugs and sometimes also helps you to understand your code from different angles.
A.
It helps you to find bugs, regression bugs and sometimes also helps you to understand your code from different angles.
Answers
B.
It is a great way to spend time on something that you get paid for. But ultimately it will just slow down the development process.
B.
It is a great way to spend time on something that you get paid for. But ultimately it will just slow down the development process.
Answers
Suggested answer: A

If you are starting a new ERC20 token:

A.
it would be best to start from scratch, just looking at the required interface.
A.
it would be best to start from scratch, just looking at the required interface.
Answers
B.
it is beneficial to copy and paste the already existing code from the Ethereum wiki and modify this until you like it.
B.
it is beneficial to copy and paste the already existing code from the Ethereum wiki and modify this until you like it.
Answers
C.
best is to start with an audited implementation, for example from OpenZeppelin, in order to reuse already existing code.
C.
best is to start with an audited implementation, for example from OpenZeppelin, in order to reuse already existing code.
Answers
Suggested answer: C

To generate a random number:

A.
it's good to use the block timestamp, as this is always different.
A.
it's good to use the block timestamp, as this is always different.
Answers
B.
it's good to use the block hash as this is clearly always very different.
B.
it's good to use the block hash as this is clearly always very different.
Answers
C.
it's good to use the RANDAO smart contract.
C.
it's good to use the RANDAO smart contract.
Answers
D.
it's not possible to have a random number in a deterministic environment such as the Ethereum blockchain.
D.
it's not possible to have a random number in a deterministic environment such as the Ethereum blockchain.
Answers
Suggested answer: C

When you do external calls to other smart contracts:

A.
you should follow the checks-effects-interactions pattern and avoid state changes after the call.
A.
you should follow the checks-effects-interactions pattern and avoid state changes after the call.
Answers
B.
you should follow the effects-checks-interactions pattern and avoid state changes before the call.
B.
you should follow the effects-checks-interactions pattern and avoid state changes before the call.
Answers
C.
you should follow the checks-effects-interactions pattern, which is only necessary when you do calls to contracts where a direct contract call is not possible.
C.
you should follow the checks-effects-interactions pattern, which is only necessary when you do calls to contracts where a direct contract call is not possible.
Answers
Suggested answer: A

When you are programming a game like poker of battleships where you need to hide opponents values is:

A.
with private state variables. This way nobody else other than the smart contract itself can see the information
A.
with private state variables. This way nobody else other than the smart contract itself can see the information
Answers
B.
with external contracts holding those values. This way we can make sure that the information flow is following a clear logic and nobody else can access this information.
B.
with external contracts holding those values. This way we can make sure that the information flow is following a clear logic and nobody else can access this information.
Answers
C.
You can't hide anything on the blockchain, because the information is public, just the call is private which means only other smart contracts would be limited in accessing that information.
C.
You can't hide anything on the blockchain, because the information is public, just the call is private which means only other smart contracts would be limited in accessing that information.
Answers
Suggested answer: C


When considering smart contracts and the blockchain it's good:

A.
to move all existing logic to the blockchain, so everything runs on the same system. This way it might be more complex, but easier to maintain.
A.
to move all existing logic to the blockchain, so everything runs on the same system. This way it might be more complex, but easier to maintain.
Answers
B.
to move only those parts to the blockchain that really need the blockchain. This way smart contracts can be easier to read, easier to test and are not so complex.
B.
to move only those parts to the blockchain that really need the blockchain. This way smart contracts can be easier to read, easier to test and are not so complex.
Answers
C.
to move those parts to the blockchain that deal with Ether transfers. All other parts can remain in traditional database systems. This way only the value-transfer is on the blockchain.
C.
to move those parts to the blockchain that deal with Ether transfers. All other parts can remain in traditional database systems. This way only the value-transfer is on the blockchain.
Answers
Suggested answer: B

When a smart contract pays out money:

A.
it’s good to use a push over a pull method.
A.
it’s good to use a push over a pull method.
Answers
B.
it’s good to use a push and a pull method to ensure that participants can get their money no matter the contract state. In addition to and pushing it should contain a withdraw method.
B.
it’s good to use a push and a pull method to ensure that participants can get their money no matter the contract state. In addition to and pushing it should contain a withdraw method.
Answers
C.
it's good to use only pull and no push method.
C.
it's good to use only pull and no push method.
Answers
Suggested answer: B

To develop smart contracts:

A.
it’s good to start with a local in-memory blockchain with unit tests but then deploy to the mainnet as rapidly as possible.
A.
it’s good to start with a local in-memory blockchain with unit tests but then deploy to the mainnet as rapidly as possible.
Answers
B.
it's good to start with a local in-memory blockchain with unit-tests. Then, in the next step, debug and test the smart contract on a test-net like Ropsten or Rinkeby with beta customers to iron out last issues before deploying it to the main- net.
B.
it's good to start with a local in-memory blockchain with unit-tests. Then, in the next step, debug and test the smart contract on a test-net like Ropsten or Rinkeby with beta customers to iron out last issues before deploying it to the main- net.
Answers
C.
it's good to start with a test-net with beta-customers like on the Rinkeby or Ropsten testnet, before testing it locally on an in-memory blockchain simulation such as Ganache. Then deploy it to the main-net.
C.
it's good to start with a test-net with beta-customers like on the Rinkeby or Ropsten testnet, before testing it locally on an in-memory blockchain simulation such as Ganache. Then deploy it to the main-net.
Answers
Suggested answer: B
Total 102 questions
Go to page: of 11