• Browse Prompts
  • Trending
  • Saved Prompts
  • Web Dev
  • Marketing
  • Blog
  • Submit Your Prompt
PromptsVault AI LogoPromptsVault AI
  • Browse
  • Trending
  • Blog
  • Saved
  • Submit Your Prompt
PromptsVault AI LogoPromptsVault AI

The world's best AI prompts library. Hand-curated, high-quality prompts for ChatGPT, Claude, and Midjourney. Built for productivity and high-accuracy results.

Categories

  • Web Dev
  • AI/ML
  • Marketing
  • Coding
  • Creative
  • View All →

Popular Topics

  • chatgpt
  • midjourney
  • marketing
  • coding
  • seo
  • writing
  • social media
  • email

Legal

  • About Us
  • AI Blog
  • Privacy
  • Terms
  • Disclaimer

© 2026 PromptsVault AI. All rights reserved.

PromptsVault AI is thinking...

Searching the best prompts from our community

ChatGPTMidjourneyClaude
  1. Home
  2. Library
  3. Coding
Discovery Mode

Coding Prompts

Fix bugs, refactor code, and ship features faster with AI prompts designed for real-world programming workflows.

Curated collection of Coding prompt templates
93PROMPTS FOUND
CODING

PostgreSQL query performance tuning guide

Analyze and optimize PostgreSQL query performance. Steps: 1. Identify slow queries with pg_stat_statements. 2. Analyze Execution plans (EXPLAIN ANALYZE). 3. Create covering indexes for frequent queries. 4. Optimize JOIN operations. 5. Vacuum and analyze strategy. 6. Partition large tables. 7. Tune c...

#database#postgresql#sql#performance
43
0
36
CODING

Unity physics optimization for mobile games

Optimize Unity game physics for mobile performance. Techniques: 1. Adjust fixed timestep settings. 2. Use primitive colliders over mesh colliders. 3. Implement object pooling for projectiles. 4. Configure collision matrix to reduce checks. 5. Use raycast layers for efficiency. 6. Bake static physics...

#game-dev#unity#optimization#physics
28
0
21
CODING

Scalable URL shortener system design

Design scalable URL shortening service (like TinyURL). Components: 1. API design (REST/GraphQL). 2. Hashing algorithm (Base62). 3. Database schema (NoSQL vs SQL) and partitioning. 4. Cache layer (Redis) for redirect performance. 5. Unique ID generation (KGS - Key Generation Service). 6. Analytics se...

#system-design#scalability#architecture#distributed-systems
65
0
58
CODING

Scalable Cypress E2E testing framework

