Trishul API MCQs with answers Page - 4

Here, you will find a collection of MCQ questions on Trishul API . Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833K Points
Coach

Q. What is the purpose of MiddlewareInterface?

  • (A) Handle database queries
  • (B) Modify requests and responses
  • (C) Render UI
  • (D) Compile code

A

Admin • 833K Points
Coach

Q. Which method modifies incoming request in middleware?

  • (A) handle()
  • (B) process()
  • (C) execute()
  • (D) init()

A

Admin • 833K Points
Coach

Q. Which method modifies outgoing response in middleware?

  • (A) handle()
  • (B) response()
  • (C) handle_response()
  • (D) send()

A

Admin • 833K Points
Coach

Q. Which class provides database connection?

  • (A) PDO
  • (B) DB
  • (C) DatabaseManager
  • (D) Connection

A

Admin • 833K Points
Coach

Q. What does DB::get_connection() return?

  • (A) MySQL connection
  • (B) PDO object
  • (C) ORM instance
  • (D) JSON response

A

Admin • 833K Points
Coach

Q. Which class should be extended to create a model in Trishul API?

  • (A) Controller
  • (B) Model
  • (C) DB
  • (D) Router

A

Admin • 833K Points
Coach

Q. Which property defines the table name in a Trishul model?

Code:
public string $table_name = 'users';
  • (A) $table
  • (B) $table_name
  • (C) $db_table
  • (D) $tablename

A

Admin • 833K Points
Coach

Q. What is the default primary key in Trishul Model if not specified?

  • (A) user_id
  • (B) pk
  • (C) id
  • (D) primary

A

Admin • 833K Points
Coach

Q. Which property is used to override the primary key in a model?

Code:
public string $primary_key = 'user_id';
  • (A) $key
  • (B) $primary
  • (C) $primary_key
  • (D) $id

A

Admin • 833K Points
Coach

Q. Why is parent::__construct() called in the model constructor?

  • (A) To initialize routing
  • (B) To initialize base model functionality
  • (C) To start server
  • (D) To connect frontend