Together AI interview questions & answers

20 Together AI interview questions with full model answers — Coding, System design, Product & growth, Technical. Drawn from the same bank ChannelPulse drills from (60 Together AI questions in total).

BehavioralEasyTogether AI

1. Tell me about a time when you had to collaborate with a team to solve a challenging problem.

The full question

Tell me about a time when you had to collaborate with a team to solve a challenging problem. What was your role, and what was the outcome?

Model answer

Situation In my previous role as a software engineer at a tech company, our team faced a significant challenge when tasked with integrating a third-party data visualization library into our custom backend solution. This integration was crucial for delivering a real-time data analytics platform to our client, who required advanced visualizations and user-friendly interfaces. Given the complexity of the task and the tight deadline, it was essential for our team to collaborate effectively to ensure success.

Task As the lead developer on the project, my goal was to facilitate the integration process by coordinating efforts across different teams, including front-end and back-end developers, UX designers, and data scientists. The key constraint was to deliver the platform within the stipulated timeline without compromising on quality.

Action

  • I initiated a series of brainstorming sessions to bring together all the stakeholders involved in the project. This helped us align on the project goals and identify potential integration approaches.
  • During these sessions, I encouraged open communication and the sharing of ideas, which allowed us to identify potential roadblocks early in the process.
  • I took the lead in organizing the workflow, assigning specific tasks to team members based on their expertise, and setting clear deadlines to ensure progress was tracked effectively.
  • To address technical challenges, I facilitated technical deep-dives where team members could collaboratively troubleshoot and refine our integration strategy.
  • I maintained regular updates with the client to manage expectations and incorporate their feedback into our development process, ensuring the final product met their needs.

Result Our collaborative efforts paid off, as we successfully delivered the real-time data analytics platform on time. The client was delighted with the platform’s user-friendly interface and the advanced visualizations it provided. This project not only strengthened our team's ability to work together effectively but also taught me the importance of communication and collaboration in achieving complex technical goals. I learned that by fostering an environment of open dialogue and leveraging the diverse skills of team members, we could overcome significant challenges and deliver high-quality solutions.

BehavioralMediumTogether AI

2. Can you provide an example of a time when you identified a technical issue in a project?

The full question

Can you provide an example of a time when you identified a technical issue in a project? What steps did you take to resolve it?

Model answer

Situation

While working as a software developer at a mid-sized tech company, I was part of a team responsible for maintaining and enhancing our customer-facing web application. During a routine code review, I identified a technical issue where a significant portion of our legacy code was not compatible with the new features we planned to implement. This incompatibility posed a risk of system crashes and data inconsistencies, which could severely impact our user experience and client satisfaction.

Task

My task was to address this compatibility issue promptly to ensure the successful integration of the new features without disrupting the existing functionality. The key constraint was the tight timeline, as the new features were part of a major update scheduled for release in just a few weeks.

Action

  • I began by conducting a thorough analysis of the legacy code to understand the root cause of the incompatibility. This involved reviewing documentation and collaborating with team members who had worked on the original implementation.
  • I proposed a refactoring plan that would isolate the problematic code sections and replace them with updated modules that supported the new features. This plan aimed to minimize disruption to the existing system while ensuring compatibility.
  • I communicated the proposed changes to the team and stakeholders, highlighting the potential risks of not addressing the issue and the benefits of the refactoring approach. This helped gain their buy-in and support for the necessary changes.
  • I led a small team to implement the refactoring plan, ensuring that we followed best practices for testing and validation. We created a comprehensive suite of automated tests to verify that the refactored code maintained existing functionality and supported the new features.
  • Throughout the process, I maintained open lines of communication with the team, providing regular updates and addressing any concerns promptly. This helped keep the project on track and ensured alignment with our goals.

Result

The refactoring was completed successfully, and the new features were integrated without any major issues. The update was released on schedule, and the application performed reliably, with no reported crashes or data inconsistencies. This experience reinforced the importance of proactive problem-solving and effective communication in managing technical challenges. It also highlighted the value of thorough testing and validation in ensuring system stability and user satisfaction.

BehavioralMediumTogether AI

3. Describe a situation where you had to adapt to a significant change in project requirements.

The full question

Describe a situation where you had to adapt to a significant change in project requirements. How did you handle it?

Model answer

Situation In my role as a software developer at Together AI, I was part of a team working on a machine learning project aimed at enhancing our recommendation engine. Midway through the project, the product team decided to pivot the focus from a general recommendation system to a more personalized one, tailored to individual user preferences. This change was significant because it required a complete overhaul of our existing algorithms and data processing methods. The stakes were high as this feature was a key differentiator for our upcoming product launch.

Task My responsibility was to lead the adaptation of our backend systems to accommodate this new personalized approach. The key constraint was the tight timeline, as we had only a few weeks to implement these changes without delaying the launch.

