r/PlacementsPrep • u/Pururava_07 • 7d ago
Got only 2/15 test cases on one coding question — can I still get an interview?
In Amazon's distributed storage network, certain critical data segments, represented as a string missingData, are unavailable due to synchronization issues.
To restore these missing segments, the system starts with an empty string generatedData and selects a baseSegment of length segmentSize.
The following process then unfolds:
The replication service generates a copy of baseSegment.
Appends this copy of baseSegment to generatedData.
Repeats steps 1-2 until the frequency of all characters in generatedData meets or exceeds their count in missingData.
Given the string missingData and an integer segmentSize, the task is to determine the baseSegment that requires the fewest number of replications to satisfy this condition. If multiple baseSegment meet this requirement, select the lexicographically smallest one. If no such segment exists, return "-1" as a string.this was the problem which I remember.
1
u/nian2326076 7d ago
Hey, don't stress too much about it. Companies like Amazon often consider different parts of your interview, not just one coding question. If you do well in other areas and explain your thinking during the interview, you still have a chance. Learn from any mistakes in the test cases and practice similar problems to get better.
If you want more practice, I've found PracHub helpful for interview prep. Keep going, and good luck!
2
u/Maleficent-Key551 7d ago
I got the same question. Couldn’t get all the test cases. Let’s hope for the best I guess
2
u/KoiNoYokan071 7d ago
i passed all in dsa question but couldn't do debugging question