Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
Reusable Test Templates and Pipelines
00:00
5 left

Reusable Test Templates and Pipelines

HardPython

Problem

How would you write and maintain a library of reusable test templates or CI/CD pipelines using GitLab CI or Jenkins? Implement a resolver for named pipeline templates that inherit steps from at most one parent template. Return the fully ordered steps for a requested template, or None if the target is missing or inheritance contains a cycle. Input is a dictionary of template names to objects containing an optional extends name and a list of string steps.

Constraints

  • 1 <= number of templates <= 500
  • Each template extends zero or one other template
  • Each template name is unique
  • Each step is a string
  • A valid inheritance chain contains no cycles
  • Return None for a missing target, missing parent, or cyclic inheritance

Function Signature

def resolve_pipeline(templates, target):
Interviewer

Your question is Reusable Test Templates and Pipelines. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
Code
Sign up free to run your codeLog inLn 2
Run your code to see test output here.