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
Answer Call Center Math
00:00
5 left

Answer Call Center Math

EasyPython

Problem

During a one-hour interval monitored through Cyara CX Assurance, a call center has x agents. y percent of the agents answer exactly one call each. Of the remaining agents, half answer two calls each and the other half answer no calls.

Implement a function that returns the total number of answered calls. Return -1 when the distribution is impossible because the one-call group is not a whole number of agents or the remaining agents cannot be split equally.

Formal Specification

Implement calls_answered(x, y), where x is an integer agent count and y is an integer percentage from 0 through 100. Return an integer representing the total calls answered, or -1 for an invalid distribution. Do not use floating-point arithmetic.

Constraints

  • 1 <= x <= 10^12
  • 0 <= y <= 100
  • Return -1 if x * y is not divisible by 100
  • Return -1 if the remaining agent count is odd

Function Signature

def calls_answered(x, y):
Interviewer

Your question is Answer Call Center Math. 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.