A prompt is the input given to an AI model as an instruction or query. It may be a sentence, paragraph, or longer text, and its wording and surrounding context shape the response. section 2.1
Use prompts as practical steering tools:
- Track previous prompts because the current session’s context can drastically change later results; begin a new session for each project. section 2.1
- Refine requirements through successive prompts when the first response misses a constraint or produces an unsuitable solution. section 2.2 section 2.4
- Adapt the interaction to the tool: ChatGPT supports dialogue, while Copilot and CodeWhisperer provide context-sensitive advice inside an IDE. section 2.4
Refining an algorithm prompt
A request for the kth smallest element in an unsorted array can yield a solution using full sorting. Add the constraint against sorting or built-in sorting functions to obtain a different approach, such as Copilot’s binary-search-style solution. Treat the result as a proposal: its apparent validity does not make it an acceptable interview answer without considering follow-up constraints. section 2.2
# You are a student with a background in computer science who is interviewing for an engineering job at a software company. You are asked the following question: based on the previous definition of a singly linked list (in Python), how would you write a method that would reverse the output of the traversal method? How would you implement such a method?
Use this realistic prompt as a template for specifying role, prior context, programming language, data structure, and the exact implementation task. section 2.2

















































