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.
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:
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:
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:
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:
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).