PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Software Engineering Fundamentals/Lila

Debug a Transformer bug in an unfamiliar repo

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in debugging Transformer implementations, encompassing codebase navigation, tensor shape and broadcasting reasoning, numerical stability, masking/causality checks, and model validation competencies.

  • medium
  • Lila
  • Software Engineering Fundamentals
  • Machine Learning Engineer

Debug a Transformer bug in an unfamiliar repo

Company: Lila

Role: Machine Learning Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

You are given an unfamiliar GitHub repository that implements a Transformer model. The interviewer claims there is a **bug** causing one of the following symptoms: - training loss diverges or becomes NaN, - model quality is far worse than expected, - outputs violate causality for an autoregressive model, - shapes/broadcasting silently behave incorrectly. You cannot rewrite the whole project; your task is to **find and fix the bug efficiently**. Explain: 1. The step-by-step debugging strategy you would use. 2. What minimal experiments/tests you would run to localize the issue. 3. The most common Transformer implementation bugs you would check first. 4. How you would validate the fix and prevent regressions.

Quick Answer: This question evaluates proficiency in debugging Transformer implementations, encompassing codebase navigation, tensor shape and broadcasting reasoning, numerical stability, masking/causality checks, and model validation competencies.

Lila logo
Lila
Jan 9, 2026, 12:00 AM
Machine Learning Engineer
Onsite
Software Engineering Fundamentals
2
0
Loading...

You are given an unfamiliar GitHub repository that implements a Transformer model. The interviewer claims there is a bug causing one of the following symptoms:

  • training loss diverges or becomes NaN,
  • model quality is far worse than expected,
  • outputs violate causality for an autoregressive model,
  • shapes/broadcasting silently behave incorrectly.

You cannot rewrite the whole project; your task is to find and fix the bug efficiently.

Explain:

  1. The step-by-step debugging strategy you would use.
  2. What minimal experiments/tests you would run to localize the issue.
  3. The most common Transformer implementation bugs you would check first.
  4. How you would validate the fix and prevent regressions.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Lila•More Machine Learning Engineer•Lila Machine Learning Engineer•Lila Software Engineering Fundamentals•Machine Learning Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.