Structure is a local-first macOS desktop IDE for C++ technical interview training, with secondary Python support. It is designed to behave like a strict but helpful interviewer, tutor, debugger, and spaced-repetition coach rather than an autocomplete tool.
The primary goal is not to give answers. The primary goal is to help you become capable of solving DSA problems without assistance.
- Native Qt 6 / C++ desktop shell
- Four-panel IDE layout: problem, editor, test output, tutor/progress
- C++ and Python starter code support
- C++ sample and hidden test execution through
clang++ - Python sample and hidden test execution through
python3 - SQLite persistence for problems, attempts, settings, sessions, and review cards
- Built-in local problem pack with arrays, hashing, two pointers, sliding window, stack, binary search, graphs, trees, heaps, DP, intervals, and backtracking
- Mode selector for Learn, Interview, Debug, Speedrun, and Review
- Progressive hint ladder with dependency tracking
- Local OpenAI-compatible LLM chat endpoint integration
- One-command local Gemma 4 setup through Ollama
- Review card generation after each submitted attempt
- Basic progress dashboard and interview readiness estimate
Install Qt 6 and CMake. With Homebrew:
brew install cmake qtIf you installed Qt with the Qt Online Installer, the CMake prefix is usually the kit folder, for example:
~/Qt/6.x.y/macos
You also need a C++ compiler. macOS Command Line Tools provide clang++:
xcode-select --installSQLite is used through Qt SQL's SQLite driver.
cmake -S . -B build -DCMAKE_PREFIX_PATH="$(brew --prefix qt)"
cmake --build buildWith the Qt Online Installer path:
cmake -S . -B build -DCMAKE_PREFIX_PATH="$HOME/Qt/6.x.y/macos"
cmake --build buildRun the app:
open build/Structure.appIf you prefer launching the executable directly:
./build/Structure.app/Contents/MacOS/StructureStructure defaults to Gemma 4 through Ollama at:
http://127.0.0.1:11434/v1/chat/completions
The one-command setup installs Ollama if needed, starts the local server, chooses a performant Gemma 4 model for the machine, pulls it, warms it, keeps it resident, and updates any existing Structure SQLite settings.
scripts/setup-gemma4-local.shYou can also run it through CMake:
cmake --build build --target setup-local-llmDefault model selection:
speedprofile:gemma4:e2b, the default for responsive tutoringbalancedprofile: also usesgemma4:e2buntil larger models can consistently answer inside the 10-second budgetqualityprofile: usesgemma4:26bon machines with at least 48 GiB RAM, otherwisegemma4:e2b
Override the model or profile:
STRUCTURE_GEMMA4_MODEL=gemma4:26b scripts/setup-gemma4-local.sh
STRUCTURE_MODEL_PROFILE=speed scripts/setup-gemma4-local.shStart the local server without pulling a model:
scripts/run-gemma4-local.shCheck local model latency:
scripts/check-gemma4-local.shFor fast first responses, Structure also warms the configured model once in the background when the app opens. When the configured endpoint is Ollama on port 11434, Structure automatically uses Ollama's native /api/chat path with think=false for tutor responses, plus keep_alive=1h, so the Gemma model returns concise final answers instead of spending the whole 10-second budget on reasoning text. Other endpoints continue to use the OpenAI-compatible /v1/chat/completions request shape. You can adjust timeout, max tokens, temperature, keep-alive, and startup warmup in Settings.
The scripts use Ollama on macOS because Ollama supports Apple M-series CPU/GPU execution and exposes an OpenAI-compatible /v1/chat/completions endpoint. For this app, that gives the simplest fast local path while preserving the existing local-first HTTP client.
Structure expects a local OpenAI-compatible chat endpoint.
Example endpoint:
http://127.0.0.1:11434/v1/chat/completions
You may run a local model using Ollama, llama.cpp, llama-cpp-python, MLX-backed tools, or another compatible server. Configure the endpoint and model name in Settings. The default model name is gemma4:e2b, the default endpoint is http://127.0.0.1:11434/v1/chat/completions, the default max response budget is 512 tokens, and the default timeout is 10 seconds.
Example llama.cpp-style server shape:
llama-server -m /path/to/model.gguf --port 8080Ollama-compatible OpenAI endpoints often use:
http://localhost:11434/v1/chat/completions
Built-in problems live in:
src/data/seed_problems.json
Each problem includes:
- title, difficulty, tags
- stdin/stdout problem statement
- examples and constraints
- C++ and Python starter code
- sample tests and hidden local tests
- expected time and space complexity
- pattern metadata and teaching notes
To add a problem, add another object to the problems array and rebuild the app. Existing local databases seed only when empty, so delete the local app database if you want to reload seed data during development.
src/
app/ QApplication setup and styling
ui/ Qt Widgets IDE panels
core/ Problem, Attempt, TestCase, ReviewCard, Session models
execution/ C++ and Python subprocess runners
ai/ Local LLM client, prompt builder, tutor engine, hint ladder
storage/ SQLite database and repositories
analysis/ MVP static-analysis hooks
data/ Seed problems and prompt templates
Code execution is intentionally local. C++ attempts are written to a temporary directory, compiled with clang++, executed with a timeout, and compared against expected stdout.
Structure is local-first. Your code, attempts, review cards, and interview practice history are stored locally on your machine. The app is designed to work with local LLMs and does not require cloud inference.
Structure is available under the MIT License. See LICENSE.
Structure does not include cloud sync, accounts, social features, scraping, company-named prep packs, browser extensions, voice mode, or mobile support in the MVP.