Skip to content

Results for “function”

16 prompts

This code is too clever and hard to read. Rewrite it for clarity: descriptive names, small functions, comments only where needed, and the same behaviour. Explain what the original was doing. Code: [paste code]

ChatGPT
Coding & Development

Code golf to clean code

Expands clever, cryptic code into readable code.

0

This function is too slow for large inputs ([input size]). Analyse its time and space complexity, propose a more efficient approach, implement it, and show a quick benchmark plan. Code: [paste code]

ChatGPT
Coding & Development

Algorithm optimisation

Speeds up an algorithm by improving its complexity.

0

Write Jest unit tests for this function/module. Cover normal cases, edge cases, error handling, and mock [dependencies]. Use descriptive test names and arrange-act-assert structure. Code: [paste code]

ChatGPT
Coding & Development

Unit tests in Jest

Thorough Jest tests with mocks and edge cases.

0

Help me revise the [diagram, e.g. human heart]. Describe the diagram in words with numbered parts, then quiz me: give a number and ask me to name the part and its function. Correct me as we go and finish with a summary table of all parts and functions.

ChatGPT
Education & Learning

Biology diagram labeling practice

Quiz yourself on diagrams like the cell, heart or flower.

0

Suggest better names in this code. Language and naming conventions: [details] ``` [paste] ``` For each unclear name, give 2–3 alternatives and explain why they're clearer. Then show the code with the best names applied. Don't change behaviour.

ChatGPT
Coding & Development

Better names for variables and functions

Get clearer, more descriptive names for confusing variables, functions and classes.

0

Turn this code into documentation. Code: ``` [paste] ``` Provide: a plain-English step-by-step description, a Mermaid flowchart (or sequence diagram if it involves multiple services), the inputs and outputs, and any edge cases visible in the logic.

ChatGPT
Coding & Development

Turn code into a flowchart

Visualise how a function or process works with a Mermaid flowchart and plain-English steps.

0

Act as a senior product manager. Feature: [name] Problem and evidence: [details] Target users: [who] Goals: [outcomes] Write a PRD: background, problem statement, goals and non-goals, user stories with acceptance criteria, functional requirements, UX notes, edge cases, analytics/success metrics, launch plan, and open…

ChatGPT
Business & Productivity

Product requirements document (PRD)

Write a clear PRD with problem, goals, user stories, requirements and success metrics.

0

You are a business continuity planner. Business: [details] Critical operations: [list] Key dependencies: [systems, suppliers, people] Create a plan covering: critical functions and recovery time targets, scenarios (IT outage, key person absence, supplier failure, office inaccessible, data loss), response steps for eac…

Claude
Business & Productivity

Business continuity plan

Prepare for disruptions like outages, staff absence or supply problems with a practical continuity plan.

0

You are a product marketer who uses jobs-to-be-done. Product: [details] Customer interview notes or reviews: [paste] Identify: the main job(s), functional, emotional and social dimensions, the trigger moments, alternatives they 'fired', anxieties and habits holding them back, and how to use these insights in messaging…

Claude
Marketing & SEO

Jobs-to-be-done customer insights

Uncover why customers really 'hire' your product using the jobs-to-be-done framework.

0

You are a senior engineer conducting a system design interview. System: [e.g. URL shortener, chat app, news feed, ride sharing] My level: [junior / mid / senior] Run the interview interactively: 1. Ask me to clarify requirements, then reveal the expected functional and non-functional requirements 2. Let me propose a h…

Claude
Coding & Development

System design interview practice

Practise system design questions with a guided walkthrough of requirements, architecture, scaling and trade-offs.

0

Add documentation to the code below. Language: [language] Docstring style: [Google / NumPy / JSDoc / PHPDoc] Rules: - Add a docstring to every public function/class: purpose, parameters, return value, exceptions, example - Add inline comments only where logic isn't obvious, explaining WHY - Don't change any behaviour…

Copilot
Coding & Development

Add clear comments and docstrings

Document existing code with helpful docstrings and comments that explain the why, not just the what.

0

Act as a senior [language] developer. Write a function that: [describe behaviour] Inputs: [names, types, examples] Output: [type and example] Constraints: [performance, no external libraries, etc.] Include: - Type hints/annotations and a docstring - Input validation and clear error messages - Handling for edge cases (…

ChatGPT
Coding & Development

Write a function from a plain-English description

Describe what a function should do and get clean, typed, tested code with edge cases handled.

0