Unit 1 - Practice Quiz

INT221 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 What does the acronym MVC stand for in software architecture?

A. Model Version Control
B. Main View Configuration
C. Method View Class
D. Model View Controller

2 In the MVC architecture, which component is primarily responsible for managing the data logic and business rules?

A. Router
B. Controller
C. Model
D. View

3 Which component of the MVC framework interacts directly with the user interface and displays data?

A. Model
B. View
C. Controller
D. Kernel

4 Who represents the "Traffic Cop" in the MVC architecture, directing data flow between the Model and the View?

A. Route
B. Server
C. Controller
D. Database

5 If a user sends a request to an MVC application, what is the typical flow of execution?

A.
B.
C.
D.

6 Which of the following is NOT a benefit of using the MVC framework?

A. Simultaneous development by multiple developers
B. Separation of concerns
C. Ease of maintenance
D. Increased coupling between logic and presentation

7 Who is the original creator of the Laravel framework?

A. EllisLab
B. Fabien Potencier
C. Rasmus Lerdorf
D. Taylor Otwell

8 Laravel is built upon which underlying PHP framework components?

A. CodeIgniter
B. Symfony
C. Zend
D. Yii

9 What is the name of the built-in templating engine used in Laravel?

A. Mustache
B. Smarty
C. Blade
D. Twig

10 Which feature in Laravel allows for an expressive, fluent way to interact with databases using Model classes?

A. PDO Wrapper
B. Eloquent ORM
C. Doctrine
D. Active Record

11 What is Composer in the context of PHP and Laravel development?

A. A server configuration tool
B. A frontend framework
C. A database management tool
D. A dependency manager for PHP

12 Which file does Composer primarily use to list project dependencies?

A. package.json
B. composer.json
C. composer.lock
D. config.php

13 When installing Composer globally, which directory allows the composer command to be run from anywhere in the terminal?

A. The downloads folder
B. The project root
C. A directory in the system's
D. The apache htdocs folder

14 Which command is used to install the dependencies defined in composer.json for an existing project?

A. php install
B. composer new
C. composer install
D. composer get

15 What is the purpose of the composer.lock file?

A. It locks the database to prevent writes.
B. It encrypts the PHP source code.
C. It prevents the project from being deleted.
D. It locks the dependencies to specific versions to ensure consistency.

16 Which folder is automatically generated by Composer to store downloaded libraries?

A. vendor
B. libs
C. packages
D. modules

17 Which Composer command allows you to create a new Laravel project from the command line?

A. composer init laravel
B. composer new laravel
C. composer download laravel
D. composer create-project laravel/laravel project-name

18 If the Laravel Installer is globally installed, which command creates a new project?

A. php laravel new
B. laravel new project-name
C. composer laravel new
D. laravel create project-name

19 What is the minimum PHP version required for the latest major versions of Laravel (e.g., Laravel 10/11)?

A. PHP 7.4
B. PHP 5.6
C. PHP 7.0
D. PHP 8.1 or higher

20 Which command is used to start the local development server provided by Laravel?

A. php artisan serve
B. composer start
C. php start
D. npm run dev

21 In a standard Laravel directory structure, where is the entry point (index.php) located?

A. public/
B. root directory
C. app/
D. resources/

22 Which directory contains the User.php model by default in a fresh Laravel installation?

A. app/Models
B. resources/models
C. database/models
D. app/Http

23 Where are the application's configuration files stored?

A. system/config
B. app/Config
C. config/
D. .env

24 Which directory holds the migration files, model factories, and seeds?

A. database/
B. storage/
C. app/Database
D. resources/

25 In which directory would you find your uncompiled views (Blade templates) and raw assets (LESS, SASS, JS)?

A. app/Views
B. resources/
C. public/
D. views/

26 What is the primary purpose of the .env file in the project root?

A. To store environment-specific configuration variables
B. To store database migrations
C. To list composer dependencies
D. To cache the configuration

