Skip to content

Blockchain Interview Questions in Gurgaon

36 practice questions with answers for Blockchain interviews in Gurgaon.

Blockchain jobs in Gurgaon

Gurgaon (Gurugram) is home to many multinational, consulting, fintech and consumer-internet offices. Interviews often expect strong business understanding along with technical skills, especially for analytics and product-facing roles.

Below are 36 questions that match the mix of service, product and domain employers hiring blockchain developers in Gurgaon.

Solved for GurgaonStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

How do you approve and transfer ERC-20 tokens from a script with ethers.js?

Save to ▾
Show answer
import { Contract, parseUnits } from 'ethers'; const abi = [ 'function approve(address spender, uint256 amount) returns (bool)', 'function decimals() view returns (uint8)', 'function allowance(address owner, address spender) view returns (uint256)' ]; const token = new Contract(TOKEN_ADDRESS, abi, signer); const dec = await token.decimals(); const amount = parseUnits('25', dec); const tx = await token.approve(SPENDER, amount); await tx.wait(); console.log(await token.allowance(signer.address, SPENDER)); The spender contract then calls transferFrom to pull exactly that amount.
02

What are the basic Foundry commands to create, build, test and work with a project?

Save to ▾
Show answer
curl -L https://foundry.paradigm.xyz | bash && foundryup forge init my-dapp # new project with src, test, script forge install OpenZeppelin/openzeppelin-contracts forge build # compile forge test -vvv # run tests with traces forge coverage # coverage report forge snapshot # gas snapshot anvil # local node cast call ADDR 'count()(uint256)' --rpc-url $RPC Foundry tests are written in Solidity and run fast; Hardhat is the JavaScript or TypeScript alternative with a large plugin ecosystem.
03

How would you check on-chain whether a user is in a 10,000-address allowlist without storing all addresses?

Save to ▾
Show answer
Build a Merkle tree off-chain from the allowlisted addresses (hashing each leaf, ideally double-hashed with amounts if needed) and store only the 32-byte root in the contract. Each user submits a proof of about 14 hashes for 10,000 leaves. The contract recomputes the root with OpenZeppelin MerkleProof.verify and compares it. This costs one storage slot instead of 10,000, and you can update the list by changing the root.
04

What is a cryptographic hash function and what properties must it have?

Save to ▾
Show answer
A hash function maps any input to a fixed-size output, such as 256 bits. For blockchain it must be deterministic, fast to compute, pre-image resistant (you cannot find the input from the hash), second pre-image resistant, and collision resistant (finding two inputs with the same hash is infeasible). It should also show the avalanche effect, where a one-bit change gives a completely different hash. Blocks, addresses, Merkle trees and proof of work all depend on these properties.
05

A group of banks wants a shared KYC ledger. Would you choose a public chain, a Layer 2 or Hyperledger Fabric?

Save to ▾
Show answer
For shared KYC among regulated banks I would lean to a permissioned framework such as Hyperledger Fabric or a private EVM network. Members are known, data is confidential, and regulators expect access control and data residency in India. Fabric channels and private data collections restrict who sees what, and Raft ordering gives fast finality without gas fees. A public chain or L2 fits only if we need open verification, and even then only hashes and attestations would go on it.
06

How does the EIP-1559 fee model work?

Save to ▾
Show answer
EIP-1559 splits the fee into a base fee and a priority fee. The protocol sets the base fee per block from demand: if the previous block was more than half full, it rises up to 12.5 percent, otherwise it falls. The base fee is burned. Users add a priority fee (tip) for the proposer and set maxFeePerGas as their cap. They pay base fee plus tip, never more than the cap, which makes fees more predictable.
07

How does inheritance work in Solidity, including virtual and override?

Save to ▾
Show answer
A contract inherits with is, for example contract Token is ERC20, Ownable. Parent functions that may be changed must be marked virtual, and the child must use override; with several parents you list them, as in override(A, B). Solidity uses C3 linearisation, so the order of the parent list matters, from most base to most derived, and super calls the next contract in that order. Constructors of parents run first in linearised order.
08

Your staking validator is missing attestations and losing rewards. How do you investigate?

Save to ▾
Show answer
Check that both execution and consensus clients are synced and peering well, since low peer count or a lagging execution client causes missed duties. Look at system clock sync through NTP, CPU, memory and disk I/O, as slow disks often cause delays. Review client logs and metrics in Grafana, check for pending client upgrades before a fork, and verify network ports are open. Never start a second copy of the same validator key as a fix, because that causes slashing.
09

Your contract fails to deploy because it exceeds the 24 KB size limit. What do you do?

