LearnThatStack Ace your next interview
Blockchain Technologies
Foundry.
21 Qs 3 free
Change topic Change
Drill · questions

All questions

of 21
Beginner 6
01

How do you initialize a new Foundry project?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

You initialize a new Foundry project using the forge init command:

forge init my-project
cd my-project

This creates a standard project structure with:

  • src/ - Smart contract source files
  • test/ - Test files
  • script/ - Deployment and interaction scripts
  • foundry.toml - Configuration file
  • lib/ - Dependencies/libraries
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

02

Explain the basic structure of a Foundry test and how to run tests.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Foundry tests are written in Solidity and follow a specific naming convention. Test functions must start with test and test contracts should inherit from Test:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "forge-std/Test.sol";
import "../src/Counter.sol";
contract CounterTest is Test {
    Counter public counter;
    function setUp() public {
        counter = new Counter();
    }
    function testIncrement() public {
        counter.increment();
        assertEq(counter.number(), 1);
    }
}

Run tests using:

forge test                    # Run all tests
forge test --match-test testIncrement  # Run specific test
forge test -vvv              # Verbose output
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

03

What are the different verbosity levels in Forge testing?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Forge provides multiple verbosity levels controlled by the number of v flags:

  • Default: Shows test results only
  • -v: Shows logs for failing tests
  • -vv: Shows logs for all tests and gas usage
  • -vvv: Shows execution traces for failing tests
  • -vvvv: Shows execution traces for all tests and setup
  • -vvvvv: Shows execution and setup traces, plus internal steps
    Higher verbosity levels are crucial for debugging failed tests and understanding gas consumption patterns.
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

The model's verdict: “

The interactive diagram is below the answer - jump to diagram ↓

This answer is explained by a shared concept diagram - open

Tailored explanation · switch back to · ·
Point the redraw:
How well did you know this?
AI:

04

Explain how to manage dependencies in Foundry.

Part of Pro
05

What is the difference between `forge build` and `forge compile`?

Part of Pro
06

How do you handle testing of view functions and state queries?

Part of Pro
Intermediate 10
07

How do you handle test fixtures and setup in Foundry?

Part of Pro
08

Explain fuzzing in Foundry and provide an example.

Part of Pro
09

What are cheatcodes in Foundry and give examples of commonly used ones?

Part of Pro
10

How do you test events in Foundry?

Part of Pro
11

How do you deploy contracts using Foundry scripts?

Part of Pro
12

How do you handle different network configurations in Foundry?

Part of Pro
13

How do you perform fork testing in Foundry?

Part of Pro
14

How do you debug failing tests in Foundry?

Part of Pro
15

What are some best practices for organizing Foundry test suites?

Part of Pro
16

How do you configure and use Foundry with continuous integration (CI)?

Part of Pro
Expert 5
17

How do you perform invariant testing (stateful fuzzing) in Foundry?

Part of Pro
18

How do you optimize gas usage when testing with Foundry?

Part of Pro
19

How do you handle upgradeable contracts testing in Foundry?

Part of Pro
20

How do you interact with external APIs or oracles in Foundry tests?

Part of Pro
21

How do you test contract interactions and composability?

Part of Pro

No matches

Try a different filter or search term.

Pro · $10/mo

18 of 21 Foundry answers are gated.

Full answers, code samples, AI explanations - simpler, deeper, or as an interactive diagram. Cancel anytime.

  • Full answers + code
  • AI explain - simpler, deeper, or visualized
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

JAM

JavaScript, APIs, and Markup

Serverless on AWS

Serverless Architecture on AWS

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Flutter Mobile

Flutter Cross-Platform Mobile Development

Cross-cutting topics 44 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

Web3 / Ethereum

Solidity, Ethereum, Hardhat, Foundry

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git
Big-O & Complexity Analysis Arrays, Strings & Hash Tables Linked Lists, Stacks & Queues Trees, BSTs & Heaps Graphs Sorting, Searching & Recursion Operating Systems Concurrency & Multithreading Networking for Developers Git & Version Control API Design 45 Distributed Systems Fundamentals 34

Cross-cutting topics 43 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.


Cross-cutting topics 45 topics

Interviewers also test these - they're common to every stack, whichever one you picked above.