FastPrepMixing Cookie Flavors
Problems/Mixing Cookie Flavors

Mixing Cookie Flavors

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

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 lists a short counting question. Six cookies are baked using only three flavors, and you count the possible combinations.

The report gives only that one case and does not define a combination. We chose these. The number of cookies and the number of flavors are inputs. Cookies of the same flavor are identical. The order of the cookies does not matter. A flavor may be left out, so a mix is just how many cookies get each flavor. The interview case is the first example.

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

You bake cookies cookies. Each cookie gets one of flavors flavors, and you may use any flavor as often as you like.

Cookies with the same flavor are identical, and the order of the cookies does not matter. So a mix is just how many cookies get each flavor. A flavor may be used zero times.

Return the number of different mixes.

Function

countCookieMixes(cookies: int, flavors: int) → long

Examples

Example 1

cookies = 6flavors = 3return = 28

This is the interview case: six cookies and three flavors. A mix is three counts that add up to 6, such as (6, 0, 0), (2, 2, 2) or (1, 0, 5).

Line up the six cookies and place two dividers among them to split them into three flavor groups: that is choosing 2 of 8 places, 8 × 7 / 2 = 28.

Example 2

cookies = 2flavors = 2return = 3

Two cookies and two flavors: both of the first flavor, one of each, or both of the second. That is 3 mixes.

Example 3

cookies = 4flavors = 1return = 1

With only one flavor, every cookie has that flavor, so there is exactly 1 mix.

Constraints

  • 1 <= cookies <= 30
  • 1 <= flavors <= 20

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
  • Cats, Truth and Who Has MoreOA · 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

Similar questions at other companies

  • Count Nondecreasing Digit-Sum ArraysMicrosoft · OAMicrosoft interview questions
  • Stable Workload Redistribution TreesTower Research Capital · OA
  • Count Valid A-B-C Sequences Under a Modulo-Four RuleInfosys · OAInfosys interview questions
  • Count Shipment SchedulesMorgan Stanley · OAMorgan Stanley interview questions
  • Count Permutations Without Three Equal Parities in a RowGoogle · OAGoogle interview questions
  • Find Encrypted NumberAmazon · OA
  • Valid PasswordsMathWorks · OAMathWorks interview questions
  • Coloring HousesSnowflake · OASnowflake interview questions
  • Find Maximum Number of StringsMoveworks · OAMoveworks interview questions
  • Count Distinct Binary Search TreesC3.ai · OAC3.ai interview questions

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 long countCookieMixes(int cookies, int flavors) {
        // Write your code here.
    }
}
Checking account…