← Sybill Interview Insights

Sybill·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Interviewed for a software engineering role at Sybill and got hit with a statistics-heavy question I wasn't expecting from a coding round. Not a bad experience, just not what I'd prepped for.

Questions Asked (1)

Q1

How would you design an experiment to verify that an array shuffling function is truly random? Walk through your hypotheses, choice of statistical tests, sample size, significance level, and how you'd implement and automate this in JavaScript.

A/B Testing & ExperimentationAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

This one threw me.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining what 'truly random' means for a shuffle—each permutation equally likely—and frame it as a statistical hypothesis test. Then outline a chi-square goodness-of-fit test on permutation frequencies, discuss sample size and significance level, and finally describe a JavaScript implementation with automation.

Pro tip: Mention that you'd also test for subtle biases like position frequency and adjacent pairs, not just permutation uniformity, because real-world bugs often show up there. Also, note that you'd use a seeded PRNG for reproducibility in tests.

1. Define randomness and hypotheses

State that a fair shuffle produces each of the n! permutations with equal probability. Formulate null hypothesis (uniform distribution) and alternative (non-uniform).

2. Choose statistical tests

Use chi-square goodness-of-fit for permutation frequencies. For large n, supplement with tests on position frequencies and adjacent pairs to detect specific biases.

3. Determine sample size and significance level

Calculate required sample size to achieve desired power (e.g., 0.8) at significance level α=0.05, considering expected frequencies. For small n, use exact tests; for large n, use simulations.

4. Implement in JavaScript

Write a test harness that runs the shuffle many times, records permutations, and computes chi-square statistic. Use a seeded PRNG for reproducibility and automate with a test runner like Jest.

5. Interpret and iterate

Compare p-value to α; if significant, reject randomness. If not, consider power and potential biases. Automate as part of CI to catch regressions.

Key Points to Mention

  • Chi-square goodness-of-fit test for permutation frequencies
  • Position frequency analysis (each element should appear equally often at each index)
  • Adjacent pair frequency analysis to detect local biases
  • Sample size calculation based on effect size and power
  • Significance level (α) and p-value interpretation
  • JavaScript implementation with seeded PRNG and automation (e.g., Jest, CI)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.