11 / 11 · Book 12 · Your First Program← prev⊞ allGet the book →
1.11Interview Depth Check
Question 1
Prompt: You join a new team and need to set up your local environment for a test automation project that uses Python and TypeScript. Walk me through your process. What a strong answer should cover:
- Install Python, Node.js, and TypeScript at the correct versions
- Clone the repo and follow setup documentation (or create it if it does not exist)
- Run existing tests to verify the environment works end to end
- Set up VS Code with appropriate extensions and linting Example answer:
- I start by checking the project's README or setup guide for required versions of Python, Node.js, and TypeScript
- I install the correct versions (using pyenv for Python, nvm for Node) and verify with
python --version,node --version,tsc --version - I install project dependencies:
pip install -r requirements.txtandnpm install - I run the existing test suite to confirm everything passes on my machine before making any changes
- If setup documentation is missing or outdated, I create it as my first contribution -- this helps the next person and proves I understand the setup
Question 2
Prompt: What is the difference between running a TypeScript file with npx tsx versus compiling it with tsc first? When does it matter?
What a strong answer should cover:
npx tsxruns TypeScript directly without a separate compile step (JIT)tsccompiles to JavaScript first, which can be run withnode- For development and testing,
tsxis faster and more convenient - For production and CI,
tsccatches all type errors upfront and produces distributable JavaScript - Node.js 24+ (active LTS) also runs
.tsfiles directly via native type-stripping -- same caveat: it does not type-check Example answer: npx tsx hello.tscompiles and runs in one step, which is ideal during development for fast iteration- Since Node.js 24 (the active LTS as of July 2026),
node hello.tsalso runs directly thanks to stable native type-stripping -- but liketsx, it does not type-check tsc hello.tsproduces a JavaScript file that is then run withnode hello.js-- two steps, but the compile step catches all type errors across the entire project- In my workflow, I use
tsxfor running individual tests and quick experiments, andtsc --noEmitin CI to verify the entire codebase compiles without errors - The distinction matters because
tsxonly checks the file being run, whiletscchecks the entire project, so CI should always run the full compile check
Question 3
Prompt: A colleague reports that their Python test script works but the same logic fails in TypeScript. How do you help them debug this? What a strong answer should cover:
- Compare syntax differences between the two languages (print vs console.log, indentation vs braces)
- Check for type-specific issues (TypeScript's strict null checks, type narrowing)
- Use the REPL in both languages to isolate the failing expression
- Verify both environments are using the expected language versions Example answer:
- First, I check the error message: a TypeScript compile error (type mismatch) is very different from a runtime error (wrong logic)
- I compare the two implementations side by side looking for language-specific differences: Python's truthiness rules differ from JavaScript's (empty list is falsy in Python but truthy in JS)
- I use the Node REPL and Python REPL to test the specific expression that produces different results
- I verify the TypeScript version and tsconfig settings -- strict mode may catch issues that non-strict mode would ignore