Action

  • I began by organizing a series of meetings with the product and data science teams to fully understand the new requirements and the underlying rationale. This helped in aligning our technical approach with the business objectives.
  • To manage the workload effectively, I coordinated with my team to redistribute tasks based on each member's expertise. We also identified areas where we could leverage existing code to save time.
  • I prioritized the most critical components of the new system, focusing first on developing a robust user profiling mechanism that would serve as the foundation for personalized recommendations.
  • Recognizing the need for additional expertise, I reached out to a colleague with experience in personalization algorithms to consult on best practices and potential pitfalls.
  • Throughout the process, I maintained regular communication with stakeholders, providing updates on progress and any challenges encountered. This transparency helped manage expectations and fostered trust.

Result Despite the significant shift in project requirements, we successfully adapted our systems to deliver a personalized recommendation engine on time. The feature was well-received by both internal stakeholders and early users, who noted an improvement in the relevance of recommendations. This experience reinforced the importance of flexibility and proactive communication in managing project changes. I learned valuable lessons in cross-functional collaboration and efficient resource management, which have been instrumental in subsequent projects.

BehavioralMediumTogether AI

4. How do you handle version control in a collaborative environment?

Model answer

Situation In my previous role as a software developer at a mid-sized tech company, I was part of a team responsible for developing a new feature for our flagship product. This project required close collaboration with another team working on a related component. Effective version control was critical, as both teams needed to ensure code compatibility and avoid conflicts. The stakes were high because any misalignment could lead to significant delays in the product release.

Task My specific goal was to implement a robust version control strategy that would facilitate seamless collaboration between the two teams, ensuring that all code changes were tracked, conflicts were minimized, and integration was smooth.

Action

  • I initiated a meeting with key members from both teams to discuss and agree on a version control workflow. We decided to use Git as our version control system due to its flexibility and widespread adoption.
  • We established a branching strategy, opting for a 'feature branch' model. Each developer would create a separate branch for their feature, which would then be merged into a 'development' branch after passing code reviews and tests.
  • To maintain code quality and consistency, I set up automated CI/CD pipelines that would run tests and checks on every pull request. This ensured that only code meeting our quality standards could be merged.
  • I organized regular sync meetings to discuss ongoing work, address any merge conflicts early, and ensure alignment between the teams. This open communication helped in quickly resolving any issues that arose.
  • I also encouraged the use of detailed commit messages and documentation, which proved invaluable for tracking changes and understanding the history of modifications.

Result The implementation of this version control strategy resulted in a smooth and efficient development process. We successfully integrated the new feature with minimal conflicts and met our release deadline. This experience reinforced the importance of clear communication and structured workflows in collaborative environments. It also highlighted the value of proactive conflict resolution and continuous integration in maintaining project momentum and quality.

CodingEasyTogether AI

5. Find the intersection of two arrays.

Model answer

function intersect(nums1, nums2) {
    // Sort both arrays
    nums1.sort((a, b) => a - b);
    nums2.sort((a, b) => a - b);

    const intersection = [];
    let i = 0, j = 0;

    // Use two pointers to find common elements
    while (i < nums1.length && j < nums2.length) {
        if (nums1[i] < nums2[j]) {
            i++;
        } else if (nums1[i] > nums2[j]) {
            j++;
        } else {
            // Found a common element
            intersection.push(nums1[i]);
            i++;
            j++;
        }
    }

    return intersection;
}

// Example usage:
console.log(intersect([1, 2, 2, 1], [2, 2])); // Output: [2, 2]
  • Approach:
  • Sort both input arrays to facilitate the use of the two-pointer technique.
  • Initialize two pointers, i and j, starting at the beginning of each array.
  • Traverse both arrays simultaneously:
  • If the element in the first array is smaller, increment the first pointer.
  • If the element in the second array is smaller, increment the second pointer.
  • If elements are equal, add to the intersection and increment both pointers.
  • Continue until one of the arrays is fully traversed.
  • Complexity:
  • Time: O(n log n + m log m), where n and m are the lengths of the two arrays. This is due to sorting both arrays.
  • Space: O(min(n, m)) for storing the intersection results.
CodingEasyTogether AI

6. Reverse a string in place.

Model answer

function reverseStringInPlace(str) {
  // Convert the string to an array to allow in-place modifications
  let arr = str.split('');
  let left = 0;
  let right = arr.length - 1;

  // Use two-pointer technique to swap elements until the pointers meet
  while (left < right) {
    // Swap the elements at the left and right pointers
    let temp = arr[left];
    arr[left] = arr[right];
    arr[right] = temp;

    // Move the pointers towards the center
    left++;
    right--;
  }

  // Convert the array back to a string
  return arr.join('');
}

// Example usage:
console.log(reverseStringInPlace("hello")); // Output: "olleh"
  • Approach:
  • Convert the string to an array to facilitate in-place modifications.
  • Use a two-pointer technique: one pointer starts at the beginning (left), and the other at the end (right).
  • Swap the characters at these pointers and move them towards the center.
  • Continue swapping until the pointers meet or cross each other.
  • Convert the array back to a string and return it.
  • Complexity:
  • Time: O(n), where n is the length of the string. Each character is visited once.
  • Space: O(n) due to the conversion of the string to an array. However, the in-place modification of the array itself is O(1).
