Model Recurring Tasks With Pluggable Recurrence Rules

Last updated: November 29, 2026

Quick Overview

Design the classes behind Asana's repeating tasks: when a recurring task is completed, the next instance is created with the correct due date for daily, weekly-on-certain-days and monthly-on-a-day schedules.

Asana
Software Engineering Fundamentals
Software Engineer
Asana
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Medium

0

0

0 solved


Design the classes behind Asana's repeating tasks: when a recurring task is completed, the next instance is created with the correct due date for daily, weekly-on-certain-days and monthly-on-a-day schedules.

Asana's onsite often includes an object-oriented modeling exercise where you build a small, extensible domain in a shared editor. Repeating tasks are a real product feature with real edge cases (the 31st of the month, multiple weekdays), so the interviewer looks for clean abstractions and correct date logic, not framework trivia.

What the Interviewer Expects
  • Introduces a RecurrenceRule abstraction so new schedules need no changes to Task
  • Keeps rules immutable value objects
  • Handles month-end clamping and multiple weekdays correctly
  • Decides what gets copied to the next instance (subtasks, assignee) and what does not (comments, completion)
  • Writes or describes focused unit tests for each rule
Key Topics to Cover
object-oriented design
strategy pattern
date arithmetic
value objects
extensibility
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • How would you support 'every second Tuesday of the month'?
  • Should the next due date be computed from the old due date or from the completion date? Support both.
  • How do you handle time zones when a task has a due time?
  • How would you serialize rules for storage and the public API?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Completing a recurring task marks it done and spawns a new task with the next due date. Rules: every N days, weekly on a set of weekdays, monthly on day D (clamped to the last day of short months). No...

High-Level Design

Task holds a reference to a RecurrenceRule. Each rule implements next_due(prev_due). TaskService.complete owns the lifecycle: mark done, ask the rule for the next date, build the new instance....


Submit Your Answer
Markdown supported