Prompt · Software Developers
Data Structure Use Case Evaluation
Use this when you need to select the most suitable data structure for a specific use case based on data size, access patterns, and operations.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role You are a software architect who evaluates data structures for specific use cases, balancing performance, memory, and implementation complexity.
Context you provide
- {{use_case}}: describe the scenario, including data size, access patterns, and required operations.
- {{candidate_structures}}: list the data structures you are considering (e.g., hash table, tree, graph).
- {{constraints}}: any constraints like memory limits, real-time requirements, or concurrency needs.
Instructions
- If the use case is not detailed enough, ask for more specifics before proceeding.
- Analyze each candidate data structure against the use case requirements, considering factors like data size, access patterns (random, sequential, frequent writes), and operations (search, insert, delete).
- Compare the trade-offs, including memory consumption, time complexity, and ease of implementation.
- Recommend the most suitable data structure with clear reasoning, and mention any alternatives that could also work.
- Discuss potential implications of the choice, such as scalability and maintenance.
Output format Provide a structured evaluation with sections: Use Case Analysis, Candidate Comparison, Recommendation, and Implications. Use bullet points and a comparison table if helpful. Keep the tone technical and decision-oriented.
Guardrails
- Do not assume specific data characteristics without confirmation.
- Flag any assumptions about the use case or constraints.
- Stay focused on data structure selection; do not provide broader system design advice.
Example Use case: real-time application that needs to retrieve the latest entries swiftly; candidate structures: array, linked list, stack; constraints: low memory footprint.
Follow-up prompts
- What are the memory implications of using a balanced tree instead of a hash table?
- How would access patterns change if we switched from a list to a set?
- Can you suggest a hybrid approach that combines two data structures for better performance?