PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Prompts matching the #architecture tag
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 service (async processing). 7. Rate limiting and abuse prevention. 8. High availability and georedundancy strategy.
Professional diagram following Retrieval Augmented Generation architecture. Components: 1. Document Loader -> Splitting -> Embeddings. 2. Vector DB Storage. 3. Query Rewrite -> Retrieval -> Re-ranking. 4. Contextual Prompt -> LLM Generation. Use blue/violet gradients and high-quality technical icons.
Design a serverless application on AWS. Architecture: 1. API Gateway for HTTP endpoints. 2. Lambda functions for business logic (Node.js/Python). 3. DynamoDB for NoSQL storage. 4. S3 for file uploads with presigned URLs. 5. EventBridge for scheduled tasks. 6. SQS for async processing. 7. CloudWatch for logs and metrics. Use SAM or Serverless Framework for deployment. Implement proper error handling, retries, and dead-letter queues. Include cost optimization strategies (provisioned concurrency, reserved capacity).
Write maintainable code using SOLID principles. Principles: 1. Single Responsibility (class has one reason to change). 2. Open/Closed (open for extension, closed for modification). 3. Liskov Substitution (subclasses should be substitutable for base classes). 4. Interface Segregation (many specific interfaces > one general). 5. Dependency Inversion (depend on abstractions, not concretions). Additional: DRY (Don't Repeat Yourself), KISS (Keep It Simple), YAGNI (You Aren't Gonna Need It). Use meaningful names. Functions should be small (<20 lines). Comments explain why, not what. Refactor regularly. Code is read 10x more than written.
Design microservices architecture effectively. Principles: 1. Single Responsibility (one service, one business capability). 2. Decentralized Data (each service owns its database). 3. API Gateway (single entry point). 4. Service Discovery (Consul, Eureka). 5. Asynchronous Communication (message queues, events). 6. Circuit Breaker (fault tolerance). 7. Containerization (Docker, Kubernetes). Challenges: distributed tracing, data consistency, testing. Use API versioning. Implement health checks. Centralized logging (ELK). Monitoring (Prometheus, Grafana). Start with monolith, extract services gradually. Not always the right choice - consider team size and complexity.
Design clean RESTful APIs. Principles: 1. Use nouns for resources (/users, not /getUsers). 2. HTTP methods: GET (read), POST (create), PUT (update), DELETE (delete). 3. Proper status codes (200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Server Error). 4. Versioning (/v1/users). 5. Filtering, sorting, pagination (?page=2&sort=name). 6. HATEOAS (include links to related resources). 7. Consistent naming (camelCase or snake_case). Use JSON. Stateless requests. Authentication with JWT/OAuth. Rate limiting. Comprehensive documentation (OpenAPI/Swagger). Error messages should be helpful.
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.
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?
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?
Apply design patterns to solve common problems. Creational: 1. Singleton (single instance). 2. Factory (object creation). 3. Builder (complex object construction). Structural: 4. Adapter (interface compatibility). 5. Decorator (add behavior dynamically). 6. Facade (simplified interface). Behavioral: 7. Observer (event notification). 8. Strategy (interchangeable algorithms). 9. Command (encapsulate requests). 10. Template Method (algorithm skeleton). Don't force patterns - use when appropriate. Understand problem first. Patterns improve communication ('let's use Observer here'). Study Gang of Four book. Practice with real examples.
Visualize a complex LangChain agent flow. Flow components: 1. User Input -> Embedding Model. 2. Vector DB (Pinecone) retrieval. 3. LLM (GPT-4) reasoning step. 4. Tool execution (Google Search, Python Repl). 5. Final Output. Use a node-based diagram style with directed arrows and color-coded component boxes.
Technical architectural breakdown of the Burj Khalifa. Visual style: 1. Sleek blueprint aesthetic with blue and white lines. 2. Call-out labels for key levels (Sky lobby, Corporate suites, Observation deck). 3. Cross-section view showing the 'Y-shaped' floor plan. 4. Scale comparison with other global landmarks. 5. Sharp, precise annotations using the 'Nano Banana' technical font.
Design microservices effectively. Patterns: 1. Service per business capability. 2. API Gateway for routing. 3. Service discovery (Consul, Eureka). 4. Circuit breaker for resilience. 5. Event-driven communication. 6. Database per service. 7. Saga pattern for distributed transactions. 8. CQRS for read/write separation. Use Docker and Kubernetes. Implement observability from start.