Skip to content

Viddyan/product-batch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

The Scrum team structure is designed to promote agility, collaboration, and efficiency in project management. Here's a structured breakdown:

Scrum Team Roles

  1. Product Owner (PO)

    • Responsibilities:
      • Manages the Product Backlog (prioritizes tasks based on business value).
      • Defines user stories and acceptance criteria.
      • Acts as the liaison between stakeholders and the team.
    • Key Trait: Single point of accountability for maximizing product value.
  2. Scrum Master (SM)

    • Responsibilities:
      • Facilitates Scrum events (Sprint Planning, Daily Stand-ups, etc.).
      • Removes impediments blocking the team.
      • Coaches the team on Scrum principles and practices.
    • Key Trait: Servant leader, not a project manager.
  3. Development Team

    • Responsibilities:
      • Delivers increments of "Done" product functionality each Sprint.
      • Self-organizes to determine how to achieve Sprint goals.
      • Cross-functional (includes developers, testers, designers, etc.).
    • Key Traits:
      • Size: 3–9 members (ideal for agility).
      • Self-Managing: No external assignments—chooses how to do the work.

Core Principles of Scrum Team Structure

  1. Cross-Functionality

    • The team has all skills needed to deliver work without external dependencies (e.g., coding, testing, UX design).
  2. Self-Organization

    • The team decides how to accomplish tasks, not what to do (the "what" is defined by the Product Owner).
  3. Collaboration Over Hierarchy

    • No traditional managers; roles are clearly defined but non-hierarchical.

Scrum Events Involving the Team

  1. Sprint Planning

    • Participants: PO, SM, Development Team.
    • Goal: Define the Sprint goal and select backlog items.
  2. Daily Scrum (Stand-up)

    • Participants: Development Team (SM ensures the meeting happens).
    • Goal: Sync on progress and blockers (15-minute timebox).
  3. Sprint Review

    • Participants: PO, SM, Development Team, stakeholders.
    • Goal: Demo the increment and gather feedback.
  4. Sprint Retrospective

    • Participants: PO, SM, Development Team.
    • Goal: Reflect on the Sprint and improve processes.

Common Misconceptions

  • Scrum Master = Team Lead/Manager: The SM facilitates but does not assign tasks.
  • Product Owner = Stakeholder Committee: The PO is a single person, though they represent stakeholders.
  • Development Team = Only Developers: Includes all roles needed to deliver the product (testers, designers, etc.).

Why This Structure Works

  • Clarity of Roles: Reduces ambiguity and overlaps.
  • Flexibility: Adapts to changing requirements through iterative Sprints.
  • Focus on Value: The PO ensures alignment with business goals, while the team focuses on execution.

The Agile Scrum framework is an iterative approach to software development, emphasizing collaboration, flexibility, and continuous improvement. Below is a step-by-step walkthrough of the Scrum cycle using a user story example, including High-Level Design (HLD), Low-Level Design (LLD), and deployment.


Example User Story

Title: Search Products
As a user,
I want to search for products by keyword,
So that I can quickly find items to purchase.

Acceptance Criteria:

  1. Search results load within 2 seconds.
  2. Results include product name, image, price, and category.
  3. Supports pagination (10 items per page).
  4. Displays "No results found" if no matches.

1. Product Backlog

The Product Owner prioritizes user stories in the backlog.

  • Example Backlog Items:
    • Search Products (current example).
    • Add to Cart.
    • Checkout.

2. Sprint Planning

The team selects the "Search Products" story for the Sprint.

  • Sprint Goal: Implement a functional search feature.
  • Tasks Added to Sprint Backlog:
    • HLD for search architecture.
    • LLD for API and UI components.
    • Develop search backend.
    • Build search UI.
    • Write automated tests.
    • Deploy to production.

3. High-Level Design (HLD)

The team designs the system architecture.

  • Components:
    • Frontend: React.js search bar and results page.
    • Backend: REST API (Spring Boot) handling search requests.
    • Database: PostgreSQL for product data.
    • Search Engine: Elasticsearch for fast, relevant results.
  • Data Flow:
    1. User enters a query → Frontend sends request to /api/search?q={query}.
    2. Backend queries Elasticsearch.
    3. Results returned to the user.
  • Tools: AWS EC2 (hosting), Docker (containerization).

