← Boston Consulting Group Interview Insights

Boston Consulting Group·AI Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Apr 2026

Summary

Interviewed for an AI Engineer role at BCG and got hit with a math/logic puzzle about moon phases. Not what I was expecting from a consulting firm but here we are.

Questions Asked (1)

Q1

Given a specific month and day, along with the moon phase on January 1st, calculate what moon phase it would be on that date. Assume standard month lengths and a cycle of 8 repeating phases.

Algorithms & Data Structures
Author's notes

Took me a minute to even parse what they were asking.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem constraints: standard month lengths (non-leap year), 8-phase cycle, and phase indexing. Then, compute the total number of days from January 1st to the target date, add the offset of the initial phase, and take modulo 8 to find the phase index. Finally, map the index back to the phase name.

Pro tip: Mention edge cases like leap years and the ambiguity of 'standard month lengths' to show attention to detail, and suggest a modular arithmetic approach for efficiency.

1. Clarify assumptions and inputs

Confirm that the year is non-leap, month lengths are standard (Jan=31, Feb=28, etc.), and the phase cycle is 8 repeating phases. Establish a mapping from phase names to indices (e.g., New Moon=0, Waxing Crescent=1, ..., Waning Crescent=7).

2. Compute days elapsed

Calculate the total number of days from January 1st to the target date (inclusive or exclusive depending on convention). Use cumulative days per month plus the day of the month.

3. Calculate phase offset

Add the initial phase index (for January 1st) to the days elapsed, then take modulo 8 to get the phase index for the target date.

4. Map index to phase name

Use the mapping from step 1 to convert the resulting index back to the phase name.

5. Validate with examples

Test the algorithm with simple cases (e.g., January 1st should return the initial phase, January 2nd should return the next phase) to ensure correctness.

Key Points to Mention

  • Modular arithmetic to handle the repeating cycle efficiently.
  • Handling of month lengths and cumulative day counts.
  • Edge cases: leap years, invalid dates, and phase indexing conventions.
  • Time and space complexity: O(1) time and space.
  • Potential off-by-one errors in day counting (inclusive vs exclusive).
  • Generalization to any cycle length or phase names.

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