Interview Prep
Interview questions, roadmaps and practice sets
Tutorials
Free tutorials on 30+ topics
Blog
Career guides, skills and interview tips
Free PDFs
Notes, cheat sheets and question banks
Certificates
Free skill tests and course certificates
Tools & Whiteboard
Free tools you can use right in the browser
Practice Tests
Mock tests, MCQs and quick Q&A
Free LMS
Learn on the Uncodemy LMS
Choose the best training program according to your career.
Improve the performance of your business with our innovative Industrial Training Program.
Read More →
Our instructor-led training classes are designed to make you an expert.
Read More →
Real-life case studies are a great way to demonstrate your practical knowledge.
Read More →
Explore blogs, latest technologies and industry updates with practical examples.
Read More →Browse all available training programs and choose the right one for your career.
Read More →Know more about who we are and what we stand for.
Discover our mission to equip individuals with essential IT skills and industry expertise.
Read More →
Free tutorials, interview questions, tools and calculators to help you learn.
Explore →Learn, practice and plan your career — bilkul free.
Book a free video counselling session and pick the right course for you.
Read More →A good daily workout generator is mostly rules plus data, with an AI model used for the parts rules handle badly: understanding what the user says and explaining the plan. This guide shows the design, a working Python planner and the safety checks a fitness app needs.
Ask a chatbot for "a 20-minute home workout" and you will get something reasonable. Put the same idea inside a fitness app used by thousands of people, some with knee pain, some who trained legs yesterday, some with only a pair of dumbbells in a Mumbai flat, and "reasonable" is not good enough. The routine has to respect each user's equipment, time, level, soreness and recovery, and it must never suggest something unsafe. The practical answer is a hybrid: deterministic rules choose the exercises and the load, and a language model handles conversation and explanation.
| Input | Example | Why it matters |
|---|---|---|
| Goal | General fitness, fat loss, strength | Sets the balance of strength and cardio, rep ranges |
| Level | Beginner, intermediate | Exercise difficulty and volume |
| Equipment | None, dumbbells, resistance band, gym | Filters the exercise library |
| Time today | 20 minutes | Number of exercises |
| Recent history | Legs trained yesterday | Recovery between sessions for the same muscles |
| Soreness, pain, limitations | Sore shoulders; knee injury | Exclusions and safer alternatives |
| Feedback | "Too easy", skipped sets | Progression or regression next time |
Everything starts with a curated library, written and reviewed by a qualified trainer, where each exercise carries tags: muscle group, equipment needed, difficulty level, whether it is timed or counted in reps, and contraindications (for example "avoid with wrist pain"). The AI never invents exercises; it chooses from this list.
This simplified planner skips muscle groups trained yesterday (except core) or reported as sore, filters by equipment and level, fits the plan into the available time, and sets the volume by level.
EXERCISES = [
{"name": "Bodyweight squat", "group": "legs", "needs": None, "level": 1},
{"name": "Goblet squat", "group": "legs", "needs": "dumbbell", "level": 2},
{"name": "Reverse lunge", "group": "legs", "needs": None, "level": 2},
{"name": "Knee push-up", "group": "push", "needs": None, "level": 1},
{"name": "Push-up", "group": "push", "needs": None, "level": 2},
{"name": "Dumbbell row", "group": "pull", "needs": "dumbbell", "level": 1},
{"name": "Superman hold", "group": "pull", "needs": None, "level": 1, "timed": True},
{"name": "Plank", "group": "core", "needs": None, "level": 1, "timed": True},
{"name": "Dead bug", "group": "core", "needs": None, "level": 1},
]
def todays_plan(level, equipment, minutes, worked_yesterday, sore=()):
groups = [g for g in ["legs", "push", "pull", "core"]
if g not in sore and not (g in worked_yesterday and g != "core")]
per_exercise = 6 # minutes incl. rest, a rough planning figure
plan = []
for g in groups:
options = [e for e in EXERCISES
if e["group"] == g and e["level"] <= level
and (e["needs"] is None or e["needs"] in equipment)]
if options and len(plan) * per_exercise + per_exercise <= minutes:
best = max(options, key=lambda e: e["level"])
sets = 2 if level == 1 else 3
dose = (f"{20 if level == 1 else 30} s" if best.get("timed")
else f"{10 if level == 1 else 12} reps")
plan.append((best["name"], sets, dose))
return plan
for name, sets, dose in todays_plan(level=2, equipment={"dumbbell"}, minutes=20,
worked_yesterday={"legs"}, sore={"push"}):
print(f"{name}: {sets} x {dose}")
print("---")
for name, sets, dose in todays_plan(level=1, equipment=set(), minutes=30, worked_yesterday=set()):
print(f"{name}: {sets} x {dose}")
Output:
Dumbbell row: 3 x 12 reps
Plank: 3 x 30 s
---
Bodyweight squat: 2 x 10 reps
Knee push-up: 2 x 10 reps
Superman hold: 2 x 20 s
Plank: 2 x 20 s
The first user trained legs yesterday and has sore shoulders, so the planner skips legs and push and gives a short pull-and-core session. The second is a beginner with no equipment and 30 minutes, so they get a full-body circuit at beginner volume. A real app would add a warm-up and cool-down, cardio blocks, more exercises per group and rotation so the same moves do not repeat every day, but the principle is the same: every choice is explainable and testable.
After each session, ask two quick questions: how hard did it feel (a 1–10 effort rating) and did anything hurt? Then apply simple progression rules:
This is progressive overload in its simplest form. Machine learning can later tune these thresholds from real completion data, for example predicting which plans a user is likely to finish, but the rules make a safe starting point.
{"minutes": 15, "sore": ["lower back"]}. The planner then does the choosing.Ask the model for structured JSON and validate it before use. If it returns an exercise not in your library, or a duration over the user's limit, reject it. Do not let the model set loads or decide on medical questions.
Track completion rate of generated workouts, how many users are still active after four and eight weeks, average effort ratings, and pain reports. A useful public benchmark for overall activity is the World Health Organization's 2020 guideline for adults: 150–300 minutes of moderate aerobic activity a week, plus muscle-strengthening activity on two or more days. A weekly summary showing progress toward that target is easy to build and motivating for users.
If you want to turn this into a project, start with the app shell: a fitness planner with React and Firebase or a habit-tracking fitness app with badges. Add charts with a fitness tracker dashboard, and for the personalisation logic in general, see AI-based personalised recommendations in apps.
For a prototype, yes. For a product, use the model to interpret requests and explain plans, and keep exercise selection and progression in your own validated rules.
Not at the start. Rules based on level, equipment, recovery and feedback cover most needs. Add ML once you have enough completion data to learn from.
Exclude affected exercises, offer only gentle alternatives, and recommend that the user consult a doctor or physiotherapist. Never let the app suggest training through pain.