4. Low-Level Design (LLD)

Detailed design for implementation:

  • API Specification:
    • Endpoint: GET /api/v1/search?q={query}&page={page}.
    • Response:
      {
        "results": [
          {
            "id": "123",
            "name": "Wireless Headphones",
            "price": 99.99,
            "image_url": "https://..."
          }
        ],
        "total_pages": 5
      }
  • Elasticsearch Index:
    • Fields: product_id, name, description, price, category.
  • Error Handling:
    • 400 Bad Request for invalid queries.
    • 503 Service Unavailable if Elasticsearch is down.

5. Development

The team codes the feature:

  • Backend:
    • Integrate Elasticsearch with Spring Boot.
    • Write service layer to convert user queries to Elasticsearch requests.
  • Frontend:
    • Create a search bar component in React.
    • Display results with pagination.
  • Database: Sync product data to Elasticsearch nightly (cron job).

6. Testing

  • Unit Tests: Verify API response formats.
  • Integration Tests: Ensure frontend/backend communication.
  • Performance Tests: Confirm results load in <2 seconds under load.

7. Deployment

  • CI/CD Pipeline:
    1. Merge code → GitHub triggers Jenkins pipeline.
    2. Build Docker images for backend/frontend.
    3. Deploy to AWS ECS (staging) for final validation.
    4. Blue/Green deployment to production (minimize downtime).

8. Sprint Review

  • Demo: Show stakeholders the search feature.
  • Feedback: Add "sort by price" to the Product Backlog.

9. Sprint Retrospective

  • What Went Well: Good collaboration between frontend/backend teams.
  • Improvements: Reduce time spent on Elasticsearch configuration.

10. Backlog Refinement

  • New User Story:
    • Title: Filter Search Results by Price.
    • As a user, I want to filter results by price range.

Key Tools Used

  • Tracking: Jira for user stories.
  • Design: Confluence for HLD/LLD.
  • Deployment: Docker, Jenkins, AWS.

Key Takeaways

  • Agile Scrum breaks work into short, iterative cycles (Sprints).
  • HLD/LLD ensure alignment between architecture and implementation.
  • Continuous deployment automates delivery.
  • Feedback loops (reviews, retrospectives) drive improvement.

Detailed walkthrough of the software development lifecycle in Agile Scrum, from inception to deployment, using the "Search Products" user story example. This includes High-Level Design (HLD), Low-Level Design (LLD), and all Scrum ceremonies.


Phase 1: Inception & Ideation

1. Stakeholder Vision

Goal: Define the product vision and identify core features.

  • Example:
    • Business Need: Users struggle to find products quickly on an e-commerce platform.
    • Vision: "Enable users to search and discover products in under 2 seconds."
    • Stakeholders: Product Owner, Business Team, Engineering Lead.

2. User Research

  • Interviews: Users complain about slow, irrelevant search results.
  • Competitor Analysis: Amazon/Shopify-like search experience is expected.
  • Outcome: Prioritize building a fast, keyword-based search feature.

3. Define MVP (Minimum Viable Product)

  • MVP Scope:
    • Basic keyword search.
    • Display product name, price, image.
    • Pagination and "No results" message.

Phase 2: Product Backlog Creation

1. User Story Refinement

User Story:

  • Title: Search Products.
  • As a user, I want to search products by keyword so that I can find items quickly.
  • Acceptance Criteria:
    1. Search results load in <2 seconds.
    2. Results show name, price, image, category.
    3. Pagination (10 items/page).
    4. "No results" message for empty queries.

2. Backlog Prioritization

  • Priority: "Search Products" is a P1 feature.
  • Dependencies:
    • Requires Elasticsearch setup.
    • Product database must be ready.

Phase 3: Sprint Planning

Sprint Duration: 2 weeks.
Attendees: Scrum Master, Product Owner, Developers, QA.

1. Sprint Goal

  • "Deliver a functional search feature with backend integration."

2. Task Breakdown

  • Sprint Backlog:
    • HLD: Design system architecture (1 day).
    • LLD: API specs, database schema (2 days).
    • Backend: Elasticsearch integration, API endpoints (4 days).
    • Frontend: Search bar UI, results page (3 days).
    • Testing: Unit, integration, performance tests (2 days).
    • Deployment: CI/CD pipeline setup (2 days).

