← Questions

Resolve a cd command to an absolute path

0
OpenAIMetaCodingLast asked Sep 2026

A coding interview question asked in Meta's AI-enabled coding round and at OpenAI, last asked Sep 2026. It tests strings, paths and stacks.

Implement the path logic of a shell's cd. Given the current directory and the argument to cd, return the absolute path pwd would print afterwards.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Meta · AI-enabled coding · Last asked Sep 202660 min · Several progressive tasks on a starter codebase in CoderPad with an AI assistant panel; usually two rounds · The first task usually without AI, later tasks with it
  • OpenAI · Agentic coding (beta) · Last asked Dec 2025An existing codebase and changes too large to write by hand; you work through them with an AI coding agent · An AI coding agent is expected

What it tests

strings · paths · stacks

Your code and the AI tutor open when you unlock this question.