CodingEasyTogether AI

7. Given an array of integers, write a function to find the maximum sum of any contiguous subarray of the array.

The full question

Given an array of integers, write a function to find the maximum sum of any contiguous subarray of the array. Return the maximum sum.

Model answer

function maxSubArray(nums) {
    // Initialize variables to keep track of the maximum sum and the current sum
    let maxSum = nums[0];
    let currentSum = nums[0];

    // Iterate through the array starting from the second element
    for (let i = 1; i < nums.length; i++) {
        // Update the current sum by including the current element
        // If the current element is greater than the current sum, start a new subarray
        currentSum = Math.max(nums[i], currentSum + nums[i]);
        
        // Update the maximum sum if the current sum is greater
        maxSum = Math.max(maxSum, currentSum);
    }

    return maxSum;
}

// Example usage:
console.log(maxSubArray([-2,1,-3,4,-1,2,1,-5,4])); // Output: 6
  • Approach: This solution uses Kadane's Algorithm, which efficiently finds the maximum sum of a contiguous subarray. It maintains a running sum (currentSum) and updates it by either adding the current element or starting a new subarray with the current element if it is larger. The maxSum is updated whenever currentSum exceeds it.
  • Complexity:
  • Time: O(n), where n is the number of elements in the array. We traverse the array once.
  • Space: O(1), as we use a constant amount of extra space.
CodingMediumTogether AISoftware EngineerTechnical Screen

8. Implement schedule_gpu_nodes(nodes, request_gpus, delete_name).

The full question

Implement schedule_gpu_nodes(nodes, request_gpus, delete_name).

Each node is {name, gpus, running_pods} and each pod is {name, required_gpus}. Inputs are well formed: pod names and node names are unique, and existing pods do not exceed node capacity.

Return two results:

  1. eligible: every node with at least request_gpus free GPUs, represented as [node_name, free_gpus] in node input order.
  2. reschedule: remove the node named delete_name and place all of its pods on the remaining nodes without moving existing pods. Return [pod_name, destination_node] pairs in the drained node's pod order. If no complete placement exists, return null. When several placements work, return the lexicographically smallest destination-node sequence.

Constraints

  • Up to 100 nodes for eligibility queries.
  • The drained node has at most 12 pods and at most 12 remaining nodes for exact rescheduling.
  • GPU counts are nonnegative integers.
  • A pod must fit entirely on one node.

Example

If node A has capacity 8 with pods using 6 GPUs, node B has capacity 8 with pods using 4 GPUs, and node C is empty with capacity 8, then a request for 2 GPUs lists all three nodes with free capacities 2, 4, and 8. Draining A must place all of its pods on B and C or return null.

Model answer

function schedule_gpu_nodes(nodes, request_gpus, delete_name) {
    // Step 1: Find eligible nodes
    const eligible = nodes.map(node => {
        const usedGpus = node.running_pods.reduce((sum, pod) => sum + pod.required_gpus, 0);
        const freeGpus = node.gpus - usedGpus;
        return { name: node.name, freeGpus };
    }).filter(node => node.freeGpus >= request_gpus)
      .map(node => [node.name, node.freeGpus]);

    // Step 2: Reschedule pods from the node to be deleted
    const nodeToDelete = nodes.find(node => node.name === delete_name);
    if (!nodeToDelete) return { eligible, reschedule: null };

    const podsToReschedule = nodeToDelete.running_pods;
    const remainingNodes = nodes.filter(node => node.name !== delete_name);

    // Sort remaining nodes lexicographically by name
    remainingNodes.sort((a, b) => a.name.localeCompare(b.name));

    // Try to place each pod on the remaining nodes
    const reschedule = [];
    for (const pod of podsToReschedule) {
        let placed = false;
        for (const node of remainingNodes) {
            const usedGpus = node.running_pods.reduce((sum, p) => sum + p.required_gpus, 0);
            const freeGpus = node.gpus - usedGpus;
            if (freeGpus >= pod.required_gpus) {
                node.running_pods.push(pod); // Temporarily add pod to node
                reschedule.push([pod.name, node.name]);
                placed = true;
                break;
            }
        }
        if (!placed) return { eligible, reschedule: null }; // If any pod can't be placed, return null
    }

    return { eligible, reschedule };
}

// Example usage:
const nodes = [
    { name: 'A', gpus: 8, running_pods: [{ name: 'pod1', required_gpus: 6 }] },
    { name: 'B', gpus: 8, running_pods: [{ name: 'pod2', required_gpus: 4 }] },
    { name: 'C', gpus: 8, running_pods: [] }
];
const request_gpus = 2;
const delete_name = 'A';