3. Effort Estimation

  • Story Points: 8 (using Fibonacci scale).
  • Team Capacity: 6 developers, 2 testers.

Phase 4: High-Level Design (HLD)

Goal: Define architecture, tools, and data flow.

1. System Architecture

  • Components:
    • Frontend: React.js (search bar, results grid).
    • Backend: Spring Boot (REST API).
    • Database: PostgreSQL (product master data).
    • Search Engine: Elasticsearch (indexed product data).
    • Infrastructure: AWS EC2 (servers), Docker (containerization).

HLD Diagram
Data Flow:

  1. User enters query → React sends request to Spring Boot API.
  2. Spring Boot queries Elasticsearch.
  3. Elasticsearch returns results → API formats response → UI displays results.

2. Technology Choices

  • Elasticsearch: For fast, fuzzy, and relevance-based search.
  • AWS: Scalable infrastructure.
  • React/Spring Boot: Team’s existing expertise.

3. Non-Functional Requirements

  • Performance: <2s response time for 10k concurrent users.
  • Security: Input validation to prevent SQL injection.
  • Scalability: Auto-scaling EC2 instances.

Phase 5: Low-Level Design (LLD)

Goal: Detailed specs for developers.

1. API Design

  • Endpoint: GET /api/v1/search?q={query}&page={page}
  • Request:
    {
      "query": "wireless headphones",
      "page": 1
    }
  • Response:
    {
      "results": [
        {
          "id": "123",
          "name": "Wireless Headphones",
          "price": 99.99,
          "image_url": "/images/headphones.jpg",
          "category": "Electronics"
        }
      ],
      "total_pages": 5
    }
  • Error Handling:
    • 400 Bad Request: Invalid query.
    • 503 Service Unavailable: Elasticsearch connection failure.

2. Database Schema

  • PostgreSQL (Products Table):
    CREATE TABLE products (
      id SERIAL PRIMARY KEY,
      name VARCHAR(255),
      description TEXT,
      price DECIMAL,
      category VARCHAR(50),
      image_url VARCHAR(255)
    );
  • Elasticsearch Index:
    {
      "mappings": {
        "properties": {
            "name": { "type": "text" },
            "description": { "type": "text" },
            "price": { "type": "float" },
            "category": { "type": "keyword" }
        }
      }
    }

3. Data Sync Mechanism

  • Cron Job: Nightly sync from PostgreSQL to Elasticsearch.
    • Script: Python script using psycopg2 and elasticsearch-py.
    • Logic:
      # Fetch all products from PostgreSQL
      products = db.query("SELECT * FROM products")
      # Index to Elasticsearch
      for product in products:
          es.index(index="products", id=product.id, body=product.to_dict())

Phase 6: Development

1. Backend Implementation

  • Spring Boot API:
    @RestController
    @RequestMapping("/api/v1")
    public class SearchController {
        @Autowired
        private ElasticsearchTemplate elasticsearchTemplate;
    
        @GetMapping("/search")
        public ResponseEntity<SearchResponse> search(
            @RequestParam String q,
            @RequestParam(defaultValue = "1") int page
        ) {
            // Build Elasticsearch query
            NativeSearchQuery query = new NativeSearchQueryBuilder()
                .withQuery(QueryBuilders.matchQuery("name", q))
                .withPageable(PageRequest.of(page - 1, 10))
                .build();
    
            // Execute search
            SearchHits<Product> hits = elasticsearchTemplate.search(query, Product.class);
            return ResponseEntity.ok(convertToResponse(hits));
        }
    }

2. Frontend Implementation

  • React Search Component:
    function SearchBar() {
      const [query, setQuery] = useState("");
      const [results, setResults] = useState([]);
    
      const handleSearch = async () => {
        const response = await axios.get(`/api/v1/search?q=${query}`);
        setResults(response.data.results);
      };
    
      return (
        <div>
          <input type="text" onChange={(e) => setQuery(e.target.value)} />
          <button onClick={handleSearch}>Search</button>
          <ResultsList results={results} />
        </div>
      );
    }

