DevOps/SRE Coding Interview Question

Published: 26 February 2025
on channel: Mamun Rashid
812
5

Today, I'm here with a real coding interview question. One of my mentees had an interview recently and received a question very similar to this. I’ve made a few modifications, but essentially 95% of what's needed to complete the coding assignment is here. This should give you a decent idea of what a coding interview for a DevOps role might look like.

Nowadays, even for a DevOps role, employers are asking you to perform real software coding tasks, such as algorithms. In this scenario, the candidate was given the choice of Python or another language and chose Go. Let's understand the problem first.

You are given a dataset, a 10 by 2 array or slice. The first column contains first names, and the second column contains a free-form string with multiple words. For example, it includes the type of player (catcher, bowler, etc.), the team they are on, and their payment status (high pay, low pay, or free agent). The order of these descriptors can vary. Your task is to write a function that returns the first names matching specified criteria.

Here's how you might call the function:

getNames(data, "batter")
getNames(data, "batter", "Dodgers")
getNames(data, "batter", "Dodgers", "low pay")

The number of strings can vary from 0 to 3.

The function takes in a dataset and a variadic number of strings to match. It loops through each row of the dataset and each string to match. If a row contains all the specified strings, it adds the first name to the result.

To test this function, you can use a provided dataset and call the function with different criteria to see the results. This example shows how flexible and robust the function is, even when given unexpected or misspelled input.

I hope you find this useful. This problem came from an interview for a senior SRE role. It took me an hour to solve this with some help, so it wasn't easy. Thank you for watching, and I'll see you in the next video.


On this page of the site you can watch the video online DevOps/SRE Coding Interview Question with a duration of hours minute second in good quality, which was uploaded by the user Mamun Rashid 26 February 2025, share the link with friends and acquaintances, this video has already been watched 812 times on youtube and it was liked by 5 viewers. Enjoy your viewing!