Save to ▾
Show answer
The EIP-170 limit is 24,576 bytes of runtime code. First enable the optimiser and try a lower runs value or via-IR. Replace revert strings with custom errors, move repeated logic out of modifiers into internal functions, and remove unused code. If still too big, split logic into separate contracts or external libraries, or use a modular pattern like the Diamond (EIP-2535). Splitting also often improves clarity and auditability.
10

Design a blockchain solution for farm-to-store supply chain traceability. What goes on-chain?

Save to ▾
Show answer
I would use a permissioned or low-cost chain where farmers, transporters, warehouses and retailers are known members. On-chain I would record batch IDs, ownership handovers, timestamps, signer identity and hashes of certificates or sensor data. Large documents, images and IoT streams stay off-chain in object storage or IPFS, referenced by hash. QR codes on packs link consumers to the trail. The main risk is bad input data, so I would add signed device readings and audits.
11

What is the difference between optimistic rollups and zk-rollups?

Save to ▾
Show answer
Optimistic rollups assume batches are valid and allow a challenge window, typically about seven days, during which anyone can submit a fraud proof; this makes them EVM-compatible and simpler but slows native withdrawals. Zk-rollups submit a validity proof with each batch, so L1 verifies correctness mathematically and withdrawals finalise once the proof is accepted. Zk proving is computationally heavy and EVM equivalence was harder, though zkEVMs have matured a lot by 2026.
12

What are front-running and sandwich attacks, and how do you mitigate them?

Save to ▾
Show answer
Pending transactions are public, so bots can copy or outbid them. Front-running is placing a transaction ahead of a victim's, for example buying before a large purchase. A sandwich attack buys before the victim's swap and sells right after, profiting from the price impact. Mitigations include slippage limits and deadlines, commit-reveal schemes, batch auctions, private transaction relays, and design that does not reward ordering, such as using time-weighted prices.
13

Describe a time you disagreed with a teammate about architecture.

Save to ▾
Show answer
Situation: a teammate wanted our indexer to read every event directly from the node at request time. Task: I believed it would not scale. Action: instead of arguing, I proposed a one-day spike, measured both approaches with realistic data, and shared numbers showing the database-backed indexer answered queries 40 times faster. Result: the team chose the indexer, my teammate led its reorg handling, and we agreed to settle future debates with quick experiments.
14

What is the difference between require, revert, assert and custom errors?

Save to ▾
Show answer
require(condition, message) validates inputs and conditions, reverting with a message if false. revert stops execution explicitly and is often used with custom errors, such as error InsufficientBalance(uint256 need, uint256 have); revert InsufficientBalance(x, y); which are cheaper than strings and carry data. assert checks invariants that should never fail; a failure signals a bug and raises a Panic. Since Solidity 0.8.26 you can also pass custom errors to require.
15

How do you read a contract's storage slot directly with Foundry's cast?

Save to ▾
Show answer
Use cast storage with the contract address and slot number. For mappings, compute the slot as keccak256(key . slot). # Read slot 0 (often the first state variable) cast storage 0xContractAddress 0 --rpc-url $RPC_URL # balanceOf mapping stored at slot 2, key = user address cast index address 0xUserAddress 2 cast storage 0xContractAddress <slot-from-above> --rpc-url $RPC_URL This shows that private variables are not secret: anyone can read storage.
16

Your target users in India have never used crypto wallets. How do you design onboarding?

Save to ▾
Show answer
Hide crypto complexity. Offer login with phone or email using embedded or smart contract wallets, so no seed phrase is needed at first. Sponsor gas with a paymaster so users need no tokens. Show amounts in rupees and plain language, support regional languages, and explain actions in simple terms. Provide account recovery via passkeys or guardians, and let advanced users export to self-custody later. Ensure KYC and tax requirements are clear where money is involved.
17

What are events and logs in Ethereum?

Save to ▾
Show answer
Events are declared in Solidity and emitted with emit; the EVM writes them as logs in the transaction receipt. Each log has the contract address, up to three indexed topics plus the event signature hash, and non-indexed data. Logs are much cheaper than storage but contracts cannot read them. Front-ends and indexers subscribe to events to update the UI, track token transfers and build history, so emitting clear events for every state change is good practice.
18

A user approved unlimited token spending to a scam site. What should they do?

Save to ▾
Show answer
Revoke the approval immediately using a token approval checker or by calling approve(spender, 0) from the wallet, because the malicious contract can pull tokens any time. If a drain has started, move remaining assets to a fresh wallet. Check for other suspicious approvals and NFT setApprovalForAll permissions. Going forward, approve exact amounts, read wallet prompts carefully, use a separate hot wallet for new dApps, and prefer wallets that simulate transactions before signing.
19

What is Bitcoin halving and difficulty adjustment?

Save to ▾
Show answer
Halving cuts the Bitcoin block reward in half every 210,000 blocks, roughly every four years, which caps total supply at 21 million BTC. After the April 2024 halving the reward is 3.125 BTC per block. Difficulty adjustment happens every 2016 blocks: if blocks came faster than ten minutes on average, difficulty rises, and if slower, it falls. Together they make issuance predictable regardless of how much mining power joins or leaves.
20

Why should you not use tx.origin for authorisation?

Save to ▾
Show answer
tx.origin is the EOA that started the transaction, while msg.sender is the immediate caller. If a contract checks require(tx.origin == owner), a phishing contract can trick the owner into calling it, and that contract then calls the victim; tx.origin is still the owner, so the check passes and funds can be stolen. Always use msg.sender for access control. tx.origin also breaks with smart contract wallets and account abstraction.
21

What happens when a transaction reverts?

Save to ▾
Show answer
A revert undoes all state changes made during that transaction, including nested calls, as if it never ran. However, the transaction is still included in a block, the nonce is consumed, and the sender pays for the gas used up to the revert. Contracts revert with require, revert or custom errors, which return a reason the wallet can show. Since the Byzantium upgrade, unused gas is refunded on revert, unlike the old invalid opcode which consumed everything.
22

A function that distributes rewards loops over all users and is getting too expensive. How do you fix it?

Save to ▾
Show answer
Unbounded loops eventually exceed the block gas limit. Switch to a pull-based accounting model: maintain a global reward-per-token accumulator that grows when rewards are added, and store each user's last checkpoint. Users claim with reward equals balance times (current accumulator minus their checkpoint). This makes distribution O(1) for any number of users. Alternatively, use a Merkle distributor where rewards are computed off-chain and users claim with proofs.
23

Users complain they received far fewer tokens than expected on large swaps. What is happening and how do you help?

Save to ▾
Show answer
Large trades in shallow pools suffer price impact, and wide slippage settings let sandwich bots extract extra value. Show the expected output, price impact and minimum received before confirming. Set sensible default slippage, such as 0.5 percent for major pairs, and warn when impact is high. Use a router or aggregator that splits trades across pools, and offer private transaction submission so bots cannot see the swap in the public mempool.
24

Explain storage, memory, stack and calldata in the EVM.

Save to ▾
Show answer
Storage is persistent key-value data of 32-byte slots per contract; it is the most expensive, and writes to new slots cost about 20,000 gas. Memory is a temporary byte array cleared after each call, cheap but growing in cost quadratically. The stack holds up to 1024 words for opcode operands. Calldata is the read-only input data of the transaction, the cheapest place to read external function arguments from. Choosing the right location is a key gas optimisation.
25

What is storage packing, and what are other key gas optimisations?

Save to ▾
Show answer
The EVM stores data in 32-byte slots, so consecutive small variables like uint128, uint64, address and bool can share a slot if declared next to each other, saving expensive SSTOREs. Other optimisations: use calldata for external arrays, cache storage reads in local variables, use immutable and constant, prefer custom errors over strings, avoid unbounded loops, use events instead of storing history, and use unchecked for counters that cannot overflow. Always measure with forge snapshot.
26

What are Delegated Proof of Stake and Proof of Authority?

Save to ▾
Show answer
In Delegated Proof of Stake, token holders vote for a small set of block producers who validate on their behalf, giving high throughput but more centralisation. In Proof of Authority, a fixed set of known, reputable validators sign blocks; their identity, not stake, is at risk. PoA, often via Clique, IBFT or QBFT, suits private and consortium EVM networks and some testnets, where participants are known and fast, predictable block times matter more than open participation.
27

What is the difference between call, delegatecall and staticcall?

Save to ▾
Show answer
call runs the target contract's code in the target's own context, with its own storage, and msg.sender becomes the caller contract. delegatecall runs the target's code in the caller's context, using the caller's storage, balance and original msg.sender; this is how proxies and libraries work, and storage layouts must match. staticcall is like call but reverts on any state change, used for view functions. Delegatecall to untrusted code is extremely dangerous.
28

How do you call read and write functions of a contract with ethers v6?

Save to ▾
Show answer
Create a Contract with address, ABI and a provider for reads or a signer for writes. import { Contract, parseEther } from 'ethers'; const abi = [ 'function count() view returns (uint256)', 'function increment() payable' ]; const readOnly = new Contract(ADDR, abi, provider); console.log(await readOnly.count()); // free eth_call const writable = new Contract(ADDR, abi, signer); const tx = await writable.increment({ value: parseEther('0.001') }); const receipt = await tx.wait(); console.log(receipt.hash, receipt.status);
29

