33Implement cd(current_dir, new_dir) returning the absolute path, then add symbolic links▼mediumOpenAI1 replies◆ premiumcd('/foo/bar', 'baz') is easy. cd('/foo/../', './baz') is where the OpenAI screen actually starts, and the symlink follow-up is where it ends. The stack solution plus the loop-guard most candidates forget.Open full answer →
87Valid parentheses, then generate all valid combinations▼mediumMetaAmazonMicrosoft2 replies◆ premiumA two-part screen that looks like a warm-up and isn't. Part one is the classic stack validator with three bracket types; part two flips to generating every valid string of n pairs, and the Catalan count is the detail that catches people off guard.Open full answer →