Note: The prompts in this cheat sheet are for reference only. Use them as inspiration to create your own, and refer to our article for guidance on writing effective prompts. Since these were not written by professional developers, please review and validate before applying in practice.
100 Prompts Every Developer Wishes They Had in Their Toolbox
Code Writing (Basics)
-
Write a Python function to calculate factorial using recursion.
-
Create a Java program to check if a number is prime.
-
Implement a bubble sort algorithm in C.
-
Generate a JavaScript function to reverse a string.
-
Write a program to find Fibonacci numbers up to 100.
-
Implement binary search in C++.
-
Write a program to count vowels in a given string.
-
Create a function to find the greatest common divisor (GCD).
-
Write a SQL query to fetch the top 10 highest salaries.
-
Implement a stack using arrays.
2. Debugging
-
Debug this Python code and explain the error: [paste code].
-
Fix this Java program that throws a NullPointerException.
-
Why is this C++ code causing segmentation fault?
-
Debug my SQL query that returns duplicate rows.
-
Correct this JavaScript code that shows “undefined”.
3. Optimization
-
Optimize this SQL query for faster execution.
-
Refactor this Python function to reduce time complexity.
-
Suggest improvements to reduce memory usage in this program.
-
How can I improve performance of a React component?
-
Optimize file read/write in Java.
4. Code Explanation
-
Explain what this Python code does in plain English.
-
Describe line by line how this Java function works.
-
What is happening in this SQL query?
-
Simplify this C++ function explanation for a beginner.
-
Explain the difference between these two implementations.
5. Algorithms
-
Implement quicksort in Python.
-
Write Dijkstra’s algorithm in C++.
-
Implement depth-first search in Java.
-
Write breadth-first search in JavaScript.
-
Implement merge sort in C.
6. Data Structures
-
Create a linked list implementation in C++.
-
Implement a queue using stacks.
-
Write a hash table in Python.
-
Build a binary search tree in Java.
-
Implement a priority queue in C.
7. Testing
-
Write unit tests for this Python function using pytest.
-
Create JUnit test cases for this Java class.
-
Write Jest tests for this React component.
-
Generate test cases for login functionality.
-
Suggest edge cases to test this algorithm.
8. Documentation
-
Write docstrings for this Python code.
-
Generate API documentation in Markdown.
-
Document this SQL schema with comments.
-
Add inline comments to this C++ program.
-
Write usage instructions for this Java program.
9. DevOps / Automation
-
Write a Dockerfile for a Node.js app.
-
Create a GitHub Actions workflow for CI/CD.
-
Write a bash script to automate backups.
-
Generate a Kubernetes YAML file for deployment.
-
Create a Jenkins pipeline script for a Java project.
10. Security
-
Explain SQL injection with example and prevention.
-
Add input validation to this code.
-
Write secure password hashing in Python.
-
Implement JWT authentication in Node.js.
-
How to secure API keys in a project?
11. System Design
-
Design a URL shortener system.
-
Explain how to design a chat application.
-
Suggest database schema for e-commerce.
-
How to scale a news feed system?
-
Design a ride-sharing app backend.
12. Version Control
-
Write Git commands to create a new branch.
-
How to resolve merge conflicts in Git?
-
Write steps to squash commits.
-
How to revert a commit in Git?
-
Create Git alias for common commands.
13. APIs
-
Write a REST API in Python Flask.
-
Create a CRUD API in Express.js.
-
Explain GraphQL vs REST with examples.
-
Write a simple API client in Java.
-
Add error handling to this API endpoint.
14. Databases
-
Write SQL query to join three tables.
-
Create an index on a column.
-
Write a stored procedure in MySQL.
-
Generate a MongoDB query to filter documents.
-
Normalize this database schema.
15. Frontend
-
Write a React component for a login form.
-
Add CSS styling for a responsive navbar.
-
Create a Vue.js component with props.
-
Write vanilla JS code for a modal popup.
-
Generate HTML5 template for portfolio.
16. Backend
-
Write middleware in Express.js.
-
Create a session management system in Django.
-
Write a Spring Boot controller.
-
Implement caching in Node.js.
-
Generate API routes in Laravel.
17. Cloud
-
Write AWS CLI command to upload file to S3.
-
Create IAM policy for read-only access.
-
Write Terraform script for EC2 instance.
-
Explain serverless with AWS Lambda example.
-
Deploy app on Google Cloud Run.
18. Performance
-
How to improve query response time?
-
Optimize large file handling in Python.
-
How to reduce API latency?
-
Profile Java code performance.
-
Cache static assets in a web app.
19. Miscellaneous
-
Write a regex to validate email.
-
Create cron job for daily backup.
-
Write code to parse JSON in C#.
-
Explain multithreading with example.
-
Suggest project ideas for beginners.
No comments:
Post a Comment