PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates combinatorics and probability skills, specifically counting combinations and recognizing arithmetic progression structure among distinct integers, and belongs to the Coding & Algorithms category for Data Scientist roles.

  • medium
  • Mavensecurities
  • Coding & Algorithms
  • Data Scientist

Compute probability of random arithmetic progression triple

Company: Mavensecurities

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Take-home Project

You have the integers from 1 to 30 inclusive. You randomly choose 3 **distinct** numbers **without replacement**, and all 3-element subsets are equally likely. The order in which the numbers are drawn does **not** matter. What is the probability that these three numbers can be arranged to form an arithmetic progression (three distinct terms with a common difference)? Express your answer as a simplified fraction or decimal.

Quick Answer: This question evaluates combinatorics and probability skills, specifically counting combinations and recognizing arithmetic progression structure among distinct integers, and belongs to the Coding & Algorithms category for Data Scientist roles.

Return the simplified probability that three distinct numbers chosen from 1..30 form a three-term arithmetic progression.

Constraints

  • Return the reduced fraction as a string.

Examples

Input: ()

Expected Output: '21/406'

Explanation: There are 210 arithmetic-progression triples among C(30,3)=4060 subsets.

Hints

  1. Clarify edge cases before coding.
  2. Keep the return value deterministic.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL 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.