In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the technical interview questions of block chain in Taifang". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. let's study and learn "what are the technical interview questions of block chain in Taifang?"
Tai Tai Fong
Q: what is the name of the valuable pass in Yi Tai Fong?
Answer: ETH:Ether
Q: what's the difference between Wei and ether?
A: Wei is a denomination, such as cents to dollars or pennies to pounds. 1 ETH = 10 ^ 18 Wei
Q: what is the average block time of Etay Fong?
A: about 14 seconds
Q: what is the average block size of Tai Fong?
Answer: about 2KB, the actual value depends on the specific situation.
Q: does Ethernet Square support scripts? If so, what types of scripts are supported?
A: yes. It supports smart contracts
Q: how did you get the ether?
Answer: there are several ways: 1. Become a miner
two。 In exchange for other currencies
3. Use an Ethernet auction, such as https://faucet.metamask.io
4. Accept gifts from others
Q: where did the ether come from?
A: 60 million were created for the first time in 2014 pre-sale. In addition, an ether is generated when a new block is dug out.
Q: what is a node?
A: a node is essentially a computer connected to the network, which is responsible for processing transactions.
Q: how many ethernet networks are you familiar with?
A: there are three types of networks-real-time networks (primary), test networks (such as Ropsten and Rinkeby), and private networks.
Q: what are the ways to interact with Yitaifang network?
A: you can use e-wallet or DApp
Q: can you "hide" an etheric place transaction?
A: no. All transactions are visible to everyone.
Q: where are the transaction records?
A: in the public ledger.
Q: what is the ID of these networks?
Answer: Live (id = 1), Ropsten (id = 3), Rinkeby (id = 4), Private (assigned by developers)
Q: can I dig some ethernet in the Rinkeby test network and transfer it to the Live network?
A: no. Ethernet cannot be transferred between different ethernet networks.
Q: why do I need a private network?
A: there are many reasons, but mainly for data privacy, distributed databases, access control and testing.
Q: how can you easily view detailed information about deals and blocks?
Answer: use a blockchain browser, such as etherscan.io or live.ether.camp
Q: how to view the transaction and block information of VPC?
A: you can use an open source browser client, such as https://github.com/etherparty/explorer
Q: what is the consensus of the blockchain?
A: the process of validating a transaction (creating a block) by following a specific protocol, such as ethernet.
Q: what are the two common consensus models in the blockchain?
Answer: proof of workload (POW) and proof of interest (POS).
Q: simply explain the proof of workload.
A: it is actually a miner's solution to a computationally intensive problem in order to prove his workload and verify transactions.
Q: explain the proof of interest in a simple way.
A: the creators of the blocks are randomly selected according to the wealth and equity held by the nodes. It is not computationally intensive.
Q: what consensus model is used in Etay Square?
A: by early 2018, it will use proof of workload, but will switch to proof of interest in the future.
Q: how to dig etheric coins?
Answer: use a wallet or geth client.
Q: what is used to sign the transaction?
Answer: the user's private key.
Q: can I restore my Ether Fong account after losing my private key?
A: yes, you can use mnemonic phrases.
Ethernet Square Node Software (Geth)
Q: what are the ways to connect to an Ethernet Fong node?
Answer: IPC-RPC, JSON-RPC and WS-RPC.
Q: so what is Geth?
A: Geth is the client of Etay Fong.
Q: what is the default way to connect to a geth client?
A: IPC-RPC is enabled by default, and other RPC is disabled.
Q: what API do you know about geth?
Answer: Admin, eth, web3, miner, net, personal, shh, debug and txpool.
Q: which RPC can you use to connect to the geth client over the network?
Answer: you can use JSON-RPC and WS-RPC to connect to the geth client over the network. IPC-RPC can only connect to geth clients on the same machine.
Q: if the-rpc option is used to start geth, which RPC will be enabled?
A: JSON-RPC.
Q: which RPC API is enabled by default?
Answer: eth, web3 and net.
Q: how do I enable Admin API for JSON RPC?
Answer: use the-rpcapi option.
Q: what is the purpose of the option-datadir?
Answer: it specifies the storage location of the blockchain.
Q: what is geth's "fast" synchronization and why is it faster?
A: quick synchronization downloads the transaction receipt with the block and extracts the latest status database in its entirety instead of re-executing all transactions that have occurred.
Q: option-- what does testnet do?
A: it connects clients to the Ropsten network.
Q: starting the geth client will output a lot of text on the screen, how to reduce the output information?
Answer: you can set-- verbosity to a lower number (default is 3)
Q: how do I use IPC-RPC to connect one geth client to another?
Answer: first start a geth client, copy its pipe location, then start another geth client using the same datadir and pass in the pipe location using the-- attach option.
Q: how do I load a custom javascript file into the geth console?
Answer: use the-- preload option to pass in the path of the js file.
Q: where is the account of the geth client stored?
A: in the keystore directory.
Q: what do I need to do with the account in order to trade?
A: the account must be unlocked first-you can pass in the account address or account serial number to unlock it. You can also use the-- password option to pass in a password file that contains the password for each account.
Q: you mentioned something about the account serial number. What factors determine the serial number of the account?
Answer: the order in which accounts are added.
Q: is it possible to use geth for mining?
A: yes, use the-- mine option to turn it on.
Q: what is etherbase?
Answer: this is the account that receives the mining reward. It is the account with serial number 0.
Smart contracts and Solidity
Q: what is a smart contract?
A: this is computer code written in many languages. Intelligent contracts exist on the ethernet network, and they perform actions according to predetermined rules, which are agreed upon by participants in these contracts.
Q: in what languages can smart contracts be written?
Answer: Solidity, which is the most commonly used language, can also use Serpent and LLL.
Q: can you name a use case for a smart contract?
A: seller-buyer application scenario: the buyer deposits money in the smart contract, the seller sees the deposit and sends the goods, and the buyer receives the goods and releases the payment.
Q: what is Metamask?
A: Metamask is a tool that helps users interact with the ethernet network in the browser
Q: which Ethernet Fong node is used by Metamask?
A: it uses infura.io
Q: what is not supported by Metamask?
A: mining and contract deployment.
Q: is it free to execute the contract?
A: no, invoking the contract method is a transaction, so you have to pay a fee.
Q: is it free to access the status of smart contracts?
A: yes, query status is not a transaction.
Q: who executes the contract?
A: miners.
Q: why do I have to pay to call the smart contract method?
Answer: some methods do not change the status of the contract, there is no other logic, but just return a value, such methods can be called free of charge. Calling methods that change the status of the contract costs a fee because they need to be executed by gas.
Q: why do I need gas?
A: because miners execute contract code on their machines, they need gas to cover the cost of executing contract code.
Q: does the price of gas determine when the transaction is processed?
A: yes and no. The higher the gas price, the more likely the deal is to succeed. However, gas prices do not guarantee faster transaction processing.
Q: what does gas usage in a deal depend on?
A: this depends on the amount of storage used in the contract, the type and quantity of instructions (opcodes). Each EVM opcode corresponds to a fixed amount of gas.
Q: how is the transaction fee calculated?
Answer: gas usage * gas price (gas price specified by the caller)
Q: if the execution cost of the smart contract is lower than the gas usage specified by the caller, will the user get a refund?
A: yes
Q: what happens if the execution cost of a smart contract is higher than the specified gas usage?
A: users will not get a refund, and once all the gas is used up, the execution will stop and the contract will not be changed.
Q: who pays for the invocation cost of a smart contract?
A: the user who calls the contract.
Q: on what does the node run the intelligent contract code?
A: EVM-Ethernet Square virtual machine. EVM follows the EVM specification, which is part of the Ethernet Fong agreement. EVM is just a process on a node.
Q: what does EVM need to run a smart contract?
A: it requires the bytecode of the contract, which is generated by compiling contracts written in higher-level languages such as Solidity.
Q: roughly speaking, what are the components of EVM?
Answer: memory area, stack and execution engine.
Q: what is Remix?
A: online tools for developing, testing and deploying contracts. Suitable for quickly building and testing lightweight contracts, but not for more complex contracts.
Q: which nodes can be connected in Remix?
Answer: you can use Metamask to connect to a public node, or you can link to a local node built using Geth, or a memory node simulated in Javascript VM.
Q: what is DApp and how is it different from App? What's the difference?
A: App usually contains a client that communicates with some centralized resources (owned by an organization). Usually, the client connects to the centralized data layer through an intermediate tier, and cannot be easily recovered if the information in the centralized data layer is lost. DApp stands for decentralized application. DApps interacts with blockchain networks through intelligent contracts. The data used by DApp resides in the contract instance. Centralized data may be more vulnerable to corruption than decentralized data.
DApps and web3
Q: is the front end of DApp limited to certain technologies or frameworks?
A: there are no restrictions. You can use any technology to develop the front end of DApp, such as HTML,CSS,JS,Java,Python...
Q: what library does the front end use to connect to the back end (smart contract)?
Answer: Web3.js library.
Q: what do you need at the front end of DApp to interact with a specified smart contract?
Answer: ABI and bytecode of the contract.
Q: what is the purpose of ABI?
A: ABI is the public interface description object of the contract, which is used by DApps to call the contract's interface.
Q: what is the function of bytecode?
Answer: the EVM on the node can only execute the bytecode of the contract.
Q: why use the BigNumber library?
A: because Javascript can't handle large numbers correctly.
Q: why do I need to check if the web3 provider (Provider) is set at the beginning of the Web DApp code?
Answer: because Metamask injects a web3 object, it overrides other web3 settings.
Q: why use web3.js version 1.x instead of 0.2x.x?
Answer: mainly because 1.x asynchronous calls use Promise instead of callbacks, Promise is currently the preferred solution for handling asynchronous calls in the javascript world.
Q: how do I list accounts in web3 1.x?
A: web3.eth.getAccounts
Q: what's the difference between .call and .send?
A: .send sends the transaction and pays the fee, while .call queries the contract status.
Q: is it right to send an ether like this: .send ({value:1})?
A: no, it sends 1 wei. Transactions are always in units of wei.
Q: so in order to send an ether, I have to multiply this value by 10 ^ 18?
Answer: you can use web3.utils.toWei (1).
Q: what do I need to specify when calling .send ()?
A: you must specify the from field, that is, the sending account address. Everything else is optional.
Q: is it true that the only function of web3.eth.sendTransaction () is to send an Ethernet to a specific address?
A: no, you can also use it to call the contract method.
Q: do you know the scalability solution of Etay Square?
A: layer 2 protocol. Possible solutions are state channels and Plasma.
Solidity
Q: is Solidity a statically typed or dynamically typed language?
A: it is a statically typed language, which means that the type is known at compile time.
Q: what is similar to Java "Class" in Solidity?
A: the contract.
Q: what is a contract example?
A: contract instances are deployed contracts on the blockchain.
Q: please name some differences between Java and Solidity.
Answer: Solidity supports multiple inheritance, but does not support overloading.
Q: what is the first thing you must specify in the Solidity file?
A: the version of the Solidity compiler, such as ^ 0.4.8 specified. This is necessary because it prevents incompatibility errors when using other versions of the compiler.
Q: what is included in the contract?
Answer: it mainly consists of storing variables, functions, and events.
Q: what types of functions are there in the contract?
Answer: there are constructors, fallback functions, functions that modify contract status, and read-only constant functions.
Q: what error do I get if I put multiple contract definitions into a single Solidity file?
A: it is absolutely correct to put multiple contract definitions into a single Solidity file.
Q: what are the ways in which two contracts interact?
A: one contract can invoke another contract, or it can inherit other contracts.
Q: what happens when you try to deploy a file that contains multiple contracts?
A: the compiler only deploys the last contract in the file and ignores all other contracts.
Q: if I have a large project, do I need to save all relevant contracts in one file?
A: no need. You can use the import statement to import other contract files, such as import ". / MyOtherContracts.sol";.
Q: can I only import local contract files?
Answer: you can also import other contract files using the HTTP protocol, such as: import "http://github.com/owner/repo/path_to_file"; from Github.
Q: what parts is the memory of EVM divided into?
A: it is divided into Storage, Memory and Calldata.
Q: please explain Storage.
A: think of it as a database. Each contract manages its own Storage variable. It is a key-value database (256-bit key values). In terms of the gas used per execution, it is more expensive to read and write on the Storage.
Q: please explain Memory.
A: this is a temporary storage area. Once the execution is complete, the data will be lost. Complex data types such as arrays and structures can be allocated on the Memory.
Q: please explain Calldata.
A: you can think of calldata as a call stack. It is temporary and immutable and is used to store EVM execution data.
Q: which variables are stored in Storage and which variables are stored in Memory?
Answer: state variables and local variables (which are references to state variables) are stored in the Storage area, and function parameters are located in the Memory area.
Q: take a look at the following code and explain which part of the code corresponds to which memory area:
Contract MyContract {/ / part 1 uint count; uint [] totalPoints; function localVars () {/ / part 2 uint [] localArr; / / part 3 uint [] memory memoryArr; / / part 4 uint [] pointer = totalPoints;}}
Part 1-Storage
Part 2-Storage
Part 3-Memory
Part 4-Storage
Q: is this the right thing to do:
Function doSomething (uint [] storage args) internal returns (uint [] storage data) {… }
Answer: yes, you can force the parameter of the function to be set to Storage storage. In this case, if the storage reference is not passed, the compiler reports an error.
Original text: Yi Tai Fang develops interview questions and answers
Thank you for your reading. the above is the content of "what are the technical interview questions for block chain in Taifang?" after the study of this article, I believe you have a deeper understanding of what are the technical interview questions for block chain in Taifang. The specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.