console.log(schedule_gpu_nodes(nodes, request_gpus, delete_name));
  • Approach:
  • Eligible Nodes: Calculate free GPUs for each node and filter nodes with at least request_gpus free GPUs.
  • Rescheduling: Identify the node to delete and attempt to place its pods on remaining nodes.
  • Placement: Sort nodes lexicographically and try placing each pod on a node with sufficient free GPUs.
  • Return: If all pods can be placed, return the placement; otherwise, return null.
  • Complexity:
  • Time: O(N * M), where N is the number of nodes and M is the number of pods per node (for calculating free GPUs and attempting placements).
  • Space: O(N + P), where P is the number of pods on the node to be deleted (for storing eligible nodes and rescheduling results).
Product & growthEasyTogether AIProduct Manager

9. What is your favorite product, and why do you think it's successful?

Model answer

Favorite Product: My favorite product is Spotify.

Why it's successful:

  1. User-Centric Design: Spotify offers a seamless user experience with intuitive navigation and personalized playlists.
  2. Innovative Features: Features like Discover Weekly and Wrapped engage users by offering personalized music recommendations and insights.
  3. Strong Brand Partnerships: Collaborations with artists and brands enhance its content library and user engagement.

Metrics of Success:

  • High user retention and engagement rates.
  • Growth in premium subscribers.
  • Strong brand recognition and market share.

Conclusion: Spotify's success is driven by its commitment to user experience, innovative features, and strategic partnerships, making it a leader in the music streaming industry.

Product & growthMediumTogether AIProduct Manager

10. How would you improve the user onboarding experience for Together AI?

Model answer

Clarify & scope: The goal is to enhance the onboarding experience for Together AI to increase user engagement and retention. Assume the current process involves multiple steps and users drop off before completing it.

User segments & pain points: Focus on new users who are first-time visitors to the platform. Pain points may include confusion about the platform's features or a lack of guidance through the onboarding process.

Goals & success metrics: The North Star metric is the completion rate of the onboarding process. Guardrails include time spent on onboarding and user satisfaction ratings.

Solutions:

  1. Interactive Tutorials: Create a step-by-step interactive guide that walks users through key features.
  2. Personalized Onboarding: Use data to tailor the onboarding process based on user preferences or profile information.
  3. Gamification: Introduce elements like progress bars or rewards for completing onboarding steps.

Recommendation: Implement the interactive tutorials as they provide immediate guidance and can be easily iterated based on user feedback.

graph TD;
A[Start Onboarding] --> B{Interactive Guide}
B --> C[Complete Step 1]
C --> D[Complete Step 2]
D --> E[Finish Onboarding]
Diagram

Prioritization & trade-offs: Use the RICE framework. Interactive tutorials have a high reach and impact with moderate effort, making them a priority.

MVP, measurement & rollout: Develop a basic interactive tutorial for the top three features. Measure success by tracking completion rates and user feedback. Roll out to a small user group before full deployment.

Product & growthMediumTogether AIProduct Manager

11. How would you improve Together AI's notification system to increase user engagement?

Model answer

Clarify & scope: The goal is to enhance Together AI's notification system to boost user engagement. Assume current notifications are generic and not effectively driving user actions.

User segments & pain points: Focus on active users who regularly interact with the platform. Pain points include receiving irrelevant notifications or being overwhelmed by notification volume.

Goals & success metrics: The North Star metric is increased user interaction with notifications. Guardrails include user satisfaction and notification opt-out rates.

Solutions:

  1. Personalized Notifications: Tailor notifications based on user preferences and behavior.
  2. Smart Scheduling: Send notifications at optimal times based on user activity patterns.
  3. Actionable Content: Include clear calls to action in notifications to drive engagement.

Recommendation: Implement personalized notifications as they directly address relevance and engagement.

graph TD;
A[User Preferences] --> B[Personalized Notification]
B --> C[User Engagement]
Diagram

Prioritization & trade-offs: Personalized notifications have a high impact on engagement with moderate effort, making them a priority.

MVP, measurement & rollout: Develop a basic personalization algorithm. Measure success through engagement rates and user feedback. Roll out to a small user group to test effectiveness.

Product & growthMediumTogether AIProduct Manager

12. Which metric would you choose to measure the success of a new feature in Together AI, and why?

Model answer

Clarify & scope: The goal is to identify a metric that effectively measures the success of a new feature in Together AI. Assume the feature is designed to enhance user engagement.

Define metric(s): Consider metrics like feature adoption rate, engagement time, and user satisfaction.

Break down:

funnel
  title Feature Success Funnel
  subgraph A[User Engagement]
    direction TB
    A1[Feature Discovery] --> A2[Feature Use]
    A2 --> A3[Repeat Use]
    A3 --> A4[User Satisfaction]
  end
Diagram

Ranked hypotheses:

  1. High feature adoption rate indicates initial interest.
  2. Increased engagement time suggests ongoing use.
  3. Positive user feedback reflects satisfaction and success.

