PracHub
QuestionsLearningGuidesInterview Prep
|Home/Statistics & Math/Jump Trading

Find the Largest Equivalence Class of Fractions

Last updated: Jul 28, 2026

Quick Overview

Design an exact and scalable way to find the largest group of fractions with the same value. Explain how you handle signs, zero, duplicates, overflow, and floating-point pitfalls, then analyze time and space complexity.

  • easy
  • Jump Trading
  • Statistics & Math
  • Software Engineer

Find the Largest Equivalence Class of Fractions

Company: Jump Trading

Role: Software Engineer

Category: Statistics & Math

Difficulty: easy

Interview Round: Technical Screen

Given a list of integer fractions `(numerator, denominator)`, find the largest number of fractions that represent the same rational value. Fractions may be unreduced, numerators may be negative, and denominators may be negative but not zero. For example, `(1, 2)`, `(2, 4)`, and `(-3, -6)` belong to the same equivalence class, while `(1, -2)` belongs to the class for negative one-half. Describe an algorithm, justify its correctness, and analyze its complexity. Your representation must treat all zero-valued fractions as equal and must not use floating-point division. ### Clarifying Questions to Ask - Can a denominator be zero? For this problem, no. - Are duplicate input pairs counted separately? Yes. - Is the required result only the largest count? Yes, although returning a representative is a natural extension. ### What a Strong Answer Covers - Reduction by the greatest common divisor - A single sign convention - Canonical handling of zero - Why floating point is unsafe for equality - Expected and worst-case complexity ### Follow-up Questions - Return every equivalence class tied for largest. - Support fractions whose numerator and denominator exceed machine integer range. - Process an input stream with bounded memory when only approximate heavy hitters are required.

Quick Answer: Design an exact and scalable way to find the largest group of fractions with the same value. Explain how you handle signs, zero, duplicates, overflow, and floating-point pitfalls, then analyze time and space complexity.

|Home/Statistics & Math/Jump Trading

Find the Largest Equivalence Class of Fractions

Jump Trading logo
Jump Trading
Jun 14, 2026, 12:00 AM
easySoftware EngineerTechnical ScreenStatistics & Math
1
0

Given a list of integer fractions (numerator, denominator), find the largest number of fractions that represent the same rational value. Fractions may be unreduced, numerators may be negative, and denominators may be negative but not zero.

For example, (1, 2), (2, 4), and (-3, -6) belong to the same equivalence class, while (1, -2) belongs to the class for negative one-half.

Describe an algorithm, justify its correctness, and analyze its complexity. Your representation must treat all zero-valued fractions as equal and must not use floating-point division.

Clarifying Questions to Ask Guidance

  • Can a denominator be zero? For this problem, no.
  • Are duplicate input pairs counted separately? Yes.
  • Is the required result only the largest count? Yes, although returning a representative is a natural extension.

What a Strong Answer Covers Guidance

  • Reduction by the greatest common divisor
  • A single sign convention
  • Canonical handling of zero
  • Why floating point is unsafe for equality
  • Expected and worst-case complexity

Follow-up Questions Guidance

  • Return every equivalence class tied for largest.
  • Support fractions whose numerator and denominator exceed machine integer range.
  • Process an input stream with bounded memory when only approximate heavy hitters are required.
Loading comments...

Browse More Questions

More Statistics & Math•More Jump Trading•More Software Engineer•Jump Trading Software Engineer•Jump Trading Statistics & Math•Software Engineer Statistics & Math

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.