Design reusable Cypress E2E testing framework. components: 1. Page Object Model (POM) pattern. 2. Custom commands for common actions. 3. API interception for mocking backend. 4. Visual regression testing (percy/applitools). 5. Dynamic data generation (faker.js). 6. Environment configuration (staging...

#qa#cypress#testing#automation
37
0
30
CODING

MQTT protocol implementation for IoT sensors

Implement robust MQTT communication for IoT sensor network. Architecture: 1. Broker selection (HiveMQ, Mosquitto). 2. Topic hierarchy design. 3. QoS level configuration (0, 1, 2). 4. Retained messages and Last Will and Testament (LWT). 5. TLS encryption for data in transit. 6. Device authentication ...

#iot#mqtt#sensors#communication
12
0
9
CODING
Nano

Error Message Decoder

I'm getting the following error message in my browser console: "Uncaught TypeError: Cannot read properties of undefined (reading 'map')". Explain what this error means in simple terms, what are the common causes for it, and how I can go about debugging it in my JavaScript code.

#debugging#javascript#error-handling
6
0
4
CODING
Nano

Database Schema Generator

Generate a SQL schema for a simple e-commerce website. It should include tables for Products, Customers, Orders, and Order_Items. Define the columns for each table, specify data types, and set up primary and foreign key relationships.

#database#sql#schema-design
6
0
4
CODING
Nano

C++ Smart Pointer Guide

Explain the difference between `std::unique_ptr`, `std::shared_ptr`, and `std::weak_ptr` in modern C++. When should each one be used? Provide a code example demonstrating a common use case for `std::shared_ptr` to manage a shared resource.

#c++#smart-pointers#memory-management
6
0
4
CODING
Nano

GraphQL Schema Designer

Design a GraphQL schema for a blog application. The schema should define types for Author, Post, and Comment. Include queries to fetch all posts, a single post by ID, and all posts by a specific author. Also, include mutations for creating a new comment.

#graphql#api-design#backend
6
0
4
CODING
Nano

SOLID Principles Coach

Explain the "Single Responsibility Principle" (SRP) from the SOLID principles of object-oriented design. Provide a simple "before" code example in C# or Java that violates SRP, and then show an "after" example that refactors the code to adhere to the principle.

#solid#oop#software-design#best-practices
6
0
4
CODING
Nano

Async/Await Explained

Explain how `async` and `await` work in JavaScript for handling asynchronous operations. How do they differ from using `.then()` with Promises? Provide a code example that fetches data from an API, first using Promises with `.then()` and then refactored to use `async/await`.

#javascript#asynchronous#promises#async-await
6
0
4
CODING
Nano

Data Structure Selector

I need to store a collection of items where I will frequently be adding new items and searching for existing items. The order of items does not matter. What is the most appropriate data structure to use (e.g., Array, Linked List, Hash Table, Tree)? Explain the trade-offs and why your choice is the b...

#data-structures#algorithms#performance
6
0
4
CODING
Nano

Environment Variable Manager

What is the best practice for managing environment variables (e.g., API keys, database passwords) in a Node.js project? Explain the use of `.env` files and the `dotenv` package. Provide an example of how to load and access variables from a `.env` file.

#nodejs#environment-variables#security#best-practices
6
0
4
CODING
Nano

Big O Notation Analyst

Analyze the time complexity (Big O notation) of the following Python function, which checks if an array contains duplicate values. Explain your reasoning step-by-step. `def has_duplicates(arr): for i in range(len(arr)): for j in range(i + 1, len(arr)): if arr[i] == arr[j]: return True; return False`

#big-o#time-complexity#algorithms#performance
6
0
4
CODING
Nano

Functional Programming Advocate

Rewrite the following imperative JavaScript code, which uses a for-loop to double every number in an array, into a functional style. Use higher-order functions like `map`. Explain the benefits of the functional approach, such as immutability and readability.

#functional-programming#javascript#immutability
6
0
4
CODING
Nano

System Design Interviewer

Let's do a system design interview. Your task is to design a URL shortening service like TinyURL. Discuss the requirements, API design, data model, and how you would handle scaling the service to millions of users. Draw a high-level architecture diagram.

#system-design#interview-prep#architecture
6
0
4
CODING
Nano

Go Language Tutor

I am a Python developer learning Go. Explain the concept of "goroutines" and "channels". How do they compare to Python's threading or asyncio? Provide a simple code example in Go that demonstrates concurrent execution using goroutines and channels.

#golang#concurrency#learning
6
0
4
CODING
Nano

CI/CD Pipeline Architect

Design a basic CI/CD pipeline using GitHub Actions for a Python web application. The pipeline should be triggered on a push to the main branch. It should include steps for installing dependencies, running linters, executing unit tests, and deploying the application to a staging environment.

#ci-cd#github-actions#devops#python
6
0
4
CODING
Nano

Microservices vs. Monolith Advisor

Compare and contrast the microservices architecture with the monolithic architecture. Discuss the pros and cons of each in terms of development, deployment, scalability, and complexity. For a new, small-scale e-commerce startup, which architecture would you recommend and why?

#microservices#monolith#architecture#system-design
6
0
4
CODING
Nano

Swift Protocol-Oriented Programming

Explain the concept of Protocol-Oriented Programming (POP) in Swift. How does it differ from traditional Object-Oriented Programming (OOP)? Provide an example of how you can use protocol extensions to provide default implementations for methods.

#swift#ios#protocol-oriented-programming
6
0
4
CODING
Nano

API Design Specialist

I need to design a RESTful API for a social media application. The resources are Users, Posts, Comments, and Likes. Design the endpoints, including HTTP methods, URL structure, and request/response payloads. Provide examples for creating a new post and fetching comments for a post.

#api-design#restful#backend
6
0
4
CODING
Nano

Regex Pattern Creator

Create a regular expression to validate a strong password. The password must be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one number, and one special character (e.g., !, @, #, $). Explain the different parts of the regex.

#regex#validation#security
6
0
4
CODING
Nano

Python Decorator Creator

Explain what a decorator is in Python. Write a simple decorator called `@timer` that measures the execution time of any function it decorates and prints the duration to the console. Show how to apply this decorator to a sample function.

#python#decorators#metaprogramming
6
0
4
CODING
Nano

Library & Framework Suggester

I need to add charts and graphs to my web application. What are some popular JavaScript libraries for data visualization? Compare libraries like D3.js, Chart.js, and Highcharts based on ease of use, customization options, and performance.

#javascript#data-visualization#libraries
6
0
4
CODING
Nano

Rust Ownership Explainer

Explain the concept of "ownership" in Rust. What are the three main rules of ownership? How does it help Rust achieve memory safety without a garbage collector? Provide a simple code example that would cause a compile-time ownership error and explain why it fails.

#rust#ownership#memory-management
6
0
4
CODING
Nano

Legacy Code Modernizer

I have an old JavaScript codebase that uses ES5 syntax (var, function declarations). Help me modernize it to ES6+ syntax (let/const, arrow functions, classes). Take the following ES5 code and rewrite it using modern JavaScript features.

#javascript#es6#refactoring#legacy-code
6
0
4
CODING
Nano

Code Debugging Buddy

I have a bug in my Python code. The function is supposed to calculate the factorial of a number, but it's returning an incorrect result for inputs greater than 5. Here is the code: [paste code here]. Help me find and fix the bug.

#debugging#python#troubleshooting
6
0
4
CODING
Nano

Dockerization Expert

I have a Node.js application with a package.json file. Create a Dockerfile to containerize this application. The Dockerfile should install dependencies, copy the application code, and specify the command to run the application. Optimize the Dockerfile for smaller image size and faster builds.

#docker#containerization#devops#nodejs
6
0
4
CODING
Nano

Code Formatter

Take the following poorly formatted C# code and format it according to standard C# coding conventions. Ensure consistent indentation, spacing, and brace style. Point out the specific changes you made.

#code-style#formatting#csharp
6
0
4
CODING
Nano

Code Refactoring Assistant

Act as a senior software engineer. Take the following code snippet and refactor it for better readability, performance, and maintainability. Explain the changes you made and why.

#refactoring#code-quality#best-practices
6
0
4
CODING
Nano

Technical Interview Simulator

Simulate a technical interview for a junior front-end developer position. Ask me questions about HTML, CSS, JavaScript, and a framework like React. Start with a simple coding challenge, like reversing a string.

#interview-prep#frontend#coding-challenge
7
0
4
CODING
Nano

Frontend Framework Advisor

I am starting a new web project. It will be a highly interactive single-page application (SPA) with real-time data updates. Compare and contrast React, Vue, and Angular for this project. Recommend one and justify your choice based on performance, learning curve, ecosystem, and scalability.

#frontend#react#vue#angular
6
0
4
CODING
Nano

Algorithm Explainer

Explain the "Quicksort" algorithm. Describe how it works step-by-step, its time and space complexity (best, average, and worst-case), and its main advantages and disadvantages compared to other sorting algorithms like Mergesort.

#algorithms#data-structures#computer-science
6
0
4
CODING
Nano

Git Command Guru

I accidentally committed sensitive data to my last commit and pushed it to the remote repository. What are the Git commands I need to use to completely remove the sensitive file from the repository's history? Explain each step of the process.

#git#version-control#security
6
0
4
CODING
Nano

Terraform Configuration Writer

Write a basic Terraform configuration (`main.tf`) to provision an AWS S3 bucket. The configuration should specify the AWS provider, a resource for the S3 bucket, and a unique bucket name. Include a variable for the AWS region.

#terraform#iac#aws#s3#devops
7
0
4
CODING
Nano

Code Reviewer

Act as a peer reviewer for my code. I will provide a pull request link or a code snippet. Please review it for potential bugs, style inconsistencies, performance issues, and security vulnerabilities. Provide constructive feedback and suggest specific improvements.

#code-review#collaboration#best-practices
6
1
4
CODING
Nano

SQL Query Optimizer

I have a slow-running SQL query. Here is the query: [paste query here]. And here is the table schema: [paste schema here]. Analyze the query and suggest ways to optimize it. Consider adding indexes, rewriting the query, or denormalizing the data.

#sql#database#performance#optimization
6
0
4
CODING
Nano

CSS Flexbox & Grid Expert

I want to create a responsive three-column layout. The middle column should be fluid, and the side columns should have a fixed width. Show me how to achieve this using both CSS Flexbox and CSS Grid. Explain the pros and cons of each approach for this specific layout.

#css#flexbox#css-grid#responsive-design
6
0
4
CODING
Nano

State Management Explainer (Frontend)

Explain the problem of state management in large frontend applications. What is "prop drilling"? How do libraries like Redux or Zustand solve this problem? Describe the basic concepts of a global store, actions, and reducers (or their equivalents).

#state-management#frontend#react#redux
6
0
4
CODING
Nano

ORM vs. Raw SQL Debater

Debate the pros and cons of using an Object-Relational Mapper (ORM) like SQLAlchemy or TypeORM versus writing raw SQL queries. Discuss aspects like developer productivity, performance, security, and database abstraction. In what scenarios would you strongly prefer one over the other?

#orm#sql#database#architecture
6
0
4
CODING
Nano

JSON Web Token (JWT) Decoder

Explain the structure of a JSON Web Token (JWT). What are the three parts (Header, Payload, Signature)? What information is typically stored in the payload? How is the signature used to verify the token's authenticity? Provide an example of a decoded JWT payload.

#jwt#authentication#security#json
6
0
4
CODING
Nano

TypeScript Type Guard Creator

I have a function that accepts a parameter which can be a `string` or a `number`. Write a custom type guard in TypeScript to check if the variable is a `string`. Then, show how to use this type guard within an `if` statement to safely access string-specific properties.

#typescript#type-guards#types
6
0
4
CODING
Nano

Kubernetes Manifest Generator

Generate the YAML for a basic Kubernetes Deployment and Service. The Deployment should run 3 replicas of the `nginx:alpine` image. The Service should expose the Nginx deployment on port 80 using a `ClusterIP`.

#kubernetes#k8s#yaml#devops
6
0
4
CODING
Nano

Pythonic Code Writer

Take the following C-style for-loop in Python and rewrite it in a more "Pythonic" way. Explain why the Pythonic version is preferred. Original code: `for i in range(len(my_list)): print(my_list[i])`

#python#best-practices#idiomatic-code
6
0
4
CODING
Nano

Dependency Injection (DI) Explainer

What is Dependency Injection (DI)? How does it help in creating loosely coupled and more testable code? Provide a simple "before" and "after" code example in Java or C# that demonstrates the concept of constructor injection.

#dependency-injection#design-patterns#decoupling
6
0
4
CODING
Nano

Code Documentation Generator

Generate documentation for the following TypeScript function in JSDoc format. The function accepts a user object and returns a formatted greeting string. Make sure to document the parameters, their types, and the return value.

#documentation#jsdoc#typescript
6
0
4
CODING
Nano

Design Pattern Identifier

Explain the "Singleton" design pattern. What problem does it solve? Provide a code example of how to implement it in Java or Python. Discuss its pros and cons, and when it is appropriate to use.

#design-patterns#software-architecture#best-practices
6
0
4
CODING
Nano

Unit Test Writer

Write a set of unit tests for the following JavaScript function, which takes an array of numbers and returns the sum. Use a testing framework like Jest. Cover edge cases like an empty array, an array with non-numeric values, and a very large array.

#testing#unit-testing#jest#javascript
6
0
4
CODING
Nano

Security Vulnerability Scanner

Analyze the following PHP code snippet for common security vulnerabilities like SQL Injection, Cross-Site Scripting (XSS), or Insecure Direct Object References. Explain where the vulnerabilities are and how to fix them.

#security#php#vulnerability-assessment
6
0
4
CODING
Nano

Pair Programmer

Let's code together. I want to build a simple command-line to-do list application in Node.js. Let's start by outlining the features. Then, you can help me write the code for adding a new task. I will ask questions as we go.

#pair-programming#collaboration#nodejs#learning
6
0
4
12