Programming MCQs Feed

📊 Trishul API
Q. Which class is used to define headers?
  • (A) HttpHeader
  • (B) RequestHeader
  • (C) TrishulClientHeader
  • (D) HeaderBuilder
💬 Discuss
✅ Correct Answer: (C) TrishulClientHeader

Explanation: Headers are encapsulated in TrishulClientHeader.

📊 Trishul API
Q. What is passed to __makeCurlRequest() as requestType?
  • (A) URL
  • (B) HTTP method (GET, POST, etc.)
  • (C) Headers
  • (D) Response
💬 Discuss
✅ Correct Answer: (B) HTTP method (GET, POST, etc.)

Explanation: Defines HTTP method type.

📊 Trishul API
Q. Which parameter is NOT optional in client methods?
  • (A) URL
  • (B) Headers
  • (C) Data
  • (D) All are required
💬 Discuss
✅ Correct Answer: (D) All are required

Explanation: All required parameters must be provided.

📊 Trishul API
Q. What happens inside __makeCurlRequest()?
  • (A) Creates DB connection
  • (B) Sets up and executes cURL request
  • (C) Parses JSON
  • (D) Routes request
💬 Discuss
✅ Correct Answer: (B) Sets up and executes cURL request

Explanation: Handles cURL setup and execution.

📊 Trishul API
Q. Which method is used for PUT request (mono variant)?
  • (A) put()
  • (B) put_mono()
  • (C) update_mono()
  • (D) put_flux()
💬 Discuss
✅ Correct Answer: (B) put_mono()

Explanation: put_mono() handles PUT requests.

📊 Trishul API
Q. Which method enforces array type for data?
  • (A) post_mono()
  • (B) put_mono()
  • (C) post_flux()
  • (D) get_mono()
💬 Discuss
✅ Correct Answer: (C) post_flux()

Explanation: Flux methods require array data.

📊 Trishul API
Q. Which of the following is a correct usage?
Code:
$client->get_mono('https://api.example.com/data', $headers);
  • (A) Correct
  • (B) Incorrect - missing data param
  • (C) Incorrect - wrong method
  • (D) Incorrect - headers must be array
💬 Discuss
✅ Correct Answer: (A) Correct

Explanation: GET mono requires URL and headers only.

📊 Trishul API
Q. What type of class is TrishulApi\Core\Data\Model?
  • (A) Interface
  • (B) Concrete class
  • (C) Abstract class
  • (D) Final class
💬 Discuss
✅ Correct Answer: (C) Abstract class

Explanation: Model is an abstract class and must be extended.

📊 Trishul API
Q. Which keyword correctly defines table name in Model v1.x?
  • (A) public string $table_name
  • (B) public static string $table_name
  • (C) protected string $table
  • (D) static $table
💬 Discuss
✅ Correct Answer: (B) public static string $table_name

Explanation: In advanced Model, properties are static.

📊 Trishul API
Q. What does Model::all() return?
  • (A) Single object
  • (B) Boolean
  • (C) Array of records
  • (D) PDO instance
💬 Discuss
✅ Correct Answer: (C) Array of records

Explanation: all() returns all rows as an array.