After a transaction is confirmed, your front-end still shows old data. How do you fix it?

Save to ▾
Show answer
The UI is probably reading cached results or a lagging RPC node. After tx.wait() resolves, explicitly refetch or invalidate the relevant queries, for example with wagmi or TanStack Query invalidation. Show optimistic updates while pending. If you use an indexer, it may lag by a few blocks, so poll until it reaches the receipt's block number. Use the same RPC endpoint for writes and immediate reads, and avoid long caching for balances.
30

A transaction keeps failing with an out of gas error. How do you fix it?

Save to ▾
Show answer
First see whether the gas limit was too low or the function is genuinely unbounded. Run eth_estimateGas or simulate with cast run or Tenderly to see actual gas used and where it fails. If estimation is fine, raise the limit with a buffer of 10 to 20 percent. If the function loops over a growing array, redesign it with pagination or pull-based patterns, because the block gas limit will eventually make it impossible to call.
31

What is a Layer 2 and why is it needed?

Save to ▾
Show answer
A Layer 2 is a network that executes transactions off the main chain and inherits security from it by posting data or proofs back to Layer 1. Ethereum Layer 1 handles only around 15 to 30 transactions per second at higher fees, so L2s batch thousands of transactions into one L1 submission, cutting fees to cents or less. Rollups are the main type. Users bridge assets from L1 to the L2 and can withdraw back.
32

A sharp market fall causes cascading liquidations in your lending protocol and bad debt. How do you design against it?

Save to ▾
Show answer
Set conservative loan-to-value ratios and liquidation thresholds per asset based on volatility and on-chain liquidity. Use supply and borrow caps for illiquid tokens, isolation mode for risky assets, and a liquidation bonus that attracts liquidators without over-penalising users. Allow partial liquidations so positions shrink gradually. Keep reliable oracles, an insurance or reserve fund to absorb bad debt, and run stress tests simulating 30 to 50 percent price drops.
33

What does a smart contract audit process look like?

Save to ▾
Show answer
It starts with scoping: fixed commit, documentation, threat model and test coverage. Auditors run automated tools like Slither and fuzzers, then do manual line-by-line review, checking business logic, access control, economic attacks and integrations. They write findings rated critical, high, medium, low and informational with fixes. The team fixes issues, auditors review the fixes, and a final report is published. Audits reduce risk but do not guarantee safety, so add bug bounties and monitoring.
34

What is double spending and how does a blockchain prevent it?

Save to ▾
Show answer
Double spending is trying to spend the same digital money twice, for example sending the same coins to two merchants. A blockchain prevents it by keeping one shared ordering of transactions agreed through consensus. Once a transaction is included in a block, any conflicting transaction that spends the same funds is rejected as invalid. Merchants wait for several confirmations so that the chance of the block being replaced in a reorg becomes negligible.
35

What are testnets and how do you get test ETH?

Save to ▾
Show answer
Testnets are public networks that run the same software as mainnet but with valueless ETH, so developers can test deployments and dApps safely. Sepolia is the main testnet for application developers, and Hoodi replaced Holesky for validator and staking testing in 2025. Test ETH comes from faucets, which often require a small mainnet balance or a login to stop abuse. Many Layer 2s run their own Sepolia-based testnets bridged from Ethereum Sepolia.
36

A developer accidentally pushed a private key to a public GitHub repo. What do you do?

Save to ▾
Show answer
Treat the key as compromised immediately, because bots scan GitHub within seconds. Move all funds and tokens to a new secure wallet, revoke token approvals, and if the key owns contracts, transfer ownership or roles to a new multisig. Removing the commit is not enough since history and forks keep it. Then rotate any related API keys, add secret scanning and pre-commit hooks, and load keys from environment variables or a secrets manager.

Companies with offices in Gurgaon (7)

Frequently asked questions

Which companies hire Blockchain professionals in Gurgaon?

Companies with large offices in Gurgaon include Accenture, Deloitte, IBM, EY, KPMG, PwC, Mastercard. Use their company pages below to practise employer-specific sets.

Are Blockchain interviews in Gurgaon different from other cities?

The questions depend more on the company than the city. Gurgaon's mix of employers decides the style: Interviews often expect strong business understanding along with technical skills, especially for analytics and product-facing roles

How do I find Blockchain jobs in Gurgaon?

Shortlist companies with Gurgaon offices, keep your CV focused on Blockchain projects, apply on company career pages and job portals with the Gurgaon filter, and practise the questions on this page before each interview.