What is the folder structure of CodeIgniter 4?
Why Interviewers Ask This
Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid CodeIgniter basics — a prerequisite for any developer role.
Answer
CodeIgniter 4 has a clean directory structure: app/ (your application code — Controllers, Models, Views, Config, Filters, Libraries), public/ (web root — index.php, CSS, JavaScript, images — the only publicly accessible folder), system/ (the CI4 framework core — do not modify), writable/ (logs, cache, sessions, uploads — must be writable by the web server), tests/ (test files), vendor/ (Composer dependencies). The app/Config/ directory contains all configuration files as PHP classes. The app/Views/ directory contains view templates. Unlike older frameworks, CI4 separates the web root from the application code — the application never lives inside the public folder, improving security.
Pro Tip
Back up your answer with a specific project or situation. Saying 'In my last CodeIgniter project, I used this when...' immediately makes your answer more credible and memorable.