3. Data Sync Script

  • Python Script:
    import psycopg2
    from elasticsearch import Elasticsearch
    
    # Connect to PostgreSQL
    conn = psycopg2.connect("dbname=products user=postgres")
    cur = conn.cursor()
    cur.execute("SELECT * FROM products")
    products = cur.fetchall()
    
    # Connect to Elasticsearch
    es = Elasticsearch("http://localhost:9200")
    
    # Index data
    for product in products:
        doc = {
            "name": product[1],
            "price": product[3],
            "category": product[4]
        }
        es.index(index="products", id=product[0], body=doc)

Phase 7: Testing

1. Unit Testing

  • Backend (JUnit):
    @Test
    public void testSearchEndpoint() {
        SearchResponse response = searchController.search("headphones", 1);
        assertNotNull(response.getResults());
    }

2. Integration Testing

  • Postman Collection:
    • Test Case: Search for "wireless headphones" → Verify 200 OK and results.
    • Test Case: Empty query → Verify 400 Bad Request.

3. Performance Testing

  • Tool: JMeter.
    • Simulate 10k users → Confirm response time <2s.

4. UAT (User Acceptance Testing)

  • Scenario:
    1. User types "headphones" → Sees 10 results.
    2. User searches "xyz123" → Sees "No results found".

Phase 8: Deployment

1. CI/CD Pipeline

  • Tools: Jenkins, Docker, AWS ECS.
  • Steps:
    1. Merge code to main → Trigger Jenkins job.
    2. Build Docker images:
      # Backend Dockerfile
      FROM openjdk:11
      COPY target/search-api.jar /app.jar
      CMD ["java", "-jar", "/app.jar"]
    3. Run automated tests in staging.
    4. Deploy to production using blue/green deployment:
      • Route traffic from old (blue) to new (green) EC2 instances.

2. Monitoring

  • AWS CloudWatch: Track API latency, error rates.
  • Elasticsearch Monitoring: Cluster health, query latency.

Phase 9: Sprint Review & Retrospective

1. Sprint Review

  • Demo: Show stakeholders the working search feature.
  • Feedback:
    • Add "Sort by Price" to the backlog.
    • Improve mobile UI responsiveness.

2. Retrospective

  • What Went Well:
    • Smooth collaboration between frontend/backend teams.
  • Improvements:
    • Reduce time spent on Elasticsearch config.
    • Improve test coverage for edge cases.

Phase 10: Backlog Refinement

  • New Stories Added:
    • Title: Filter Search Results by Price.
    • Title: Autocomplete Search Suggestions.

Tools Used

  • Project Tracking: Jira.
  • Design: Confluence (HLD/LLD), Lucidchart (diagrams).
  • Deployment: Docker, Jenkins, AWS.

Key Takeaways

  1. Agile Scrum breaks work into manageable sprints.
  2. HLD/LLD bridges vision and execution.
  3. Automated CI/CD ensures rapid, reliable deployment.
  4. Feedback loops (reviews, retrospectives) drive continuous improvement.

Microservices and system design fit into the Agile Scrum framework primarily during High-Level Design (HLD) and Low-Level Design (LLD) phases, influencing architecture, team structure, and deployment strategies. Let’s integrate microservices and system design into the earlier "Search Products" example, breaking down where and how they apply.


1. System Design in Agile Scrum

System design defines the architecture of the application. In Agile Scrum, this happens iteratively:

  • Inception: Stakeholders agree on architectural principles (e.g., monolith vs. microservices).
  • HLD: Macro-level design (services, communication, infrastructure).
  • LLD: Detailed design of individual components (APIs, databases, etc.).

2. Where Microservices Fit In

Microservices are an architectural choice to decouple functionality into independent, scalable units. Here’s how they fit into the Search Products example:

Phase 1: Inception & Vision

  • Architectural Decision:
    The team decides to adopt microservices to:
    • Scale search independently from other features (e.g., checkout, user profiles).
    • Allow separate deployment cycles for different teams.
    • Improve fault isolation (e.g., search failures don’t crash the entire app).

Phase 2: High-Level Design (HLD)

The system is split into microservices:
Microservices HLD

Services Identified:

  1. Search Service: Handles search queries using Elasticsearch.
  2. Product Service: Manages product data (PostgreSQL).
  3. API Gateway: Routes requests to the right service.
  4. Auth Service: Handles user authentication (not part of the search example but included for completeness).

