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
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess 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
Get started
IC Between 1-day and 2-day Alpha
00:00
5 left

IC Between 1-day and 2-day Alpha

MediumPython

Problem

Implement a function to calculate the IC (Information Coefficient) between a 1-day and 2-day alpha signal.

Use the Pearson correlation coefficient between the two aligned numeric arrays. Return 0.0 when either signal has zero variance.

The entry point is calculate_ic(one_day, two_day). It receives two equal-length arrays of real numbers and returns a real number in [-1, 1].

Constraints

  • Both arrays have the same length.
  • 2 <= length <= 100000
  • Signal values are finite real numbers.
  • Return 0.0 if either signal has zero variance.

Function Signature

def calculate_ic(one_day, two_day):
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements are in the Question tab.

You need to log in / sign up to run or submit.
Code
Sign up free to run your codeLog inLn 2
Run your code to see test output here.