Roleplay Scenario
Scenario Overview
A junior developer on your team is stuck on a tricky bug affecting a feature they’re working on. With a deadline looming, they need some guidance to solve the problem, but it’s important to let them figure it out as much as possible.
Roles & Setup
Role A – Senior Developer (You)
You're there to help and guide without taking over completely.
Your goal: Help the junior developer find the solution themselves while offering helpful hints.
Role B – Junior Developer
You're dealing with a frustrating bug and need some assistance to move forward.
Your goal: Learn from the senior developer's guidance and build your problem-solving skills.
Suggested Openers
Senior Developer:
- “Hey, I heard you’re stuck on a bug with the login feature. Want to walk me through what you’ve tried so far?”
- “Let’s take a look at what’s going on. Do you have any thoughts on what might be causing this?”
Junior Developer:
- “I’ve been working on this feature, and I keep running into this error. It’s pretty frustrating, especially with the deadline coming up.”
- “I’ve tried a few things, but nothing’s working. Could use another set of eyes.”
Sample Roleplay in Action
Junior Developer:
“I’ve been trying to fix this bug in the login feature. It keeps throwing a null pointer exception when a user signs in, and I can’t figure out why.”
Senior Developer:
“Let’s check out the error message together. What’s it saying, and where in the code is it pointing you?”
Junior Developer:
“It’s happening in the authentication module when fetching user data. I think it might be related to the recent database update.”
Senior Developer:
“Okay, let’s start there. Have you checked if the user data is being fetched correctly from the database?”
Junior Developer:
“I looked over the query, but something feels off. Maybe the recent schema changes affected it.”
Senior Developer:
“Let’s debug that section and print out what the query’s returning. Seeing the actual data might give us a clue. Remember, these things can be tricky, but we’ve got this.”
Junior Developer:
“Sure, I’ll add some logs and rerun the test. Oh, looks like the query isn’t returning any data because of a missing filter condition.”
Senior Developer:
“Nice find! What do you think we should do to fix it?”
Junior Developer:
“I’ll update the query to include the missing filter and test it again. Thanks for your patience!”
Senior Developer:
“Sounds good. Let me know how it goes, and we can take a look at the results together. You’re doing awesome!”
Junior Developer:
“Thanks for the help! I’ll try that and see if it fixes the issue before the deadline.”
Post-Scenario Tools
Curveball Mode (Optional)
Throw in one of these mid-roleplay to test adaptability:
- The bug persists even after the likely solution is applied.
- The junior developer becomes frustrated or discouraged.
- An unexpected new error appears during testing.
Reflection Checklist
As the Senior Developer:
- Did you ask guiding questions instead of giving direct answers?
- Did you encourage the junior developer to explore and test their ideas?
- Did you offer support while giving them space to solve it independently?
As the Junior Developer:
- Did you clearly explain where you were stuck?
- Did you engage actively with the guidance provided?
- Did you take initiative in proposing solutions after getting some insights?
Common Mistakes to Avoid
- Taking over the problem-solving process instead of mentoring.
- Giving solutions directly instead of facilitating learning.
- Not checking in on the junior developer’s confidence or understanding.
Pro Tip
Mentoring is about empowering others to build their skills. Balance giving insights with encouraging exploration to help junior developers grow their confidence and problem-solving abilities.