Interactions:

  1. User enters a query → API Gateway routes it to the Search Service.
  2. Search Service queries Elasticsearch and fetches product IDs.
  3. Search Service calls Product Service to get product details (name, price, image).
  4. Combined results are returned to the user.

Tools:

  • Service Communication: REST APIs, gRPC, or messaging (Kafka).
  • Infrastructure: Kubernetes (orchestration), Docker (containerization), AWS EKS.

Phase 3: Low-Level Design (LLD)

Each microservice is designed in detail:

Example: Search Service LLD

  • API Spec:
    GET /search?q={query}&page={page}
    Response: { "product_ids": ["123", "456"], "total_pages": 5 }
  • Elasticsearch Integration:
    • Index schema for searchable fields (name, category).
    • Query logic for fuzzy matching and relevance ranking.

Example: Product Service LLD

  • API Spec:
    GET /products?ids=123,456
    Response: { "products": [{ "id": "123", "name": "Headphones", ... }] }
  • Database: PostgreSQL schema for product metadata.

3. Development & Testing

Development

  • Search Service Team: Focuses on Elasticsearch integration and performance.
  • Product Service Team: Manages PostgreSQL and product data APIs.
  • API Gateway Team: Configures routing and rate-limiting.

Testing

  • Contract Testing: Verify APIs between Search Service and Product Service.
  • Resilience Testing: Ensure Search Service gracefully handles Product Service downtime.
  • Performance Testing: Load-test Elasticsearch and API Gateway.

4. Deployment

  • CI/CD Pipeline:
    Each microservice has its own pipeline:
    1. Search Service: Build → Test → Deploy to Kubernetes cluster.
    2. Product Service: Separate pipeline with database migration checks.
  • Infrastructure:
    • Kubernetes manages scaling (e.g., auto-scale Search Service during peak traffic).
    • Istio (service mesh) handles observability and traffic routing.

5. Impact on Scrum Ceremonies

  1. Sprint Planning:

    • Teams work on different services (e.g., one team on Search Service, another on API Gateway).
    • Cross-service dependencies (e.g., Search needing Product APIs) are flagged early.
  2. Daily Standups:

    • Teams sync on inter-service issues (e.g., "Blocked until Product Service’s API is ready").
  3. Sprint Review:

    • Demo cross-service workflows (e.g., end-to-end search flow).
  4. Retrospective:

    • Discuss challenges like inter-team communication or deployment bottlenecks.

6. Tools for Microservices in Scrum

Area Tools
Orchestration Kubernetes, Docker Swarm
Monitoring Prometheus, Grafana, AWS CloudWatch
Logging ELK Stack (Elasticsearch, Logstash, Kibana)
CI/CD Jenkins, GitLab CI, ArgoCD
API Management Kong, AWS API Gateway

7. Key Benefits & Challenges

Benefits:

  • Teams work independently on services.
  • Scalability (e.g., spin up more Search Service instances during sales).
  • Fault isolation (a bug in Product Service doesn’t crash Search).

Challenges:

  • Complexity in debugging distributed systems.
  • Ensuring data consistency across services.
  • Overhead of managing multiple deployments.

Example Workflow with Microservices

  1. User Story: "Search Products" now spans two services:

    • Search Service (query handling).
    • Product Service (fetching product details).
  2. Tasks in Sprint Backlog:

    • Design Search Service API (LLD).
    • Implement Product Service’s batch endpoint (GET /products?ids=...).
    • Configure API Gateway routing rules.
  3. Deployment:

    • Search Service is deployed first, followed by Product Service updates.

Final Takeaways

  1. System Design defines how microservices fit into the architecture.
  2. HLD/LLD in Scrum ensure teams align on service boundaries and contracts.
  3. Agile’s iterative nature allows gradual adoption of microservices (e.g., start with a monolith, split later).

The topics discussed—system design, microservices, Agile/Scrum processes, and deployment strategies—are critical for MAANG (Meta, Amazon, Apple, Netflix, Google) interviews, especially for software engineering roles. Here’s how they fit into your preparation and why they matter:


1. System Design Interviews