How to investigate: Use analytics to track feature usage, conduct surveys for user feedback, and analyze engagement data over time.

Decision & guardrails: Choose feature adoption rate as the primary metric since it directly indicates interest and potential for sustained engagement. Monitor engagement time and user satisfaction as secondary metrics to ensure comprehensive success measurement.

System designEasyTogether AI

13. Design a simple chat application that allows users to send and receive messages in real-time.

The full question

Design a simple chat application that allows users to send and receive messages in real-time. What components would you include?

Model answer

1. Requirements & scale

Functional Requirements:

  • Users can send and receive messages in real-time.
  • Support for one-on-one and group chats.
  • Messages should be stored for future retrieval.
  • Messages need to be encrypted for security.

Non-Functional Requirements:

  • Low latency to ensure real-time communication.
  • High availability and reliability.
  • Scalability to handle a growing number of users.

Estimates:

  • Assume 1 million active users, each sending an average of 10 messages per day.
  • Peak load: 100 messages per second (QPS).
  • Average message size: 1 KB.
  • Daily storage requirement: 10 million messages * 1 KB = 10 GB.
  • Monthly storage: 300 GB.

2. High-level architecture

flowchart TD
    subgraph Client
        A[User Device]
    end

    subgraph "Edge/CDN"
        B[WebSocket Gateway]
    end

    subgraph "Load Balancer"
        C[Load Balancer]
    end

    subgraph "API / Services"
        D[Chat Service]
        E[Notification Service]
    end

    subgraph "Cache"
        F[Redis]
    end

    subgraph "Datastores"
        G["SQL DB (Users, Chats)"]
        H["NoSQL DB (Messages)"]
    end

    subgraph "Message Queue"
        I[Message Queue]
    end

    subgraph "Workers"
        J[Message Processor]
    end

    A -->|WebSocket| B
    B -->|Forward| C
    C -->|Distribute| D
    D -->|Store Message| H
    D -->|Update Cache| F
    D -->|Queue Notification| I
    I -->|Process| J
    J -->|Send Notification| E
    E -->|Push Notification| A
    G -->|User Data| D
    F -->|Cached Messages| D
Diagram

3. API design

  • POST /messages: Send a message.
  • GET /messages/{chat_id}: Retrieve messages for a chat.
  • GET /users/{user_id}/chats: Retrieve chat list for a user.
  • POST /notifications: Send a notification to a user.

4. Data model & storage

Datastores:

  • SQL Database: For structured data like user profiles and chat metadata.
  • Users Table: user_id (PK), username, email.
  • Chats Table: chat_id (PK), user_id, type (one-on-one/group).
  • NoSQL Database: For unstructured message data to handle high write throughput.
  • Messages Collection: message_id, chat_id, sender_id, content, timestamp.

Partitioning:

  • Messages: Partition by chat_id to distribute load across multiple nodes.

5. Deep dive

The core of a real-time chat application is the use of WebSockets for bi-directional communication, allowing messages to be sent and received instantly.

sequenceDiagram
    participant User1
    participant WebSocketGateway
    participant ChatService
    participant NoSQLDB
    participant User2

    User1->>WebSocketGateway: Send Message
    WebSocketGateway->>ChatService: Forward Message
    ChatService->>NoSQLDB: Store Message
    ChatService->>WebSocketGateway: Acknowledge
    WebSocketGateway->>User1: Delivery Confirmation
    WebSocketGateway->>User2: Deliver Message
Diagram

6. Scale, bottlenecks & trade-offs

Scaling:

  • WebSocket Gateway: Horizontally scale to handle more concurrent connections.
  • Databases: Use sharding for the NoSQL database to distribute message storage and retrieval load.

Bottlenecks:

  • WebSocket Connections: Can become a bottleneck if not properly load-balanced.
  • Message Queue: Ensure it can handle peak loads without delay.

Trade-offs:

  • Consistency vs. Availability: Prioritize availability (AP in CAP theorem) to ensure messages are delivered even during partial failures.
  • Latency vs. Security: Encrypting messages may introduce latency, but it's essential for security.
  • Push vs. Pull: Use push notifications to ensure users receive messages promptly, even when not actively using the app.

This design ensures a scalable, reliable, and secure chat application capable of handling real-time communication efficiently.

System designMediumTogether AIAI Engineer

14. Design a post-training service where the customer writes the training loop (sample, reward, forward/backward, optimiser step, weight sync) and you…

The full question

Design a post-training service where the customer writes the training loop (sample, reward, forward/backward, optimiser step, weight sync) and you run the trainer and rollout generators on their dedicated GPUs. What primitives do you expose, how do weight sync and async RL work, and how do you isolate customers?

Model answer

This is the shape of Together Post-Training: one RL step is sample(), the customer's own reward function, forward_backward(), optim_step() and weights_sync(). The design question is where to draw the line between what the customer controls and what the platform must own.

