Score Sales Leads

Medium ⏱ 12 min 53% acceptance ★★★★★ 4.6
Write lead_score(lead) summing points from a dict lead: +30 if company_size >= 200, +20 if title contains 'head' or 'director' (case-insensitive), +25 if visited_pricing is True, +10 per demo attended (demos, capped at +30). Classify: 70+ 'hot', 40+ 'warm', else 'cold'. Return (score, label).

Examples

Example 1
Input
lead_score({'company_size': 500, 'title': 'Head of Data', 'visited_pricing': True, 'demos': 1})
Output
(85, 'hot')
Explanation

30+20+25+10 crosses the hot threshold.

Constraints

  • Demo points cap at 30.
  • Case-insensitive title check.

Topics

Business Logicscoring

Companies

HubSpotSalesforceFreshworks

Hints

Hint 1

min(lead["demos"] * 10, 30).

Hint 2

any(word in title.lower() ...).

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.