DataDog | SDE-2 | New York | Rejected
Anonymous User
4664

I interviewed at Datadog for SDE-2 equivalent position. Went through Phone sreen then full loop.
I applied online/LinkedIn, got response from a recruiter 2 weeks after.

  • YOE: 2.5
  • Education: BS in CS from a state university.
  • Previous Company: Startup

Phone Screen (Technical Video Interview)
Exactly same questions as the below.

https://leetcode.com/discuss/interview-question/4930299/Datadog-Senior-Engineer-Phone-Screen

Question 1: Bucket Partition

Given an array of latencies, numBuckets, buketWidth
We want to know the number of latencies belongs to each bucket. Create numBuckets number of bucket of length bucketWidth starting 0.
Any latencies higher than the last bucket goes into the last bucket.
Return an array ans of size numBuckets where ans[i] is the number of latencies in ith bucket.

Example:
Input:
latencies: [6, 7, 50, 100, 110]
numBuckets: 8
bucketWidth: 10
OUtput:
[2, 0, 0, 0, 0, 1, 0, 2]
Explanation:

  • The range of the 1st bucket is [0, 9], and there are 2 latencies in that range (6,7).
  • [10, 19] -> 0
  • [20, 29] -> 0
  • [30, 39] -> 0
  • [40, 49] -> 0
  • [50, 59] -> 1
  • [60, 69] -> 0,
  • [70, ...] -> 2

Code:

void bucketSort(vector<int> &latencies, int numBucket, int bucketWidth) {
    vector<int> ans (numBucket.size(), 0);
    for (int latency : latencies) {
        int bucketId = min(numBucket - 1, latency / bucketWidth);
        ans[bucketId]++;
    }
    return ans;
}

Question 2: Total Directory Size

Given a filesystem in tree structure, return total size of the in file_system.

struct Node {
    string name;
    int size;
    vector<Node *> children;
};

Code:

int total_size(Node *root) {
    if (root->children.size() == 0) {
        return root->size;
    }
    int cur_size = 0;
    for (Node *child : children) {
        cur_size += total_size(child);
    }
    return cur_size;
}

Follow up:
Given a path string, parse it and calculate the total_size.


Virtual Onsite Interviews

There were 2 Coding rounds, 1 System Deisgn round, and 1 Behavior round.

Coding 1: rm -rf

Got the same question as https://leetcode.com/discuss/interview-question/4159607/Datadog-or-Onsite-or-Rm-rf.

Given a API for file system

  • Delete(path) -> bool: deletes the file or empty directory, returns false if deletion was not successful.
  • isDirectory(path) -> bool: checks whether filepath is directory or not.
  • GetAllFiles(path) -> List<string>: gets the absolute paths of all files in a directory, including other sub-directories.

implement rm -rf.

Follow up: prevents out of memory (OOM) error.

Approaches:

  • Created a simple recursive DFS approach.
  • 1st improvement: deleted all files before call sub-directory recursively
  • 2nd improvement: Instead of pushing the copy of the path into input, just update the path with relative file name.
  • 3rd improvement: Implemented non-recursively and when the stack gets too large, save them to disk.

The intviewer weren't too satisfied with my approaches.
He was expecting some generator (yield) way to do it, but I wasn't sure how that exactly works.

Coding 2: Query Log Match

Got the same question as the 2nd question in here https://leetcode.com/discuss/interview-question/5136121/Datadog-or-Onsite-or-2024.

Given stream/array of Query and Logs, output messages as following:

  • For query, output an acknowledgement with unique query id: ex) "ACK: database; ID=1".
  • For log, output comma-separated matched query ids: ex) M: Database service started: Q=1".

Here are more detailed example:

livetail_stream = [
  "Q: database",
  "Q: Stacktrace",
  "Q: loading failed",
  "L: Database service started",
  "Q: snapshot loading",
  "Q: fail",
  "L: Started processing events",
  "L: Loading main DB snapshot",
  "L: Loading snapshot failed no stacktrace available",
]

livetail_output = [
  "ACK: database; ID=1",
  "ACK: Stacktrace; ID=2",
  "ACK: loading failed; ID=3",
  "M: Database service started; Q=1",
  "ACK: snapshot loading; ID=4",
  "ACK: fail; ID=5",
  "M: Loading main DB snapshot; Q=4",
  "M: Loading snapshot failed no stacktrace available; Q=2,3,4",
]

Created hash map from word to array of query ids. For each log, I maintained counter to see which query got fully matched.

System Design:

Design a system like mint .com.

Follow ups:

  • Handing network failure. Handling DB failure/scailing.
  • What alert would you have on this system?

Behavior
Typical behavior questions like conflict with customers, feedback with team members.


Verdict: Got rejected.

Feedback: I passed both coding interviews. My high level design for system design was decent, but did not have enough knowledge to talk about detailed designs. Feedback from behavior (experience & value) was also bad due to my lack of experience with team members.

I wasn't able to get down-leveled because Datadog only hire SDE-1 position internally (people who did intern at Datadog).

Comments (7)