Platform Architecture for Organizational Scale Questions
Designing internal platforms and infrastructure to support large engineering organizations and evolving teams. Topics include developer experience and self service platform design, deployment platforms that enable safe frequent releases for hundreds of engineers, platform automation and observability patterns that provide cross service visibility, governance and operational policies, service onboarding and lifecycle, and how to evolve platform capabilities as headcount and service count grows. Candidates should discuss trade offs between centralized platform services and team autonomy, metrics for platform health, and approaches to encourage adoption while minimizing operational friction.
Sample Answer
Sample Answer
Sample Answer
Sample Answer
Sample Answer
import time
import heapq
from collections import defaultdict, deque
class QuotaAllocator:
def __init__(self, team_entitlements):
# team_entitlements: dict team_id -> entitled_quota
self.entitled = dict(team_entitlements)
self.used = defaultdict(int) # committed usage per team
self.borrowed = defaultdict(int) # borrowed amount per team (from others)
self.global_capacity = sum(team_entitlements.values())
# waiting queue: ( -priority, timestamp, request_id, team_id, amount )
self.waiting = []
self.request_counter = 0
def available_global(self):
# spare capacity = total entitlements - sum(current usage)
return max(0, sum(self.entitled.values()) - sum(self.used.values()))
def allocate(self, amount, team_id, priority=0):
# try to allocate immediately; allow borrowing up to available_global
can_use = self.entitled.get(team_id, 0) + self.available_global()
want = amount
if want <= can_use:
# assign as much as possible directly
# borrowed portion = max(0, used_after - entitled)
self.used[team_id] += want
self.borrowed[team_id] = max(0, self.used[team_id] - self.entitled.get(team_id,0))
return True
# otherwise enqueue request with tie-breaker timestamp
self.request_counter += 1
heapq.heappush(self.waiting, (-priority, time.time(), self.request_counter, team_id, amount))
return False
def release(self, amount, team_id):
# free resources and reduce borrowed first
freed = min(amount, self.used.get(team_id,0))
self.used[team_id] -= freed
self.borrowed[team_id] = max(0, self.used[team_id] - self.entitled.get(team_id,0))
self._try_grant_waiting()
return freed
def _try_grant_waiting(self):
# attempt to satisfy queued requests in priority/time order
made_progress = True
while self.waiting and made_progress:
made_progress = False
top = self.waiting[0]
_, _, _, team_id, amount = top
can_use = self.entitled.get(team_id,0) + self.available_global()
if amount <= can_use:
heapq.heappop(self.waiting)
self.used[team_id] += amount
self.borrowed[team_id] = max(0, self.used[team_id] - self.entitled.get(team_id,0))
made_progress = True
# getters for testing/inspection
def status(self):
return {
'entitled': dict(self.entitled),
'used': dict(self.used),
'borrowed': dict(self.borrowed),
'waiting': len(self.waiting),
'global_spare': self.available_global()
}Unlock Full Question Bank
Get access to hundreds of Platform Architecture for Organizational Scale interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.