22 / 52 · 25 Interview Preparation & Career · Technical Assessment Preparation← prev⊞ allnext →☰ Read as one page
3.6Live Coding Tips
Before You Start Coding
- Restate the problem: "So I need to write tests for a REST API that manages a to-do list. I will cover CRUD operations, validation, and error handling. Does that match your expectations?"
- Ask clarifying questions: Authentication? Rate limiting? Pagination? The interviewer wants to see that you think before you code.
- Outline your approach: "I will start with the Page Object, then write the happy path test, then add edge cases. I will handle test data setup using the API directly."
While Coding
- Think out loud: "I am using getByRole here instead of a CSS selector because it is more resilient to markup changes and aligns with how users interact with the page."
- Start with the simplest test: Get something passing first, then add complexity.
- Handle errors gracefully: If you hit a syntax error, do not panic. Debug it out loud: "I think the issue is with the async/await here -- let me check the return type."
- Name things well:
test('should show error when password is too short')is better thantest('test3').
Time Management
| Time Block | Activity |
|---|---|
| First 5 minutes | Clarify requirements, outline approach, set up structure |
| Minutes 5-35 | Write the core solution: Page Objects or API client, 3-4 tests |
| Minutes 35-50 | Add edge cases, clean up code, add assertions |
| Last 10 minutes | Run the tests (if applicable), explain your design decisions, discuss what you would add with more time |
If You Get Stuck
- Say it out loud: "I am stuck on how to handle the authentication token. Let me think through this..."
- Simplify: "I know the ideal approach would be to use a fixture, but for time, I will inline the setup and note that I would refactor it."
- Ask for a hint: This is not a sign of weakness. "Can you remind me of the API endpoint for creating test data?" is perfectly fine.