[2023-10-10]Interview Experience for Mapbox Full Stack Position VO Round

The final part of this post was edited by anonymous at 12:21 on October 9, 2023.

A recruiter from a startup working on map technology reached out to me on LinkedIn.

During the phone screening, I had a conversation with the hiring manager, and promptly received an invitation for a virtual onsite interview.

The format of the virtual onsite was originally planned to consist of one round of system design (SD), one round of coding, and two rounds of behavioral questions (BQ). However, for some reason, I ended up coding during the SD round as well.

The role I was being interviewed for was a Full Stack position, and I was expected to write code in JavaScript.

The first coding question presented was titled “Group Anagrams”.

/*
Group Anagrams

Given an array of strings, write a function which would group the anagrams together.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase,
typically using all the original letters exactly once.
*/

const strs = ["tap","pat","set","tes","fall","lafl", "kit"];
// Output: [["tap","pat"],["set","tes"],["fall","lafl"], ["kit"]]
let dict = {};
for (let i = 0; i < strs.length; i++) {
const key = strs[i].split("").sort().join("");
if (dict[key] == undefined) {
dict[key] = [];
}
dict[key].push(strs[i]);
}
let out = Object.values(dict);
console.log(out);

The second coding question I faced was “Search Ranking”.

/*
Search Ranking

Given an array of customer search queries and a dataset of address objects,
write an algorithm that selects the best matching address object ID for each search string.

OUTPUT:
Array of arrays where n[0] is the query and n[1] is the 'id' of the selected address object
e.g.: [['123 Main Street, Boston, Massachusetts 02115', 3], [...], [...], [...]]
*/


const queries = [
'123 Main Street, Boston, Massachusetts 02115',
'25015 main street, boston, massachusetts 02160',
'123 Main Street, Medford, Massachusetts 02155',
'123 main street, massanutten, virginia 22840'
];

const data = [
{ 'id': 1, 'house_number': '12', 'street': 'Main Street', 'city': 'Boston', 'state': 'Massachusetts', 'postcode': '02115' },
{ 'id': 2, 'house_number': '1', 'street': 'Plain Street', 'city': 'Medford', 'state': 'Massachusetts', 'postcode': '02155' },
{ 'id': 3, 'house_number': '123', 'street': 'Main Street', 'city': 'Boston', 'state': 'Massachusetts', 'postcode': '02115' },
{ 'id': 4, 'house_number': '123', 'street': 'Boston Street', 'city': 'Medford', 'state': 'Massachusetts', 'postcode': '02155' },
{ 'id': 5, 'house_number': '1233', 'street': 'Boston Street', 'city': 'Main Village', 'state': 'Massachusetts', 'postcode': '02151' },
{ 'id': 6, 'house_number': '22840', 'street': 'Virginia Avenue', 'city': 'Boston', 'state': 'Massachusetts', 'postcode': '02155' },
{ 'id': 7, 'house_number': '25015', 'street': 'Main Street', 'city': 'Boston', 'state': 'West Virginia', 'postcode': '25015' },
{ 'id': 8, 'house_number': '2160', 'street': 'Main Street', 'city': 'Salem', 'state': 'Virginia', 'postcode': '24153' }
];

// 123 Main Street, Boston, Massachusetts 02115 -> {house_number: 123, street: Main Street, ...}

The second round was relatively open-ended. I was tasked with discussing the solution with the interviewer. In the end, the task primarily dealt with string processing, without the application of any particular algorithms.

The interview process was straightforward and easy, and I received an offer shortly after. However, as my main goal was practice, I ultimately chose not to accept.

If you found this post useful, please give it an upvote!

The above content is collected through the Internet, translated and processed by GPT.