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
Error Handling in Robotic Arm Control
00:00
5 left

Error Handling in Robotic Arm Control

EasyPython

Problem

In a robotic arm controller, it is crucial to manage error states to ensure patient safety. You are tasked with implementing a function that takes a list of error states and returns a list of safe commands that can be executed. Each error state is represented by an integer where positive values indicate safe commands and negative values indicate errors.

Input

  • A list of integers error_states where:
    • error_states[i] > 0 indicates a safe command.
    • error_states[i] <= 0 indicates an error state.

Output

  • A list of integers representing the safe commands.

Constraints

  • 1 <= error_states.length <= 1000
  • -1000 <= error_states[i] <= 1000

Function Signature

def safe_commands(error_states):
Interviewer

Your question is Error Handling in Robotic Arm Control. 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.