Back to Course|Engineering Manager Interviews: Leadership, Org Design & Strategic Execution
Lab

Build a Behavioral Story Builder for EM Interviews

30 min
Intermediate
3 Free Attempts

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:

  1. People Management -- Hiring, coaching, feedback, performance management, conflict resolution
  2. Technical Judgment -- Architecture decisions, build vs. buy, tech debt prioritization, incident response
  3. Delivery -- Project execution, cross-team coordination, scope management, shipping under constraints
  4. Strategy -- Vision setting, roadmap prioritization, connecting engineering to business outcomes
  5. 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 story
  • situation (str): The context and setting
  • task (str): Your role and responsibility
  • action (str): What you and your team did
  • result (str): The measurable outcome
  • leadership (str): Your unique leadership contribution
  • competencies (list of str): One or more of the five competency areas
  • tags (list of str): Optional freeform tags (e.g., "scaling", "conflict", "reorg")

The method must:

  • Validate that all required keys are present
  • Validate that competencies contains only recognized competency area names
  • Assign a unique integer id to each story (starting from 1, incrementing)
  • Store the story internally and return the assigned id
  • Raise a ValueError for 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 100
  • breakdown (dict): Scores for each criterion
  • suggestions (list of str): Specific improvement suggestions

Scoring criteria (25 points each):

  1. Specificity (25 points):

    • 25 points: Contains at least 2 specific numbers/metrics in the result field (e.g., "40%", "3 weeks", "$500K")
    • 15 points: Contains at least 1 specific number/metric
    • 5 points: No specific numbers or metrics
  2. Completeness (25 points):

    • 5 points for each STAR-L field that has at least 20 characters of content (situation, task, action, result, leadership)
  3. Leadership Framing (25 points):

    • Check the leadership field 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
  4. 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 result field)
  • 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)
============================================

Grading Rubric

STAR-L story storage with validation -- StoryBank correctly stores stories with all required STAR-L fields (title, situation, task, action, result, leadership, competencies, tags); add_story() validates required fields and raises ValueError for missing fields or invalid competency names; assigns sequential integer IDs starting from 1; get_story() retrieves by ID and raises KeyError for missing IDs; list_stories() returns all stories and supports filtering by competency area25 points
Question matching and competency mapping -- Tool includes a bank of at least 15 interview questions across 5 competency areas; match_stories_to_question() extracts competency areas from question text using keyword matching; returns stories whose competency tags overlap with extracted competencies; sorts results by number of overlapping competencies (most relevant first); returns empty list when no stories match; get_questions_for_competency() returns correct questions for each area25 points
Story quality scoring across 4 criteria -- score_story() evaluates Specificity (counting metrics/numbers in result field), Completeness (checking 20+ character content in each STAR-L field), Leadership Framing (detecting leadership action words in leadership field), and Breadth (counting competency tags); total_score is correctly calculated out of 100; breakdown shows individual criterion scores out of 25; suggestions list provides actionable improvement recommendations for any criterion scoring below maximum25 points
Interview preparation sheet generation -- generate_prep_sheet() produces a well-formatted report including: total story count and average quality score; competency coverage with warnings for areas with fewer than 2 stories; best-scoring story per competency with title, score, and result summary; gap analysis identifying competencies with no stories or only low-scoring stories (below 50); actionable items recommending specific stories to add or improve; handles edge cases cleanly (empty bank, single story, all competencies covered)25 points

Checklist

0/10

Your Solution

3 free attempts remaining
FREE WEEKLY NEWSLETTER

Stay on the Nerd Track

One email per week — courses, deep dives, tools, and AI experiments.

No spam. Unsubscribe anytime.