# Technical Coding & Architecture Challenge Brief
**Company / Organization:** Supabase  
**Role:** Senior Software Engineer (Senior Software Engineer (5-8 Years))  
**Target Tech Stack:** `Python,Kubernetes`  
**Assessment Requisition ID:** `VET-202611-82217A`  
**Recommended Time Limit:** 60 - 90 Minutes  
**Evaluation Standard:** Production Clean Code, Test Coverage & Architectural Foresight  

---

## Instructions for the Candidate:
1. Treat this exercise as if you are shipping production code to an active scaleup repository.
2. Structure your solution with clean modularity, defensive error handling, and unit test coverage.
3. Be prepared to walk through your design decisions, trade-offs, and scaling bottlenecks during the debrief.

---

## Active Hands-On Challenge Scenarios:

### Challenge #1: Idempotent Event Ingestion & Rate-Limited Deduplication Service

**Business Scenario & Requirements:**  
Implement a thread-safe / async memory-efficient event deduplicator that handles 10,000 req/sec with an sliding 60-second TTL window and sliding token-bucket rate limiter per API key.

**Scoring & Verification Criteria:**  
- Time complexity O(1), thread safety / atomic operations, proper cleanup of expired keys without memory leaks, clean unit tests.
- Production Readiness: Thread/async safety, zero memory leaks, graceful shutdown.
- Documentation: Succinct README explaining architecture trade-offs.

---

### Challenge #2: Zero-Downtime Deployment & Pod Disruption Topology

**Business Scenario & Requirements:**  
Write a production-grade Kubernetes Deployment & PDB manifest for a multi-tenant microservice requiring rolling updates across at least 3 availability zones with zero dropped requests, custom readiness gates, and graceful shutdown handling.

**Scoring & Verification Criteria:**  
- TopologySpreadConstraints, PodDisruptionBudget (minAvailable: 75%), preStop lifecycle hook, calibrated liveness/readiness probes, and explicit securityContext (readOnlyRootFilesystem, non-root user).
- Production Readiness: Thread/async safety, zero memory leaks, graceful shutdown.
- Documentation: Succinct README explaining architecture trade-offs.

---

## Submission & Technical Debrief:
- Deliver your solution as a Git repository link or zip archive including runnable test suites.
- Our engineering panel will review code structure, performance profile, and adherence to clean architecture principles.
- **Inquiries / Support:** `engineering-vetting@supabase.com`