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
Dinosaur CSV Data Integration
00:00
5 left

Dinosaur CSV Data Integration

MediumPython

Problem

Dinosaur CSV question: given dataset1.csv (NAME,LEG_LENGTH,DIET) and dataset2.csv (NAME,STRIDE_LENGTH,STANCE), process the data (prompt partly walled).

Asked in the video screen during the coding stage. Implement find_running_dinosaurs(dataset1, dataset2), where each argument is a list of dictionaries containing the corresponding CSV columns as strings. Join rows by NAME. A dinosaur can run only when STANCE is bipedal and its calculated speed is greater than 1.0: speed = (STRIDE_LENGTH / LEG_LENGTH - 1) * sqrt(LEG_LENGTH * 9.8).

Return matching names in alphabetical order. For example, a bipedal dinosaur with leg length 2.5 and stride length 5.0 qualifies; a quadrupedal dinosaur does not.

Constraints

  • Each dataset is a list of dictionaries using the specified column names.
  • NAME values are unique within each dataset.
  • 0 <= len(dataset1), len(dataset2) <= 10^5
  • LEG_LENGTH and STRIDE_LENGTH are positive numeric strings.
  • STANCE comparison is case-insensitive.
  • A dinosaur must appear in both datasets to be evaluated.
  • A speed exactly equal to 1.0 does not qualify.

Function Signature

def find_running_dinosaurs(dataset1, dataset2):
Interviewer

Your question is Dinosaur CSV Data Integration. 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.