Microsoft Software Engineer Interview Experience: Stable A/B Buckets and Pinyin Splits

Microsoft·Software Engineer·Dec 2026
Technical Screenhard

I encountered a C++14 backend repair problem in a Microsoft interview. After an A/B allocation service grew from one replica to three, some users were exposed to both Control and Treatment, and offline recomputation disagreed with the online results. Later, when experimental traffic increased from 10% to 20%, another set of users who had been in Treatment ended up in Control. The interviewer also pulled up AI-generated code and asked about an ordinary-looking line that converted letter case.

How do you ensure that the same user gets the same group on every replica?

Start with the hash input. For the same user ID, compare the normalized bytes, hash value, and slot number across each replica and the offline program, in that order. This reveals where the difference first appears.

The repair approach was to standardize user-ID processing, fix the salt, input concatenation, and total number of slots, and use a deterministic hash with explicit parameters, such as 64-bit FNV-1a. Identical input should yield the same slot across replicas, after service restarts, and during offline recomputation.

How do you preserve existing assignments when traffic grows from 10% to 20%?

Use two stable rules: one determines whether a user enters the experiment, and the other determines their group once they enter. Suppose there are 100 enrollment slots. At 10%, open slots 0 through 9; at 20%, expand to slots 0 through 19. The user in slot 7 stays in the original group. The user in slot 16 can now enroll and is assigned to Control or Treatment by the fixed rule. Changing the traffic percentage only expands the enrollment range.

The interviewer asked: Why convert A-Z manually instead of using std::tolower()?

The requirement was ASCII byte normalization. Only the bytes for A-Z should become lowercase; every other byte must remain unchanged.

The conversion performed by std::tolower() can depend on the current C locale. User IDs are hash inputs, so if online and offline systems produce different bytes for the same ID, the hash and slot may differ too. That conversion line is part of the bucketing rules and needs to match the offline implementation.

Another coding question: Return every valid segmentation of a pinyin string

Given a pinyin string without separators and a set of valid syllables, return every complete segmentation. In the example, fangan could be split as fan + gan or fang + an.

Use DFS with memoization. Starting at index i, enumerate valid prefixes, then put the current syllable before each valid suffix solution.

memo[i] caches every solution for that suffix. When recursion reaches the end exactly, return [[]], representing one complete path that can be assembled on the way back. An empty input string returns [] under the problem's convention. Memoization reduces repeated searching, but every valid solution still has to be returned, so the output can remain exponential in the worst case.

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
Microsoft
Role
Software Engineer
Rounds
Technical Screen
Difficulty
hard
Interview date
Dec 2026
Questions from this interview
2 questions

Related interview experiences

Explore more interview rounds, questions, and outcomes.

Browse interview experiences