Build a Behavioral Story Builder for EM Interviews
Instructions
Overview
In this lab, you will build a Python command-line tool that helps Engineering Manager candidates organize, evaluate, and prepare their behavioral interview stories. The tool uses the STAR-L framework (Situation, Task, Action, Result, Leadership) and provides intelligent matching between stories and common EM interview questions.
The Five Competency Areas
Your tool must recognize and work with these five competency areas:
- People Management -- Hiring, coaching, feedback, performance management, conflict resolution
- Technical Judgment -- Architecture decisions, build vs. buy, tech debt prioritization, incident response
- Delivery -- Project execution, cross-team coordination, scope management, shipping under constraints
- Strategy -- Vision setting, roadmap prioritization, connecting engineering to business outcomes
- Communication -- Executive updates, cross-functional influence, managing up, stakeholder alignment
Requirements
Part 1: Story Storage (STAR-L Format)
Create a class StoryBank with the following methods:
add_story(story) -- Accepts a dictionary with these required keys:
title(str): A short descriptive title for the storysituation(str): The context and settingtask(str): Your role and responsibilityaction(str): What you and your team didresult(str): The measurable outcomeleadership(str): Your unique leadership contributioncompetencies(list of str): One or more of the five competency areastags(list of str): Optional freeform tags (e.g., "scaling", "conflict", "reorg")
The method must:
- Validate that all required keys are present
- Validate that
competenciescontains only recognized competency area names - Assign a unique integer
idto each story (starting from 1, incrementing) - Store the story internally and return the assigned
id - Raise a
ValueErrorfor invalid input
get_story(story_id) -- Returns the story dictionary by its id, or raises a KeyError if not found.
list_stories(competency=None) -- Returns a list of all stories. If competency is provided, filters to only stories tagged with that competency area.
Part 2: Question Matching
The tool must include a bank of common EM interview questions mapped to competency areas. Store at least 3 questions per competency area (15 total minimum).
match_stories_to_question(question_text) -- Accepts a question string and returns a list of matching stories ranked by relevance. Matching logic:
- Extract competency areas from the question using keyword matching (e.g., "hire" or "team growth" maps to People Management; "deadline" or "shipped" maps to Delivery)
- Return stories whose competency tags overlap with the extracted competencies
- Sort results by the number of overlapping competencies (most overlap first)
- Return an empty list if no stories match
get_questions_for_competency(competency) -- Returns the list of interview questions associated with a given competency area.
Part 3: Story Quality Scoring
Create a method score_story(story_id) that evaluates a story's interview readiness and returns a dictionary with:
total_score(int): Out of 100breakdown(dict): Scores for each criterionsuggestions(list of str): Specific improvement suggestions
Scoring criteria (25 points each):
-
Specificity (25 points):
- 25 points: Contains at least 2 specific numbers/metrics in the
resultfield (e.g., "40%", "3 weeks", "$500K") - 15 points: Contains at least 1 specific number/metric
- 5 points: No specific numbers or metrics
- 25 points: Contains at least 2 specific numbers/metrics in the
-
Completeness (25 points):
- 5 points for each STAR-L field that has at least 20 characters of content (
situation,task,action,result,leadership)
- 5 points for each STAR-L field that has at least 20 characters of content (
-
Leadership Framing (25 points):
- Check the
leadershipfield for leadership action words: "decided", "coached", "mentored", "unblocked", "hired", "restructured", "negotiated", "prioritized", "delegated", "influenced" - 25 points: 3 or more leadership action words found
- 15 points: 1-2 leadership action words found
- 5 points: No leadership action words found
- Check the
-
Breadth (25 points):
- 25 points: Story is tagged with 3 or more competency areas
- 15 points: Story is tagged with 2 competency areas
- 10 points: Story is tagged with 1 competency area
For any criterion scoring below maximum, add a specific suggestion to the suggestions list.
Part 4: Interview Preparation Sheet
Create a method generate_prep_sheet() that returns a formatted string containing:
- A header with the total number of stories and average quality score
- A competency coverage section showing how many stories exist per competency area, with a warning for any competency that has fewer than 2 stories
- The top-scoring story for each competency area (title, score, and a one-line summary using the
resultfield) - A "Gap Analysis" section listing competencies with no stories or only low-scoring stories (below 50)
- An "Action Items" section with specific recommendations (e.g., "Add 2 more stories for Strategy", "Improve specificity in story 'Team Scaling at Acme'")
Example Usage
bank = StoryBank()
story_id = bank.add_story({
"title": "Scaling the Payments Team",
"situation": "Our payments team had 3 engineers and was responsible for processing $2M in daily transactions. The company planned to launch in 5 new markets within 6 months, requiring 3x throughput.",
"task": "As the EM, I needed to triple the team size while maintaining system reliability and delivery velocity during the transition.",
"action": "I created a structured hiring plan with a rubric focused on distributed systems experience. I implemented a buddy system for onboarding and established a 30-60-90 day ramp plan. We ran parallel workstreams so new hires could contribute to the new market integrations while senior engineers maintained the core platform.",
"result": "Grew the team from 3 to 11 engineers in 5 months with zero mis-hires. System uptime remained at 99.97%. We launched in all 5 markets on schedule, processing $6.5M in daily transactions by quarter end.",
"leadership": "I personally designed the hiring rubric, conducted 28 phone screens, and made the final call on every hire. I restructured the team into two squads to maintain ownership clarity. I negotiated with the VP of Engineering for a dedicated recruiter, which cut our time-to-hire from 45 to 22 days.",
"competencies": ["People Management", "Delivery", "Strategy"],
"tags": ["scaling", "hiring", "payments", "international"]
})
score = bank.score_story(story_id)
print(f"Story score: {score['total_score']}/100")
matches = bank.match_stories_to_question(
"Tell me about a time you scaled a team significantly."
)
prep_sheet = bank.generate_prep_sheet()
print(prep_sheet)
Expected Output Format
Score Output
Story score: 90/100
Breakdown:
Specificity: 25/25
Completeness: 25/25
Leadership Framing: 25/25
Breadth: 15/25
Suggestions:
- Consider tagging this story with additional competency areas for broader coverage
Preparation Sheet Output
============================================
EM INTERVIEW PREPARATION SHEET
============================================
Total Stories: 8
Average Quality Score: 72/100
--- Competency Coverage ---
People Management: 3 stories [OK]
Technical Judgment: 2 stories [OK]
Delivery: 3 stories [OK]
Strategy: 0 stories [WARNING: No stories!]
Communication: 1 story [WARNING: Need at least 2]
--- Best Story Per Competency ---
People Management: "Scaling the Payments Team" (90/100)
Result: Grew team from 3 to 11 in 5 months with zero mis-hires
Technical Judgment: "Migration to Microservices" (75/100)
Result: Reduced deployment time from 2 hours to 15 minutes
Delivery: "Holiday Launch Under Pressure" (82/100)
Result: Shipped 2 weeks early, handled 3x expected traffic
Strategy: NO STORIES -- prepare stories for this competency
Communication: "Executive Buy-in for Platform Rewrite" (68/100)
Result: Secured $1.2M budget approval in one presentation
--- Gap Analysis ---
* Strategy: No stories available
* Communication: Only 1 story (minimum 2 recommended)
--- Action Items ---
1. Add at least 2 stories for Strategy competency
2. Add 1 more story for Communication competency
3. Improve specificity in "Executive Buy-in for Platform Rewrite" (score: 68)
============================================