Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Automate Web App Deployment Script

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Automate Web App Deployment Script. Start with the requirements on the right.

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.

Problem

Given a list of deployment steps as strings, write a Python function that validates and executes them in order for a simple web application deployment workflow. Each step is one of: build, test, package, deploy, verify. Return the ordered list of executed steps if the workflow is valid. If a step appears out of order, is duplicated, or an unknown step is present, return [].

Constraints

  • 1 <= len(steps) <= 10
  • Each steps[i] is a non-empty lowercase string
  • Valid workflow order is exactly build -> test -> package -> deploy -> verify
  • A valid step may appear at most once

Function Signature

def automate_deployment(steps):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output