Quiz on TrishulAPI

img

This quiz is generated on trishul api using the GitHub repository. I generated the questions from chatgpt.

You can access the repository at https://github.com/trishulapi

  • Total Question: 10
  • Views: 143052 times
  • Attempted: 22 times
  • Published by : on 03-Jan-2026 12:33 pm

MCQ Questions on Quiz on TrishulAPI

Q. What is the primary purpose of the trishulapi/core package?

A. It’s a frontend UI library for building React apps
B. It is the core concept of the TrishulApi framework
C. It provides CSS utilities for web projects
D. It’s a testing framework for Python applications
Correct: Option (B)
Explanation: The core package provides foundational functionality for the TrishulApi framework. 1

Q. Which language is trishulapi/core primarily written in?

A. Java
B. PHP
C. Python
D. Go
Correct: Option (B)
Explanation: The repository primarily contains PHP source code. 2

Q. In TrishulApi, what is the purpose of the Model class?

A. Manage database tables and CRUD operations
B. Render HTML templates
C. Handle file uploads
D. Send emails
Correct: Option (A)
Explanation: The Model class represents a database table and provides functions to interact with it. 3

Q. Which HTTP method type is represented by RequestType::POST in routes?

A. GET
B. PUT
C. POST
D. DELETE
Correct: Option (C)
Explanation: RequestType::POST specifies a POST method in the router definitions. 4

Q. What does BasicAuthMiddleware check in a request?

A. The query parameters
B. Basic Authorization header
C. JSON body content
D. Request cookies
Correct: Option (B)
Explanation: BasicAuthMiddleware checks for Authorization header and validates credentials. 5

Q. Where would you define a controller method for updating a todo item?

A. In UserController
B. In TodoController
C. In Router itself
D. In the .env file
Correct: Option (B)
Explanation: Update methods for todos are defined in the TodoController. 6

Q. What environment file variables are commonly set for a TrishulApi project?

A. PORT, HOST, SESSION_SECRET
B. DB_HOST, DB_NAME, ENABLE_SWAGGER
C. API_KEY, TOKEN_SECRET
D. DOMAIN, CACHE_ENABLED
Correct: Option (B)
Explanation: The .env file includes database and app config variables, including ENABLE_SWAGGER. 7

Q. What is the purpose of the Router::parent() function?

A. To define nested route groups
B. To reset application cache
C. To register event listeners
D. To render UI components
Correct: Option (A)
Explanation: Router::parent() groups related endpoints under a common route prefix. 8

Q. Which response type class is used to send JSON responses?

A. HtmlResponse
B. TextResponse
C. Response
D. XmlResponse
Correct: Option (C)
Explanation: Response::json() is used to send structured JSON output. 9

Q. Which of the following must be implemented by middleware for TrishulApi?

A. MiddlewareInterface
B. DatabaseInterface
C. SerializerInterface
D. RenderInterface
Correct: Option (A)
Explanation: Middleware classes implement MiddlewareInterface to intercept requests. 10