Primitives. Keep them few and stateful on the server side. A session owns a trainer (sharded model and optimiser state) and a set of generator instances (an inference engine with the current policy). sample(prompts, params) returns completions plus the token IDs and logprobs the generator actually used. forward_backward(batch, loss) computes gradients for a named loss: cross-entropy for SFT, GRPO-family or DPO-style objectives for preference and RL work. optim_step() applies them. weights_sync() pushes new weights to the generators and returns a version number. The reward function runs in customer code, so the platform never needs to understand their task. Add save()/load() checkpoints and per-call metrics. A thin, familiar API matters commercially too: a one-line migration from an existing client library such as Tinker lowers switching cost.

Weight sync. Full weights for a 30B model are about 60 GB in BF16. Send them trainer to generators over NVLink or RDMA, in shards and in parallel, and swap atomically per generator so no request sees half-old weights. LoRA runs can sync only the adapter, which is orders of magnitude cheaper.

Async RL. Synchronous RL leaves generators idle during training and the trainer idle during sampling. Async overlaps them: generators keep sampling with policy version N while the trainer computes N+1. The cost is staleness, so tag every sample with its policy version, bound the lag (for example at most one or two versions), and let the loss use the stored generator logprobs for importance correction. Watch train-inference mismatch as well: different kernels or numerics, and for MoE different expert routing, between generator and trainer. Replaying the generator's routing decisions in the trainer (Together uses Rollout Routing Replay) reduces that drift.

Isolation. Dedicated GPU allocations per customer remove noisy-neighbour compute and memory effects, and each session gets its own trainer and generator processes. Customer reward code runs in a sandbox with no route to the control plane or other tenants' storage. Weights, checkpoints and logs sit in per-tenant encrypted storage. Quotas cap sample throughput and storage, and a failing or runaway customer loop is killed at the session boundary without touching anyone else.

Trade-offs to name: exposing raw forward_backward gives researchers flexibility but lets customers write unstable losses, so ship good defaults, gradient-norm and KL telemetry, and early warnings for reward hacking (reward rising while held-out evals fall).

Follow-ups: What breaks if a customer's reward function takes 30 s per sample? How would you checkpoint and resume an async run without losing the in-flight rollouts? How would you price this: per GPU-hour or per token processed?

System designMediumTogether AIAI Engineer

15. Design the scheduler for a continuous-batching inference engine.

Model answer

