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 →An app recommends personalised content by logging what each user does (views, plays, likes, purchases, skips), using that history to find a few hundred candidate items, ranking them with a model that predicts what the user is likely to engage with next, and then filtering the list for freshness, variety and business rules. You can start with a simple item-to-item similarity method that needs no machine learning framework, and move to trained ranking models once you have enough data.
What should a news app show Aman when he opens it at 8 a.m.? He read two cricket stories yesterday, skipped a budget explainer and has never opened the tech section. A recommender turns that history into a ranked list. The rest of this guide explains how, from the data you log to the code that produces the list.
| Layer | Question it answers | Typical starting point |
|---|---|---|
| Events | What did the user do? | Log views, clicks, watch time, likes, add-to-cart and skips, with user id, item id and timestamp |
| Candidate generation | Which few hundred items out of thousands are worth scoring? | Similar items, trending items, items from followed creators or categories |
| Ranking | In what order should those candidates appear? | A rule-based score first; later a trained model such as gradient-boosted trees |
| Re-ranking and rules | Is the final list fresh, varied and allowed? | Remove already-seen items, cap one creator per screen, respect age and region rules |
Large platforms build each layer with dedicated teams, but the same shape works for a college events app or a small e-commerce store in Jaipur. What changes is how sophisticated each layer is.
Recommendation quality is limited by data quality. Decide early on a clean event schema, for example:
{ "user_id": "u_1842", "item_id": "a_77", "event": "read",
"seconds": 95, "ts": "2026-11-16T08:04:11+05:30", "source": "home_feed" }
source, so you can later tell whether a click came from your recommendations or from search.Tools such as Firebase Analytics, Segment or your own backend table can collect these. What matters is that item ids are consistent across the app, the website and the catalogue.
Item-to-item collaborative filtering says: "people who read this also read that". It is simple, explainable and works well with implicit data. Here is a complete example with five users and six articles, using only NumPy:
import numpy as np
# rows = users, columns = articles; 1 = the user read it
articles = ["IPL auction", "Budget 2026", "UPI tips", "Cricket stats", "Tax saving", "Phone review"]
reads = np.array([
[1, 0, 0, 1, 0, 0], # Aman
[1, 0, 0, 1, 0, 1], # Bhavna
[0, 1, 1, 0, 1, 0], # Chirag
[0, 1, 0, 0, 1, 0], # Deepa
[1, 0, 1, 0, 0, 1], # Esha
])
# cosine similarity between article columns
norms = np.linalg.norm(reads, axis=0)
sim = (reads.T @ reads) / np.outer(norms, norms)
np.fill_diagonal(sim, 0)
def recommend(user_row, k=2):
scores = sim @ user_row # add up similarity to everything the user read
scores[user_row == 1] = -1 # never recommend what they already read
top = np.argsort(scores)[::-1][:k]
return [(articles[i], round(float(scores[i]), 2)) for i in top if scores[i] > 0]
new_user = np.array([0, 0, 0, 0, 1, 0]) # has read only "Tax saving"
print("Aman ->", recommend(reads[0]))
print("Deepa ->", recommend(reads[3]))
print("New ->", recommend(new_user))
Output:
Aman -> [('Phone review', 1.32), ('UPI tips', 0.41)]
Deepa -> [('UPI tips', 1.0)]
New -> [('Budget 2026', 1.0), ('UPI tips', 0.5)]
How to read it: Aman read the IPL and cricket stories. Bhavna read both of those plus the phone review, and Esha read IPL and the phone review, so "Phone review" scores highest for him. Deepa gets only one suggestion because nothing else overlaps with her history; returning nothing is better than padding the list with zero-evidence items. The new user who read one tax article is pointed to the budget story, because both readers of "Tax saving" also read "Budget 2026".
In production you would compute the similarity matrix offline (nightly or hourly), keep only the top 50 neighbours per item, and store them in a fast lookup such as Redis, so the app's API can assemble recommendations in milliseconds. A fuller walk-through with real ratings data is in this book recommendation engine tutorial.
implicit library or Spark MLlib) learns a small vector for each user and item; the dot product predicts interest.The main families are explained in this overview of recommender system types.
New users have no history. Show popular or trending items in their city or language, ask two or three preference questions during onboarding, and switch to personal recommendations after a handful of interactions. New items have no interactions. Use content features to place them next to similar items, and give them a small, controlled share of impressions so they can collect data.
Recommendations are built from personal data. In India, the Digital Personal Data Protection Act, 2023 requires a lawful basis such as consent for processing personal data and limits its use to the stated purpose. In practice:
The trade-offs are discussed in balancing privacy and personalisation and in this piece on privacy and bias in AI.
The simple baseline is often hard to beat, and it is the one you can explain to your product manager. To build these skills step by step, Uncodemy's machine learning with Python course covers the underlying models.