MAANG interviews heavily emphasize system design for mid-to-senior roles. You’ll be asked to architect scalable systems (e.g., "Design YouTube" or "Design a Product Search System").

  • What’s tested:
    • Breaking down requirements (e.g., "Search Products" user story).
    • Designing HLD/LLD (APIs, databases, microservices, caching, load balancing).
    • Trade-offs (SQL vs. NoSQL, REST vs. gRPC).
    • Scalability, fault tolerance, and latency optimization.
  • Example:
    If asked to design a search engine, you’d discuss Elasticsearch, API gateways, pagination, and caching—all covered in the earlier example.

2. Microservices & Distributed Systems

MAANG companies build distributed systems at scale, so expect questions on:

  • Service decomposition (e.g., splitting monoliths into microservices).
  • Communication (REST, gRPC, messaging queues like Kafka).
  • Challenges:
    • Data consistency (ACID vs. BASE).
    • Fault tolerance (retries, circuit breakers).
    • Observability (logging, metrics, tracing).
  • Example:
    Explaining how the "Search Service" and "Product Service" interact in a microservices architecture could be a follow-up question.

3. Agile/Scrum & Behavioral Questions

While Agile/Scrum is less technical, it’s often discussed in:

  • Behavioral rounds (e.g., "Describe a project where you used Agile").
  • Leadership principles (e.g., "How do you handle sprint planning with dependencies?").
  • Conflict resolution (e.g., "How do you prioritize backlog items?").

4. Deployment & DevOps

Expect questions on:

  • CI/CD pipelines (e.g., "How would you automate deployment for a microservice?").
  • Infrastructure as Code (Terraform, CloudFormation).
  • Monitoring (Prometheus, Grafana).
  • Scalability (Kubernetes, auto-scaling groups).

5. Coding Rounds

While coding (data structures/algorithms) is the primary focus for entry-level roles, system design and microservices knowledge becomes crucial for:

  • Code extensibility (e.g., "How would you design this code to scale to 1M users?").
  • API design (e.g., "Write an API for the Search Service").

How to Prepare

1. Study System Design Basics

  • Key Concepts:
    • Load balancing, caching (Redis), databases (SQL vs. NoSQL).
    • CAP theorem, eventual consistency, sharding.
  • Resources:
    • Books: "Designing Data-Intensive Applications" (Martin Kleppmann).
    • Platforms: Grokking the System Design Interview, Educative.io.

2. Practice Real-World Scenarios

  • Example Questions:
    • Design Twitter, Uber, Netflix, or a URL shortener.
    • Optimize a search feature (as in the earlier example).
  • Mock Interviews: Use platforms like Interviewing.io or Pramp.

3. Understand Microservices Trade-Offs

  • When to split a monolith.
  • How to handle inter-service communication, distributed transactions, and observability.

4. Review DevOps Tools

  • Know the basics of Docker, Kubernetes, AWS/GCP, and CI/CD pipelines.

5. Mock Behavioral Responses

  • Use the STAR method to frame Agile/Scrum experiences:
    • Situation: "My team used Scrum to build a search feature..."
    • Task: "I owned the backend API for search..."
    • Action: "I integrated Elasticsearch and wrote automated tests..."
    • Result: "Reduced search latency by 40%."

Example MAANG Interview Question

Question: "Design a product search system for an e-commerce platform."
Your Answer Framework:

  1. Requirements:
    • Search by keyword, filters (price, category), pagination.
    • Latency <2s for 100K QPS.
  2. HLD:
    • Microservices: Search Service, Product Service, API Gateway.
    • Elasticsearch for search, PostgreSQL for product data.
  3. LLD:
    • API specs for search and product endpoints.
    • Data sync from PostgreSQL to Elasticsearch.
  4. Scalability:
    • Cache results with Redis.
    • Use Kubernetes for auto-scaling.
  5. Trade-offs:
    • Elasticsearch’s eventual consistency vs. PostgreSQL’s ACID.

Key Takeaways

  • System design and microservices are mandatory for MAANG interviews.
  • Agile/Scrum knowledge helps in behavioral rounds and leadership principles.
  • Focus on scalability, trade-offs, and real-world examples (like the "Search Products" case).
  • Pair coding practice (LeetCode) with system design prep for a balanced approach.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published