Skills101
← All practice quizzes

Quiz: Scheduling and Async

5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass

Run code on a timer and move slow work off the request thread. Learn @Scheduled with fixedRate, fixedDelay and cron expressions, @Async with CompletableFuture, thread pools, and the traps of running jobs on several servers.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    A job has fixedDelay = 10 seconds and each run takes 4 seconds. How far apart are the START times of two runs?

  2. Question 2

    With fixedRate = 10 seconds, a run unexpectedly takes 15 seconds. What happens to the next run?

  3. Question 3

    What does the Spring cron expression 0 30 18 * * SAT mean?

  4. Question 4

    Why should a business-time cron job set zone = "Asia/Kolkata"?

  5. Question 5

    What does this print?

    public class Main {
        public static void main(String[] args) {
            int period = 5;
            int[] durations = {2, 8, 2};
            int end = 0;
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < durations.length; i++) {
                int start = Math.max(i * period, end);
                sb.append(start).append(' ');
                end = start + durations[i];
            }
            System.out.println(sb.toString().trim());
        }
    }
    
🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →