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
Identify ISR Bug in Code Snippet
00:00
5 left

Identify ISR Bug in Code Snippet

HardPython

Problem

Given a snippet of embedded code, identify what is wrong with it (bug related to interrupt service routines). Asked in the initial interview stage. This was a 45-min first-round embedded interview, followed by tangential technical questions and OS trivia.

Implement identify_isr_bugs(code). Return issue labels in this order: blocking_call, dynamic_allocation, shared_state_not_volatile, and non_atomic_shared_access. Treat functions containing ISR( or interrupt as handlers. Detect delay, sleep, or wait calls, allocation calls, non-volatile global variables referenced by a handler, and mutations of volatile shared variables.

Constraints

  • 1 <= len(code) <= 100000
  • The input is a C or C-like embedded source snippet
  • Handlers are identified by ISR( or interrupt
  • Global scalar declarations use a supported integer or boolean type
  • Return issue labels in the specified order without duplicates

Function Signature

def identify_isr_bugs(code):
Interviewer

Your question is Identify ISR Bug in Code Snippet. 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.