गाइड से जुड़ी प्रश्नोत्तरी · मध्यम स्तर
How to Prompt AI for Better Code Quiz
Tests coding prompt specificity, examples, relevant context, task decomposition, test design, and review of generated changes.
प्रश्न 1 का 8
एक स्पष्ट कोड-जनरेशन अनुरोध में व्यापक लक्ष्य से परे क्या बताया जाना चाहिए?
प्रत्येक प्रश्न का पूर्वावलोकन करें8 प्रश्न
जैसे ही आप प्रश्नोत्तरी लेते हैं उत्तर और स्पष्टीकरण दिखाई देते हैं।
- एक स्पष्ट कोड-जनरेशन अनुरोध में व्यापक लक्ष्य से परे क्या बताया जाना चाहिए?
- A preferred language, framework, and test runner without describing the change
- Relevant context, constraints, inputs and outputs, and expected behavior
- Every neighboring module even when it does not affect the requested behavior
- A general goal with no acceptance criteria or interface details
- कोडिंग प्रॉम्प्ट में ठोस इनपुट-आउटपुट उदाहरण क्यों उपयोगी हैं?
- They always reduce generated code size
- They guarantee the code is secure
- They remove the need for tests
- They clarify expected behavior and edge cases
- किसी विशेष असफल परीक्षण को पुन: उत्पन्न करने के लिए, डेवलपर को प्रासंगिक कोड के साथ कौन सा संदर्भ शामिल करना चाहिए?
- The failing input, expected result, observed error, and relevant function or API context
- An expected result without the input that produced the failure
- Only the test name and programming language, without the actual input or output
- The full repository tree and stack trace, without identifying which test fails
- कौन सा अनुक्रम कार्य आगे बढ़ने पर बहु-भागीय कार्यान्वयन अनुरोध को सत्यापित करना आसान बनाता है?
- Split the code by file, but defer tests and integration review until every part is generated
- Have the assistant write separate components and infer success from its completion summary
- Split it into small, testable tasks, review each result, then integrate the changes
- Ask for an outline, then request all implementation at once and review only the final output
- कार्यान्वयन के साथ-साथ परीक्षण मांगने से क्या स्पष्ट करने में मदद मिलती है?
- A test name without the inputs or expected result
- A code-style preference unrelated to observable behavior
- A list of implementation steps without saying what each step should produce
- Expected inputs, outputs, and behavior that may be ambiguous
- Why should a developer name relevant library or framework versions?
- It prevents the need to review dependency compatibility
- Available APIs can vary, and suggestions should be checked against the installed version
- It guarantees that code generated for the version has no defects
- It ensures the assistant will use only APIs introduced after that version
- Before relying on a generated code change, which review sequence is strongest?
- Review the diff, run relevant tests and checks, then assess security and compatibility
- Review formatting and generated tests, then merge without running them
- Run unit tests but skip checking interfaces and security-sensitive behavior
- Ask the assistant to confirm its code is correct, then accept its test summary
- If an assistant’s first implementation is wrong, what is a useful next prompt?
- Ask for a different implementation without identifying what failed
- Remove the failing test so the implementation can proceed
- Describe the observed discrepancy and provide a concrete failing case
- Repeat the original request with the same context and no new evidence