Key insight: schedule per iteration, not per request. After every model step, completed sequences exit and queued ones join - no waiting for the whole batch to finish (that's static batching, which strands GPU time on the longest request).

Core loop:

def step(self):
    # 1. Free blocks from finished/cancelled sequences
    self.release_finished()
    # 2. Admit new requests while KV blocks + batch budget allow
    while self.queue and self.can_admit(self.queue[0]):
        self.running.append(self.queue.popleft())
    # 3. If out of blocks, preempt lowest-priority running seqs
    while not self.enough_blocks_for_decode():
        self.preempt(self.running.pop_victim())  # recompute or swap
    # 4. Build one batch mixing prefill chunks + decode tokens
    return self.build_batch(self.running)

Design decisions to defend:

  • Prefill/decode interference: a 4K-token prefill in a decode batch spikes inter-token latency for everyone. Chunked prefill splits it into pieces co-scheduled with decodes, trading TTFT for stable ITL. (Disaggregated prefill on separate GPUs is the heavier-weight answer.)
  • Preemption policy: recompute (drop blocks, re-prefill later) is simple and usually wins for short contexts; swapping to CPU wins for long contexts where recompute costs more than PCIe transfer.
  • Admission control: admit on worst-case KV growth (max_new_tokens), or admit optimistically and rely on preemption - vLLM chose optimism.
  • Fairness/SLOs: FCFS starves interactive traffic behind batch jobs; priority queues with per-tenant token budgets are the standard fix.

Follow-ups: How does speculative decoding complicate this loop (variable tokens accepted per step)? What metrics would you expose to detect scheduler pathologies - and what would a rising preemption rate tell you?

System designMediumTogether AIAI Engineer

16. Design a serverless inference platform serving 100+ open models on a shared GPU fleet.

Model answer

Clarify targets first: say TTFT p99 < 2 s for warm models, cost-efficient enough to price per-token, models from 1B to 700B (MoE), spiky per-model demand.

Fleet tiering by popularity. Traffic across 100+ models is extremely skewed. Hot tier: top models pinned on dedicated replica pools with autoscaling. Warm tier: mid-tail models resident but sharing capacity. Cold tier: long-tail models scale-to-zero, loaded on demand. The economics of the tail decide margins - this framing is what interviewers want to hear first.

Cold starts. A 70B FP8 model is ~70 GB of weights. From object storage at even 10 GB/s that's 7+ s before CUDA graph capture and warmup. Mitigations: weights cached on local NVMe on every node in the model's placement group, streamed/parallel loading, keep-warm based on demand prediction, and honest queuing (accept + queue during load rather than error).

Placement is bin-packing on GPU memory: weights + KV budget per model, with tensor-parallel degree as a variable (TP=8 for big models raises throughput but couples failure domains). Small models can be co-resident on one GPU with MPS/MIG or in-engine multiplexing.

Fine-tunes as LoRA multiplexing: thousands of customer fine-tunes must not each cost a GPU. Serve adapters on shared base-model replicas (S-LoRA-style: adapters paged in GPU memory, batched heterogeneously); route by adapter ID.

Routing/autoscaling: route on queue depth and KV utilization, not CPU; scale on token throughput and TTFT SLO burn. Per-tenant rate limits in the gateway; dedicated-endpoint traffic isolated from serverless.

Follow-ups: A new 400B MoE model launches and traffic 100×s in an hour - walk through what happens. How do you run engine upgrades (new vLLM/kernel version) across the fleet without SLO breakage?

TechnicalEasyTogether AI

17. What is the difference between a list and a tuple in Python?

Model answer

Difference between List and Tuple in Python

  1. Mutability: - List: Lists are mutable, meaning you can change, add, or remove elements after the list has been created. - Tuple: Tuples are immutable, which means once a tuple is created, you cannot modify its elements. This immutability makes tuples more suitable for use as keys in dictionaries.
  2. Syntax: - List: Lists are defined using square brackets []. ``python my_list = [1, 2, 3] ` - Tuple: Tuples are defined using parentheses (). `python my_tuple = (1, 2, 3) ``
  3. Performance: - List: Due to their mutable nature, lists have a slightly higher overhead. They are slower than tuples when it comes to iteration. - Tuple: Tuples are generally faster than lists because of their immutability, which allows Python to optimize their storage.
  4. Use Cases: - List: Use lists when you need a collection of items that can change over time, such as a list of user inputs or a collection of items that need to be sorted or modified. - Tuple: Use tuples when you need a fixed collection of items, such as coordinates, or when you want to ensure the data remains constant throughout the program.
  5. Functions: - List: Lists have more built-in functions and methods, such as append(), remove(), and sort(), which allow for extensive manipulation. - Tuple: Tuples have fewer methods, primarily because they are immutable. They support methods like count() and index().
  6. Memory Usage: - List: Lists consume more memory due to their dynamic nature. - Tuple: Tuples are more memory efficient than lists, which can be beneficial when working with large datasets.

In summary, choose lists when you need a dynamic, modifiable sequence of elements, and opt for tuples when you need a fixed, immutable collection. This choice impacts both performance and memory usage, with tuples being the more efficient option in scenarios where immutability is acceptable.

TechnicalMediumTogether AIAI Engineer

18. Serve a DeepSeek-V3-class open MoE model (671B total parameters, ~37B active per token) on Blackwell.

The full question

Serve a DeepSeek-V3-class open MoE model (671B total parameters, ~37B active per token) on Blackwell. How do you lay it out, and why does expert parallelism change the economics?

Model answer

Separate memory from compute. Every expert must be resident, so FP8 weights alone are ~671 GB: one 8×B200 node (~180 GB each, ~1.4 TB total) holds them with room for KV cache, 8×H100 does not. Per-token compute is set by the ~37B active parameters, so decode FLOPs look like a mid-size dense model while memory looks like a giant one.

The trap is arithmetic intensity per expert. Each token picks 8 of 256 routed experts per layer, so with a global batch of B tokens each expert sees roughly B/32. At batch 64, every expert's weights are read to serve about two tokens: pure bandwidth-bound decode. Reaching the ~150-300 tokens per weight read the roofline wants means thousands of concurrent tokens per step. Hence wide expert parallelism: spread experts across many GPUs, aggregate a very large batch, and move tokens to experts rather than weights to tokens.

Communication becomes the bottleneck. Each MoE layer does an all-to-all dispatch and an all-to-all combine. A rack-scale NVLink domain (GB200 NVL72 puts 72 GPUs on one fabric) keeps that off InfiniBand, and libraries such as DeepEP plus two-micro-batch overlap hide it behind compute.

Decisions to defend:

  • Attention parallelism. MLA's latent KV cache is small, but tensor-parallel attention replicates it on every rank, so data-parallel attention with expert-parallel FFNs is the usual pairing.
  • Load balance. Routing is skewed and shifts with traffic, and a hot expert stalls the whole step. Replicate hot experts and re-place them from observed routing statistics.
  • Disaggregation. Prefill and decode want different parallelism, so run separate pools and ship KV between them over RDMA.

The economics: wide EP pays off only with large aggregate traffic, which suits a shared serverless pool. A low-traffic dedicated endpoint is better on one 8-GPU node with tensor plus expert parallelism, accepting lower utilisation.

Worth sketching. One decode step, showing that the expensive hop is moving tokens between GPUs, not loading weights.

flowchart LR
    A["Request router"] --> B["Prefill pool"]
    B -->|"KV transfer (RDMA)"| C["Decode pool<br/>DP attention"]
    C --> D["Gate: top-8 of 256 experts"]
    D -->|"all-to-all dispatch"| E["Expert GPUs<br/>(EP across the rack)"]
    E -->|"all-to-all combine"| F["Next layer or<br/>sample token"]
    F --> C
Diagram

Follow-ups: A large coding customer onboards and the routing histogram shifts sharply - what happens to p99 inter-token latency, and how do you respond? How does the layout change for a ~1T-parameter model with 384 experts?

TechnicalMediumTogether AI

19. What are the differences between REST and GraphQL?

Model answer

  1. Data Fetching and Flexibility
  • REST: Uses fixed endpoints to return predefined data structures. Each endpoint corresponds to a resource, and clients may receive more data than needed, leading to over-fetching.
  • GraphQL: Allows clients to specify exactly what data they need in a single query, reducing over-fetching. Clients can request multiple resources in a single query, which can reduce the number of requests needed.
  1. Versioning
  • REST: Typically requires versioning of APIs when changes are made, such as adding or removing fields. This can lead to multiple versions of an API being maintained simultaneously.
  • GraphQL: Avoids versioning by allowing clients to request only the fields they need. New fields can be added without affecting existing queries.
  1. Structure and Complexity
  • REST: Follows a resource-based structure, where each endpoint corresponds to a specific resource. This can lead to a more straightforward design but might require multiple endpoints for complex queries.
  • GraphQL: Uses a single endpoint to handle all queries, which can simplify the client-server interaction but may introduce complexity in query construction and server-side schema management.
  1. Error Handling
  • REST: Relies on HTTP status codes to indicate success or failure, which can be straightforward but limited in expressing complex error scenarios.
  • GraphQL: Returns errors in the response body, allowing for more detailed error messages and partial success responses, where some data may be returned alongside error information.
  1. Tooling and Ecosystem
  • REST: Has a mature ecosystem with widespread support and tools for API development, testing, and documentation.
  • GraphQL: Offers powerful tools like GraphiQL for exploring and testing queries, but the ecosystem is still evolving compared to REST.
  1. Caching
  • REST: Leverages HTTP caching mechanisms like ETags and Last-Modified headers, which are well-understood and widely used.
  • GraphQL: Caching can be more challenging due to the flexible nature of queries, but tools like Apollo Client offer caching solutions tailored for GraphQL.

Complexity:

  • REST: Simpler for straightforward CRUD operations but can become cumbersome for complex data retrieval.
  • GraphQL: Offers flexibility and efficiency in data retrieval but requires more sophisticated server-side setup and query management.
TechnicalMediumTogether AI

20. How do you ensure the security of an API?

Model answer

To ensure the security of an API, several strategies and best practices should be implemented. These measures help protect against unauthorized access, data breaches, and other security threats. Here are the key steps to secure an API:

  1. Use an API Gateway: - Implement an API Gateway as a single entry point for all API requests. This centralizes security concerns such as authentication, rate limiting, and SSL termination. - The API Gateway can handle cross-cutting concerns, reducing the need for each service to implement these independently, thus simplifying the architecture and improving security.
  2. Authentication and Authorization: - Use robust authentication mechanisms such as OAuth 2.0 or JWT (JSON Web Tokens) to verify the identity of users and services. - Implement role-based access control (RBAC) to ensure users have access only to the resources they are authorized to use.
  3. Rate Limiting: - Implement rate limiting to prevent abuse and denial-of-service (DoS) attacks. This can be done by restricting the number of requests a user can make in a given time frame. - Use HTTP 429 status codes to inform clients when they exceed their rate limits, along with helpful headers indicating when they can retry.
  4. Data Encryption: - Use TLS (Transport Layer Security) to encrypt data in transit, ensuring that sensitive information is not intercepted by unauthorized parties. - Consider encrypting sensitive data at rest, depending on the data's sensitivity and regulatory requirements.
  5. Input Validation and Sanitization: - Validate and sanitize all inputs to prevent injection attacks such as SQL injection or cross-site scripting (XSS). - Use parameterized queries and prepared statements to interact with databases securely.
  6. Logging and Monitoring: - Implement comprehensive logging to track API usage and detect suspicious activities. - Use monitoring tools to analyze logs and set up alerts for unusual patterns that may indicate a security breach.
  7. Security Testing: - Regularly perform security testing, including penetration testing and vulnerability scanning, to identify and address potential security weaknesses. - Keep the API and its dependencies up to date with the latest security patches.
  8. Design for Failure: - Ensure the API Gateway is highly available to prevent it from becoming a single point of failure. - Implement failover mechanisms and redundancy to maintain service continuity in case of component failures.

By following these practices, you can significantly enhance the security of your API, protecting it from common threats and ensuring reliable service for users.

Practice these out loud, don't memorise them

Reading an answer is not the same as being able to give one under pressure. ChannelPulse plays the interviewer, asks the follow-ups, and scores each answer with feedback and a model answer so you can hear the gap between what you said and what lands.

Get ChannelPulse Browse all questions