Courseiva

SALESFORCE-PD1 Practice Question: A developer needs to schedule a class to run nightly at midnight to clean up stale audit…

A developer needs to schedule a class to run nightly at midnight to clean up stale audit records. Which interface must the class implement?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

System.Schedulable

To use Schedulable Apex, the class must implement the Schedulable interface, which contains the execute(SchedulableContext SC) method.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    System.Schedulable

    Why this is correct

    Implementing the `System.Schedulable` interface is required because it exposes the `execute(SchedulableContext sc)` method, which enables Apex code to run asynchronously at specified times and dates via Cron expressions. This directly satisfies the requirement in the stem to schedule a class to run nightly at midnight, whereas standard synchronous execution or trigger frameworks lack the temporal capability needed for automated, recurring background maintenance jobs.

  • ✗

    Database.AllowsCallouts

    Why it's wrong here

    `Database.AllowsCallouts` is designed to permit asynchronous Apex jobs to make outbound HTTP requests to external web services, which is tempting because nightly data maintenance routines frequently require synchronising updates with external systems. However, this interface is entirely irrelevant for scheduling a class to run autonomously at midnight, as implementing it grants callout capabilities rather than defining the execution context required for scheduled jobs. To schedule a class, the developer must implement `Schedulable` instead.

  • ✗

    Queueable

    Why it's wrong here

    Queueable Apex lacks the native scheduling capabilities required to trigger execution at a specific time, such as midnight, because it is designed for asynchronous jobs that initiate immediately upon being queued. Developers use this interface to chain background processes or handle complex types that exceed the limitations of future methods. While it facilitates long-running operations, it cannot be invoked by a CRON expression, rendering it incapable of fulfilling the scheduled requirement specified in the prompt.

  • ✗

    Database.Batchable<SObject>

    Why it's wrong here

    Database.Batchable is designed for processing millions of records asynchronously across multiple execution chunks using stateful or stateless batches, making it tempting when developers encounter large data volumes that risk hitting governor limits. However, this interface fails the scenario because it does not provide an automated cron-based scheduling mechanism to run nightly at midnight. To execute a class automatically on a recurring schedule without manual intervention, the class must implement Schedulable instead, whereas Batchable requires a separate trigger mechanism or chaining from a scheduled context to run.

About these practice questions

Courseiva writes every SALESFORCE-PD1 question from scratch — 345 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

You might also like

Similar SALESFORCE-PD1 questions

Written and reviewed by Johnson Ajibi, MSc IT Security

Security Systems Architect · founder of Courseiva

Last reviewed August 2026 · checked against the official Salesforce exam blueprint

This SALESFORCE-PD1 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SALESFORCE-PD1 exam.