💻 Coding & Development Prompts

Python, JavaScript, SQL, debugging, API

← All Categories
10 prompts

Python Script - Read and Clean CSV

coding Python Beginner
Write a Python script that: 1) Reads a CSV file using pandas, 2) Shows basic info (shape, dtypes, null counts), 3) Removes duplicate rows, 4) Fills missing values (numeric with median, text with mode), 5) Strips whitespace from string columns, 6) Standardizes column names (lowercase, underscores), 7) Saves the cleaned file as a new CSV. Include error handling and comments explaining each step.
💡 Add a requirements.txt with pandas version. Always check the output after cleaning.

REST API with Flask

coding Python Intermediate
Build a simple REST API using Python Flask with these endpoints: 1) GET /items - list all items with pagination, 2) GET /items/<id> - get single item, 3) POST /items - create new item (validate input), 4) PUT /items/<id> - update item, 5) DELETE /items/<id> - delete item. Use SQLite for storage. Include: error handling with proper HTTP status codes, input validation, CORS headers, and a requirements.txt.
💡 Add rate limiting and authentication before deploying to production.

JavaScript Form Validation

coding JavaScript Beginner
Write JavaScript form validation for a registration form with: email (valid format), password (min 8 chars, 1 uppercase, 1 number, 1 special char), confirm password (must match), phone number (valid format), age (18-120). Show: real-time validation on input, error messages below each field, disable submit button until all valid, success message on valid submit. Use vanilla JavaScript, no libraries.
💡 Use the Constraint Validation API for cleaner code. Add aria attributes for accessibility.

SQL Query - Complex Joins and Aggregation

coding SQL & Database Intermediate
Write SQL queries for a database with tables: orders (id, customer_id, order_date, total), customers (id, name, email, city), products (id, name, price, category), order_items (order_id, product_id, quantity). Queries needed: 1) Top 10 customers by total spend, 2) Monthly revenue for last 12 months, 3) Best selling product per category, 4) Customers who ordered in January but not February, 5) Running total of sales by month (window function), 6) Products never ordered. Optimize for performance.
💡 Add indexes on columns used in WHERE, JOIN, and ORDER BY clauses.

React Component with Hooks

coding React Intermediate
Build a React component for a searchable, filterable product list. Features: 1) Search input with debounced filtering, 2) Category filter dropdown, 3) Sort by price/name, 4) Loading skeleton while fetching, 5) No results empty state, 6) Responsive grid layout. Use: useState, useEffect, useMemo, custom useDebounce hook. Include TypeScript types. Fetch data from a placeholder API.
💡 Extract the useDebounce hook into a separate file for reusability.

Git Workflow Cheat Sheet

coding Tools & Workflow Beginner
Create a comprehensive Git cheat sheet organized by task: 1) Setup (init, clone, config), 2) Daily workflow (add, commit, push, pull), 3) Branching (create, switch, merge, delete, rename), 4) Undo mistakes (reset, revert, stash, amend), 5) Inspection (log, diff, blame, bisect), 6) Collaboration (rebase, cherry-pick, fetch vs pull), 7) Tags (create, push, delete). For each command, include the exact syntax and a one-line explanation of when to use it.
💡 Always use git stash before switching branches with uncommitted changes.

Docker Compose for Full Stack App

coding DevOps Advanced
Write a docker-compose.yml for a full stack application with: 1) Frontend (React/Nginx), 2) Backend (Node.js/Express), 3) Database (PostgreSQL), 4) Redis (caching), 5) Adminer (database management UI). Include: proper networking between services, volume mounts for data persistence, environment variables file (.env), health checks, restart policies. Add a .dockerignore and explain each service configuration.
💡 Use multi-stage builds for the frontend Dockerfile to reduce image size.

Debug This Code - Common Patterns

coding Debugging Beginner
Act as a senior developer. I will paste code that has a bug. For each bug you find: 1) Identify the exact line and the issue, 2) Explain WHY it is a bug (not just what), 3) Show the fix, 4) Explain how to prevent this type of bug in the future. If there are multiple issues, rank them by severity. Also suggest any code quality improvements even if they are not bugs.
💡 Paste your code after this prompt. Include error messages if you have them.

Regex Patterns Collection

coding Tools & Workflow Intermediate
Give me regex patterns for common validation tasks: 1) Email address, 2) URL (http/https), 3) Phone number (US format), 4) Date (YYYY-MM-DD), 5) IP address (IPv4), 6) Strong password (min 8, uppercase, lowercase, number, special), 7) Credit card number (basic format), 8) Hex color code, 9) Username (alphanumeric, 3-16 chars), 10) File path (Windows and Unix). For each: provide the regex, explain what each part does, and give test examples (valid and invalid).
💡 Test regex at regex101.com before using in production. Edge cases will surprise you.

API Error Handling Best Practices

coding Backend Intermediate
Show me how to implement proper error handling for a REST API in [Node.js/Python/your language]. Include: 1) Custom error class hierarchy, 2) Global error handler middleware, 3) Specific handlers for: validation errors (400), authentication errors (401), authorization errors (403), not found (404), rate limiting (429), server errors (500), 4) Consistent error response format (JSON), 5) Error logging with stack traces (not sent to client), 6) Different behavior for development vs production.
💡 Never expose stack traces or internal error details to the client in production.