FastPrepCats, Truth and Who Has More
Problems/Cats, Truth and Who Has More

Cats, Truth and Who Has More

Susquehanna International Group (SIG) logoSusquehanna International Group (SIG)● MediumINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A 2026 report on SIG's one-hour online test for quant research and systematic trading interns includes a logic puzzle about three cat owners named Astra, Breach and Cypher. Four remarks pass between them, about an even count, a percentage, an average and a minimum gap. Whether a remark is honest depends on whether the person hearing it owns more cats than the speaker. The task is to work out how many cats Cypher owns. In the report the percentage is 40 and the gap is 3.

The report gives that one setting. We chose these. The percentage p and the gap d are inputs. Cat counts are whole numbers of zero or more. The answer is -1 when the remarks allow no count or more than one count for Cypher. The interview setting is the first example.

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

Astra, Breach and Cypher each own a different whole number of cats (zero or more). They make four statements:

  1. Cypher tells Breach: "You have an even number of cats."
  2. Breach tells Cypher: "You have exactly p percent more cats than I do."
  3. Breach tells Astra: "Your number of cats is the average of mine and Cypher's."
  4. Astra tells Breach: "My number of cats is at least d more than yours."

A speaker always tells the truth to a listener who has more cats than the speaker, and always lies to a listener who has fewer. Not all four statements are true.

Return the number of cats Cypher owns. If no assignment fits, or more than one value for Cypher fits, return -1.

Function

cypherCats(p: int, d: int) → int

Examples

Example 1

p = 40d = 3return = 7

This is the interview puzzle. Statement 4 must be a lie told to someone with fewer cats, so Astra has 1 or 2 more than Breach. Statements 3 and 2 are then true, and statement 1 is false, so Breach is odd.

With Astra = Breach + 1, Cypher = Breach + 2 and 1.4 × Breach = Breach + 2, so Breach = 5: counts 6, 5 and 7. With Astra = Breach + 2, Breach = 10, which is even. So Cypher has 7.

Example 2

p = 40d = 5return = -1

Now Astra can be 1 to 4 more than Breach. Gaps 1 and 3 both give an odd Breach (5 and 15), so Cypher could have 7 or 21. The answer is not unique: -1.

Example 3

p = 50d = 3return = -1

Let k = Astra - Breach, which can be 1 or 2 here. p × Breach = 200k gives Breach = 4 or 8, both even, but Breach must be odd. No assignment works: -1.

Constraints

  • 1 <= p <= 1000
  • 1 <= d <= 10^5

More Susquehanna International Group (SIG) Online Assessment questions

  • Catch Fish with Reusable BaitsOA · Seen Nov 2026
  • Bold Play to Reach a GoalOA · Seen Nov 2026
  • Counting Cows by Their LegsOA · Seen Nov 2026
  • Enough Muffins for the LineOA · Seen Nov 2026
  • Expected Consecutive Pairs Among Chosen NumbersOA · Seen Nov 2026
  • Four-by-Four Boundary GridOA · Seen Nov 2026
  • Frog Paths Without Long RunsOA · Seen Nov 2026
  • Higher Roll, or Lose the SumOA · Seen Nov 2026
  • Is a Popular Story Fake?OA · Seen Nov 2026
  • Knights, Knaves and Their StatementsOA · Seen Nov 2026

Similar questions at other companies

  • Count Prime Values in SubtreesVisa · OAVisa interview questions
  • Minimum Rounds to Complete All TasksInfosys · OAInfosys interview questions
  • Server Upgrade PlanningWells Fargo · OAWells Fargo interview questions
  • Capping Portfolio WeightsCapstone Investment Advisors · OA
  • Gaussian Naive Bayes Classifier (Machine Learning OA)Pinterest · OAPinterest interview questions
  • Count Subarrays with a Perfect-Square ProductMicrosoft · OAMicrosoft interview questions
  • Repeated Mirror XORMathWorks · OAMathWorks interview questions
  • Count Lucky TicketsThe D.E. Shaw Group · OAThe D.E. Shaw Group interview questions
  • Stacked Item and Category DiscountsPalantir · OAPalantir interview questions
  • Task Scheduler with CooldownGoDaddy · OA

Susquehanna International Group (SIG) interview experiences

  • SIG Quant Researcher Experienced Hire Interviews: 11 Experiences
  • SIG Quant Research Intern Interviews: 60 Experiences
  • SIG Quant Researcher New Grad Interviews: 49 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 int cypherCats(int p, int d) {
        // Write your code here.
    }
}
Checking account…