If t1 completes, trigger t2 and t3 in parallel.
💡 Model Answer
When t1 finishes, you can trigger t2 and t3 concurrently by using an event-driven approach. In a simple script, you could call t2 and t3 in separate threads or async tasks after t1’s completion. For example, in Python:
import threading
def t1():
# work
pass
def t2():
# work
pass
def t3():
# work
pass
# run t1
threading.Thread(target=t1).start()
# after t1 finishes, start t2 and t3
# in real code, use a callback or a futureIn production, a workflow engine or message queue (e.g., RabbitMQ, Kafka) can publish a completion event for t1, and consumers for t2 and t3 subscribe to that event, starting them immediately. The key idea is to decouple the trigger from the tasks and allow the system to schedule them in parallel once the prerequisite is satisfied. Complexity is O(1) for the trigger logic, and the parallel execution cost depends on the tasks themselves.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.
Get Assisting AI — Starts at ₹500