Microsoft SDE phone screen - US, IC3

Anonymous User
810
Oct 16, 2025
Nov 12, 2025

Was asked 2 questions 1 hour (15 mins intro+ project discussion, 45 mins coding):
1: Given the weights to string mapping: a = 1, b = 2a + a, c = 3b + b, d = 4c +c..... z = 26y + y, return the shortest length of string that can be formed for the given weight. eg getString(w) = getString(3) -> string output can be "aaa" or "b", your output will be "b" as it has a shorter length.
eg: 25 = "cca"

for lookup: A-Z values:[1, 3, 12, 60, 360, 2520, 20160, 181440, 1814400, 19958400, 239500800, 3113510400, 43589145600, 653837184000, 10461394944000, 177843714048000, 3201186852864000, 60822550204416000, 1216451004088320000, 25545471085854720000, 562000363888803840000, 12926008369442488320000, 310224200866619719680000, 7755605021665492992000000, 201645730563302817792000000, 5444434725209176080384000000]

(hint- solve with binary search, find the exact index where the weight matches the mapping and then keep on reducing the weight with the maximum value less than or equal to the weight. Focus on creating a list instead of dictionary), you will have to create the mapping too, it is not provided.

2: Given the workschedule of the person in the form of a string s and totalWeekHours and dailyWorkHours, provide all variations of s string that can be formed.

eg: "1234?5?7", totalWeekHours = 25, dailyWorkHours = 5
replace ? such that when you add 1+2+3+4+?+5+?+7 the sum is totalWeekHours,
You can replace ? with all possible values between (0, dailyWorkHours) inclusive that make the total == totalWeekHours and return the resultant string list:
workschedule("89??233", 40,8) = ['8978233', '8987233'] - combination sum problem leetcode.

Could not solve the first question during interview, shared the exact approach for second question. Rejected most likely.

Comments (4)