Fragen im Vorstellungsgespräch bei Microsoft: You are given a string and a ... |

Frage im Vorstellungsgespräch

Explore-Vorstellungsgespräch Redmond, WA (Vereinigte Staaten von Amerika)

You are given a string and a regex-esque pattern. In the

  pattern, ? maps to exactly one character, and * maps to 0 to infinite characters that can be any character. The following strings would match the pattern ab*dc?: abdca, abdce, abbbbbdcz, abiokdcp

Antwort im Vorstellungsgespräch

1 Antwort


This was the hardest question of the three, and was also my PM interview. I compared the string and pattern character by character. If I reached a *, then I would recursively call my function on the substring that was after the * and see if that matched any of the substrings generated in the string.

Bewerber im Vorstellungsgespräch am 01.12.2014

Antwort oder Kommentar posten

Um dies zu kommentieren, bitte anmelden oder Konto anlegen.