Course recommender aligned to a user's target job skills
Machine LearningModel answerLast updated
Design an end-to-end system that suggests learning courses matching a user's job-search or role goals, including job-posting text extraction, ranking, evaluation, and guardrails.
You are asked to design a small end-to-end ML system that recommends online learning courses to a user, where the goal is to help them succeed in a job search and/or in their current role.
Assume the following signals exist:
- Job activity: jobs the user applied to, jobs viewed or saved, jobs recommended to them.
- User profile: job title, skills, seniority, industry; the user's past course consumption with dwell and completion data; search queries.
- Course metadata: title, description, skills taught, difficulty, duration.
- Job posting text: description and requirements.
Deliver the following:
- An end-to-end architecture: data collection, feature generation, candidate generation, ranking, and serving.
- A concrete plan for turning job posting text into useful features, including at least one non-LLM approach and at least one LLM-based approach.
- A discussion of training labels, offline and online evaluation metrics, and key failure modes (cold start, bias, feedback loops).
- A short treatment of business constraints: freshness, diversity, exploration, and compliance.
Treat it as a whiteboard design exercise: state assumptions, make the trade-offs explicit, and be ready to defend your choices.
Hints
Hint 1
Start by pinning down how you measure success — clicks are a weak proxy; think about what 'course helped the user' actually means.
Hint 2
The catalog of courses is probably small relative to the user base, which changes where the hard part of the problem lives (intent modeling, not retrieval scale).
Hint 3
A shared skill vocabulary that connects job postings, user profiles, and courses is the linchpin — design around it.
Hint 4
For job-posting extraction, think about grounding LLM output to a known taxonomy so hallucinations get filtered out.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Clarify and set assumptions
Before designing, I'd ask a few questions and then state assumptions aloud.
Questions: Which surface ships first (a learning home page, a widget on a job page, email digests)? What does "success" mean operationally? Is the design for a marketplace-scale catalog or a small one?
Assumptions:
- First surface is a home page module; the same stack later serves job pages and notifications.
- Objective hierarchy: impression → click → enroll → meaningful watch time → completion → downstream outcome (skill added to profile, job applied to, offer). Optimizing clicks alone degrades quality because low-value, short courses attract clicks.
- ~100M monthly active users who see learning modules, ~25K courses with a few hundred added weekly, ~15M live job postings, peak ~20K QPS, p99 < 150 ms.
Key insight to say out loud: the course catalog is small, so approximate-nearest-neighbor retrieval is not the bottleneck. The hard part is modeling what the user needs to learn next — their target skills — and matching those against courses with the right difficulty and quality. Design around that.
API and entities
GET /recs?member_id=&surface=home&job_id=(optional)&k=10
→ [{course_id, score, reason: "covers Kubernetes, required by 4 jobs you saved"}]
Reasons come almost for free from a skill-gap design and raise trust and CTR.
Entities: Member (title + normalized title ID, seniority, industry, profile skills as taxonomy IDs, course history, open-to-work flag), JobPost (raw text, extracted skills with weights, seniority, freshness), Course (skills taught as taxonomy IDs, difficulty, duration, language, region availability, quality stats), Events (impression, click, enroll, watch seconds, complete, job view/save/apply, skill add, search query — all timestamped).
Everything joins on a shared skill taxonomy (a few tens of thousands of normalized skills). This is the spine of the design: jobs, users, and courses all speak the same vocabulary.
End-to-end architecture
- Collection. Client events → Kafka → stream processor (Flink/Samza) for near-real-time intent features; raw events land in a data lake for batch training.
- Features. Batch (daily): user skill profile, course quality aggregates, course and job embeddings. Streaming (minutes): recent job views/saves/applies and searches, exponentially decayed with roughly a 7-day half-life so intent fades when a job search ends. Write everything to a feature store with online/offline parity.
- Target skill vector. The central feature:
Action weights rise with commitment (recommended < viewed < saved < applied). The peer-skills term covers "succeed in current role."target(u) = Σ_jobs w(action, recency) · skills(job) + α · peer_skills(title(u)) gap(u) = target(u) − have(u) - Candidate generation (~200–500 per user): skill-gap retrieval via an inverted index from skill → courses; a two-tower user/course model trained on enrollments and completions served through ANN; "people who applied to similar jobs took these"; continuation of a started path; trending and new courses for exploration. Merge, dedupe, and — since the catalog is small — brute-force scoring as a fallback is genuinely feasible.
- Ranking. Multi-task GBDT or deep model with heads for p(click), p(enroll), E[watch fraction | enroll]:
Features: gap overlap, difficulty vs. seniority, duration vs. stated time budget, course quality, recency of related job activity, two-tower similarity, author/category affinity, context.score = p(enroll) · (a + b·E[completion]) + c · gap_coverage - Re-ranking and serving. Business rules (below), per-user top-K caching, recompute on strong-intent events, and log every impression with position, model version, and propensity score.
Extracting features from job posting text
Non-LLM:
- Normalize text, then match against the skill dictionary with an Aho-Corasick automaton and a synonym map ("k8s" → Kubernetes, "ML" → Machine Learning in context).
- Train a sequence tagger (CRF or BiLSTM-CRF) on weakly-labeled data — recruiter-entered skills on postings are a great free label source — to catch skills missing from the dictionary.
- Section-aware weighting: classify sentences as requirements, nice-to-have, or responsibilities; skills in "requirements" weigh more.
- Corpus-level statistics: TF-IDF of skills within a job family to down-weight generic skills like "communication" and derive seniority signals.
LLM-based:
- Prompt a model to emit structured JSON
{skill, required|preferred, level, years}, then ground every extracted skill to the taxonomy via embedding nearest-neighbor and drop anything that doesn't match a real skill ID. Grounding is the anti-hallucination step. - Run offline and in batch on new or edited postings only (~1M/day), or distill into a small fine-tuned encoder for scale.
- Use sentence embeddings of postings and course descriptions for semantic matching and cold start.
Extraction evaluation: precision/recall on a human-labeled sample and agreement with recruiter-tagged skills; track per-slice error (e.g., non-English or terse postings).
Labels, metrics, failure modes
Labels: positives are enrollments (weighted), with completion or >30% watch as a stronger signal; negatives are impressions without clicks, excluding below-the-fold impressions. Delayed outcomes (skill added, application, offer within 30–90 days) are sparse — use for evaluation and as low-weight auxiliary heads. Correct position bias with inverse-propensity weighting or a position feature pinned to a constant at serving.
Offline: recall@200 per generator; NDCG@10 and AUC for the ranker plus per-head calibration; counterfactual/off-policy estimates for the new policy against logged propensities.
Online: A/B tests on enroll rate (primary), completion rate, skill-added rate, and downstream job-search outcomes (apply rate, offer rate) as guardrail/secondary metrics, plus latency and error rates.
Failure modes:
- Cold start: new users have no history — use profile title/industry peer priors and popular-by-role courses. New courses have no engagement — route through content-based matching and an exploration budget.
- Bias: position and popularity bias propagate; mitigate with propensity weighting and calibrated scores. Watch fairness across roles/industries and avoid over-indexing on already-popular fields.
- Feedback loops: the ranker only sees what it served — keep a random or epsilon-greedy exploration slice and log propensities for unbiased learning.
- Liveness: a user who just applied to 10 jobs should see intent-driven recs within minutes, not the next day.
Business constraints
Freshness: streaming features for intent; new courses enter an exploration pool within hours. Diversity: cap items per skill family and per author; MMR-style re-ranking. Exploration: reserve ~5–10% of impressions for learning. Compliance: honor region/language availability, respect consent and licensing for course content, avoid protected-attribute targeting, and keep explanations auditable.
Common mistakes to avoid: optimizing raw clicks, skipping grounding for LLM extraction, forgetting position-bias correction, and treating delayed outcomes as if they were dense labels.