27 Which Artisan command generates the application key found in the .env file?

A. php artisan key:generate
B. php artisan config:cache
C. php artisan init
D. php artisan make:key

28 Where are the Controller files located within the Laravel directory structure?

A. app/Http/Controllers
B. resources/controllers
C. routes/controllers
D. app/Controllers

29 Which file is responsible for defining web routes in a Laravel application?

A. routes/console.php
B. routes/web.php
C. routes/api.php
D. app/Http/routes.php

30 What is Artisan in Laravel?

A. The authentication system
B. The command-line interface (CLI) included with Laravel
C. The template engine
D. The database engine

31 Which Artisan command allows you to view a list of all available commands?

A. php artisan show
B. php artisan list
C. php artisan help
D. php artisan commands

32 Which command creates a new Controller class named ProductController?

A. php artisan make:controller ProductController
B. php artisan controller:make ProductController
C. php artisan new:controller ProductController
D. php artisan create:controller ProductController

33 To create a migration file for a database change, which command is used?

A. php artisan make:migration
B. php artisan db:migration
C. php artisan create:table
D. php artisan migration:new

34 Which Artisan command executes the pending database migrations?

A. php artisan migrate
B. php artisan migrate:install
C. php artisan db:push
D. php artisan migrate:run

35 What does the php artisan tinker command do?

A. Optimizes the application
B. Opens an interactive REPL (Read-Eval-Print Loop) for the application
C. Fixes syntax errors
D. Clears the cache

36 Which directory contains the autoload.php file generated by Composer?

A. vendor/
B. bootstrap/
C. app/
D. public/

37 What is the purpose of the storage/ directory?

A. Stores the configuration files
B. Stores the database files
C. Stores compiled Blade templates, file based sessions, and logs
D. Stores the source code

38 In the routes/ directory, what is api.php used for?

A. Defining console commands
B. Defining stateless routes (RESTful) usually for mobile apps or external consumers
C. Defining broadcasting channels
D. Defining routes that return Views

39 Which Artisan command would you use to clear the application cache?

A. php artisan clean
B. php artisan flush
C. php artisan clear:cache
D. php artisan cache:clear

40 Laravel uses PSR-4 autoloading. What does this primarily facilitate?

A. Automatic database connection
B. Security encryption
C. Loading classes automatically based on namespaces and file paths
D. Frontend asset compilation

41 What is the function of Middleware in Laravel?

A. To compile CSS
B. To store database records
C. To render HTML views
D. To filter HTTP requests entering the application

42 Which folder serves as the bootstrap location for loading the framework?

A. bootstrap/
B. init/
C. launch/
D. start/

43 Which command creates a Model and a Migration simultaneously?

A. php artisan make:model Name --migration
B. php artisan create:model Name -mig
C. php artisan make:model Name -m
D. Both A and B

44 If you see a Whoops, looks like something went wrong page, what setting in .env controls the detail level of this error?

A. APP_ENV
B. APP_DEBUG
C. DB_CONNECTION
D. APP_KEY

45 The App namespace in Laravel usually maps to which directory?

A. code/
B. src/
C. application/
D. app/

46 In MVC, if a logic calculation requires the formula , where should this calculation ideally reside?

A. In the View file
B. In the Model or a Service class
C. In the Route definition
D. In the config folder

47 Which PHP extension is almost always required for Laravel to run (handling strings)?

A. gd
B. mbstring
C. soap
D. imagick

48 To put the application into maintenance mode, which Artisan command is used?

A. php artisan stop
B. php artisan down
C. php artisan pause
D. php artisan maintenance

49 Which directory in Laravel is generally meant to be writable by the web server?

A. app
B. routes
C. config
D. storage

50 What is the syntax to output a variable $name in a Blade view, automatically escaping it?

A. <?= $name ?>
B. {{ $name }}
C. { $name }
D. @echo $name