Skip to content
RED SAGSkills
hardBlockchain Developer interview question

How do you decide what logic and data should live on chain versus off chain in a dApp?

What the interviewer wants to hear

  • On chain for trust-critical state, ownership and value transfer
  • Off chain for large data, private data and heavy computation
  • Use hashes, Merkle roots or proofs to link off-chain data to on-chain state
  • Cost, latency, privacy and censorship trade-offs
  • Layer 2s, data availability and ZK proofs as middle grounds

Model answer

I ask what users need to trust without trusting us. Ownership of assets, balances, and rules about moving value belong on chain, because that is the reason to use a blockchain. Large data like images, documents or game assets goes off chain on IPFS or Arweave, with only a content hash on chain so anyone can verify it has not changed. Private data, like personal details, should never be on a public chain at all, because it is permanent. Heavy computation, such as matching orders or calculating airdrops, can run off chain, with results committed as a Merkle root so users claim with a proof, or verified with a ZK proof. Things like search and analytics come from an indexer. Cost and latency also matter: Layer 2 rollups and blob data have made on-chain writes much cheaper, which moves the line. Each off-chain piece adds a trust or availability assumption, which I document clearly for users.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Blockchain Developer questions