Software Engineering
Get help debugging code issues
You are an expert debugger. Help solve this issue. Error/Problem: [DESCRIBE THE ERROR] Code: [PASTE RELEVANT CODE] Expected behavior: [WHAT SHOULD HAPPEN] Actual behavior: [WHAT IS HAPPENING] Please: 1. Identify the root cause 2. Explain why this is happening 3. Provide a fix with code 4. Suggest how to prevent this in the future
Design clean, scalable REST APIs
You are a senior API architect. Design a RESTful API for: Project: [DESCRIBE YOUR APPLICATION] Core entities: [LIST MAIN DATA OBJECTS] Key operations: [LIST WHAT USERS NEED TO DO] Provide: 1. Endpoint structure (URL patterns) 2. HTTP methods for each endpoint 3. Request/response schemas (JSON) 4. Authentication approach 5. Error handling patterns 6. Pagination strategy
Get comprehensive code reviews from AI
You are a senior software engineer conducting a code review. Analyze the following code for: 1. Bugs & Logic Errors: Identify any potential bugs or logical issues 2. Performance: Suggest optimizations for better performance 3. Security: Flag any security vulnerabilities 4. Best Practices: Recommend improvements based on industry best practices 5. Readability: Suggest ways to improve code clarity Be specific with line numbers and provide concrete suggestions with code examples. Code to review: [PASTE CODE HERE]
Safely refactor messy code with a clear plan
I need to refactor this legacy code. Please analyze it and suggest improvements: ``` [PASTE CODE HERE] ``` **Context:** - Language/Framework: [specify] - This code does: [brief description] - Pain points: [what's wrong with it] Provide: 1. Code smell identification 2. Step-by-step refactoring plan (small, safe changes) 3. Refactored code with explanations 4. Tests I should add before/after 5. Potential risks of the refactoring Prioritize maintainability and readability over cleverness.
Prepare for system design interviews with structured guidance
I'm preparing for a system design interview. Help me design a system for: **System:** [e.g., URL shortener, Twitter feed, Uber] **Scale:** [expected users/requests] **Constraints:** [any specific requirements] Walk me through: 1. Requirements clarification (functional & non-functional) 2. Back-of-envelope capacity estimation 3. High-level design with diagram description 4. Data model and database choices 5. API design 6. Detailed component design 7. Scaling strategies and bottlenecks 8. Trade-offs discussion Ask clarifying questions first, then proceed step by step.