CD Directory Navigation
OpenAI interview questions · Medium · Coding round · reported 2× · 7 tests
Implement a simplified cd helper for an interview shell. The function starts from a
current directory, applies a destination path, and returns the normalized absolute path.
Interface
interface CdOptions {
homeDir?: string;
symlinks?: Record<string, string>;
}
resolveCd(cwd: string, target: string, options?: CdOptions): string | null
Rules
Run your code with Ctrl+Enter to see results.