FastPrepFriends Apart at a Round Table
Problems/Friends Apart at a Round Table

Friends Apart at a Round Table

Susquehanna International Group (SIG) logoSusquehanna International Group (SIG)● MediumNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Two new grad reports from SIG quant phone screens ask about friends at a round table. A report from February 2024 (first round) has 3 people pick seats at random at a table with 8 seats and asks for the chance that no two of them end up side by side. A report from October 2023 (a 30-minute recruiter call) seats 10 people in random order around a table, 3 of whom are friends, and asks for the chance that at least two of the friends sit next to each other.

The reports give one table each and no input format. Here, the number of seats n (3 to 10^6) and the number of friends k are inputs. The function returns the chance that no two friends are neighbors. The chance that at least two sit together is 1 minus this, as example 2 shows. Both interview tables are examples. Answers within 10^-9 (absolute or relative) are accepted.

Our version is about 85% the same as the reported questions.

A round table has n seats. Each seat has two neighbors: the seats on its left and on its right, and the first and last seats are neighbors too.

k friends sit down at random: every set of k seats is equally likely to be the set they take. Any other seats may be filled by strangers, which does not matter here.

Return the probability that no two friends sit in neighboring seats.

Your answer is accepted if its absolute error or its relative error is at most 10^-9.

Function

noFriendsAdjacentProbability(n: int, k: int) → double

Examples

Example 1

n = 8k = 3return = 0.2857142857142857

This is the first interview table. Put one friend in seat 1. Seats 2 and 8 are now banned, so the other two friends need two seats from 3, 4, 5, 6, 7 that are not side by side.

There are C(4, 2) = 6 such pairs, out of C(7, 2) = 21 pairs of the other seats. The answer is 6/21 = 2/7, about 0.2857.

Example 2

n = 10k = 3return = 0.4166666666666667

This is the second interview table. Put one friend in seat 1; the other two friends need two seats from 3 to 9 that are not side by side. That is C(6, 2) = 15 of the C(9, 2) = 36 pairs, so the answer is 15/36 = 5/12, about 0.4167.

The interview asked for the chance that at least two friends sit together, which is 1 - 5/12 = 7/12, about 0.5833.

Example 3

n = 6k = 3return = 0.1

Three friends at six seats can only avoid each other by taking every other seat: seats 1, 3, 5 or seats 2, 4, 6. That is 2 of the C(6, 3) = 20 seat sets, so the answer is 2/20 = 0.1.

Constraints

  • 3 <= n <= 10^6
  • 1 <= k <= n

More Susquehanna International Group (SIG) Phone Screen questions

  • Dice Sum That Is a Multiple of mPHONE SCREEN · Seen Nov 2026
  • Find Median from Data StreamPHONE SCREEN · Seen Nov 2026
  • Painting Arcs to Nearest Neighbors on a CirclePHONE SCREEN · Seen Sep 2026
  • Filter Movies by Inclusive Year RangePHONE SCREEN · Seen Jul 2026
  • Best Single Reroll for Five DicePHONE SCREEN · Seen Feb 2026
  • Catching the Bus to the MoviePHONE SCREEN · Seen Jan 2026
  • Two Dice Summing to a TargetPHONE SCREEN · Seen Jan 2026
  • Median of Uniform Draws in an IntervalPHONE SCREEN · Seen Oct 2025
  • One Number Is the Average of the Other TwoPHONE SCREEN · Seen Jun 2025
  • Which Coin Pattern Shows Up FirstPHONE SCREEN · Seen May 2025

Similar questions at other companies

  • Count Array DerangementsInMobi · PHONE SCREENInMobi interview questions
  • Biased Coin: Probability of Exactly h HeadsAkuna Capital · PHONE SCREENAkuna Capital interview questions
  • Revolver: Will the Next Shot Fire?Tower Research Capital · PHONE SCREEN
  • Probability of Consecutive HeadsSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Expected Fake-Name CollisionsMercor · PHONE SCREENMercor interview questions
  • Election District Budget Allocation AnalysisIMC Trading · PHONE SCREENIMC Trading interview questions
  • Count Clean Attendance LogsRippling · PHONE SCREENRippling interview questions
  • Extra Coin Win ProbabilityMicrosoft · PHONE SCREENMicrosoft interview questions
  • Count Staircases with Strictly Increasing StepseBay · ONSITE INTERVIEWeBay interview questions
  • Get Triplet CountIBM · OAIBM interview questions

Interview reports that mention this question

  • SIG Quant Researcher New Grad Interviews: 49 Experiences

Susquehanna International Group (SIG) interview experiences

  • SIG Quant Researcher Experienced Hire Interviews: 11 Experiences
  • SIG Quant Research Intern Interviews: 60 Experiences
  • SIG Quant Researcher Intern Interviews: 1 Experience
  • SIG Quant Second-Round Tech Screen: 1 Experience
All Susquehanna International Group (SIG) interview questionsSee Susquehanna International Group (SIG) hiring insights
Saved
class Solution {
    public double noFriendsAdjacentProbability(int n, int k) {
        // Write your code here.
    }
}
Checking account…