ByteDance data scientist interviews test statistical reasoning, ML model design, SQL proficiency, A/B testing methodology, and Python-based algorithm implementation.
No verified questions yet for ByteDance.
ModelRegistry:def __init__(self) - Initializes an empty registry.def add_model(self, model_id: str, version: str, metadata: Dict[str, Any]) -> None - Adds a new model with the specified ID, version, and metadata.def get_latest_model(self, model_id: str) -> Tuple[str, Dict[str, Any]] - Retrieves the latest version and its metadata for the specified model ID.def get_all_models(self) -> List[Tuple[str, str, Dict[str, Any]]] - Returns a list of all models with their IDs, versions, and metadata.add_model("recommendation", "v1.0", {"trained_on": "2023-01-01"})add_model("recommendation", "v1.1", {"trained_on": "2023-02-01"})get_latest_model("recommendation") should return ("v1.1", {"trained_on": "2023-02-01"})d days. The function's signature should be def moving_average(engagements: List[int], d: int) -> List[float]: where engagements are the number of engagement occurrences per day.engagements = [100, 200, 300, 400, 500], d = 3[200.0, 300.0, 400.0] engagements = [10, 20, 30, 40], d = 2[15.0, 25.0, 35.0]1 <= engagements.length <= 10^51 <= engagements[i] <= 10^61 <= d <= engagements.lengthk trending topics from a stream of topic interactions. The function signature should be def track_trending_topics(interactions: List[Tuple[str, int]], k: int) -> List[str]: where each interaction is a tuple of topic name and interaction count.interactions = [("dance", 10), ("music", 15), ("sports", 8), ("dance", 20)], k = 2['dance', 'music']interactions = [("comedy", 5), ("news", 5)], k = 1['comedy']0 <= interactions.length <= 10^51 <= k <= interactions.length1 <= interactions[i][1] <= 10^6k minutes. The function signature should be def max_view_count(views: List[int], k: int) -> int: where views is a list of integers representing view counts per minute.views = [100, 200, 300, 400, 500], k = 31200views = [10, 20, 30, 40, 50], k = 1501 <= views.length <= 10^51 <= views[i] <= 10^61 <= k <= views.lengthSign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free