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
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess 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
Build my plan
Automate Log Analysis or Packaging
00:00
5 left

Automate Log Analysis or Packaging

MediumPython

Problem

Call of Duty asset packaging workflows emit chronological records describing assets added to or removed from platform builds. Implement a utility that parses these records and returns the final package manifest efficiently.

Each input record has the format asset|platform|action|size|dependencies, where action is either ADD or REMOVE. For an ADD record, size is an integer number of bytes and dependencies is a comma-separated list of asset IDs, or - when there are no dependencies. For a REMOVE record, size and dependencies are ignored. Records are processed in the order provided.

An ADD for an existing (platform, asset) replaces its previous metadata. A REMOVE deletes that asset from the platform, and is a no-op if the asset is not currently present. Return one dictionary per remaining asset, sorted first by platform and then by asset. Each dictionary must contain platform, asset, size, and dependencies. Dependencies must be unique and sorted lexicographically.

Constraints

  • 1 <= len(records) <= 10^5
  • Each record contains exactly five pipe-separated fields
  • Asset and platform IDs are non-empty and contain no pipe or comma characters
  • 0 <= size <= 10^12
  • All actions and numeric fields are valid

Function Signature

def build_asset_manifest(records):
Interviewer

Your question is Automate Log Analysis or Packaging. 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.
CodePython 3
Sign up free to run your codeLog inLn 2
Run your code to see test output here.