Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Evaluate Feature Compatibility Across Versions

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

Your question is Evaluate Feature Compatibility Across Versions. 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 dependency versions (for example: [103.003.02, 103.003.03, 203.003.02]), write a program to evaluate feature compatibility/support across these versions.

Asked in the Technical Screening stage. 75-minute coding round conducted on an online editor platform with runnable test cases.

Implement evaluate_compatibility(versions, requirements).

  • versions is a list of version strings.
  • requirements is a list of feature rules, each with feature, min_version, and optional max_version.
  • Return a list where each element is the sorted list of features supported by the corresponding version.

Version strings may contain leading zeros and 2 to 4 dot-separated numeric parts. Compare versions numerically, padding missing parts with zeros.

Constraints

  • 1 <= len(versions) <= 200
  • 1 <= len(requirements) <= 200
  • Each version has 2 to 4 numeric parts separated by dots
  • Each version part is in the range 0 to 999
  • Feature names are unique
  • If present, max_version is greater than or equal to min_version

Function Signature

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