Backend Developer Interview Questions

15,450 backend developer interview questions shared by candidates

/* * Your previous Plain Text content is preserved below: * * # Step 1 Throughout this interview, we'll pretend we're building a new * analytical database. Don't worry about actually building a database though – * these will all be toy problems. * * Here's how the database works: all records are represented as maps, with * string keys and integer values. The records are contained in an array, in no * particular order. * * To begin with, the database will support just one function: min_by_key. This * function scans the array of records and returns the record that has the * minimum value for a specified key. Records that do not contain the specified * key are considered to have value 0 for the key. Note that keys may map to * negative values! * * Here's an example use case: each of your records contains data about a school * student. You can use min_by_key to answer questions such as "who is the * youngest student?" and "who is the student with the lowest grade-point * average?" * * Implementation notes: You should handle an empty array of records in an * idiomatic way in your language of choice. If several records share the same * minimum value for the chosen key, you may return any of them. * * ### Java function signature: ``` public static Map<String, Integer> * minByKey(String key, List<Map<String, Integer>> records); ``` * * ### Examples (in Python): ``` assert min_by_key("a", [{"a": 1, "b": 2}, {"a": * 2}]) == {"a": 1, "b": 2} assert min_by_key("a", [{"a": 2}, {"a": 1, "b": 2}]) * == {"a": 1, "b": 2} assert min_by_key("b", [{"a": 1, "b": 2}, {"a": 2}]) == * {"a": 2} assert min_by_key("a", [{}]) == {} assert min_by_key("b", [{"a": * -1}, {"b": -1}]) == {"b": -1} ``` */
avatar

Backend/API Engineer

Interviewed at Stripe

3.7
May 8, 2019

/* * Your previous Plain Text content is preserved below: * * # Step 1 Throughout this interview, we'll pretend we're building a new * analytical database. Don't worry about actually building a database though – * these will all be toy problems. * * Here's how the database works: all records are represented as maps, with * string keys and integer values. The records are contained in an array, in no * particular order. * * To begin with, the database will support just one function: min_by_key. This * function scans the array of records and returns the record that has the * minimum value for a specified key. Records that do not contain the specified * key are considered to have value 0 for the key. Note that keys may map to * negative values! * * Here's an example use case: each of your records contains data about a school * student. You can use min_by_key to answer questions such as "who is the * youngest student?" and "who is the student with the lowest grade-point * average?" * * Implementation notes: You should handle an empty array of records in an * idiomatic way in your language of choice. If several records share the same * minimum value for the chosen key, you may return any of them. * * ### Java function signature: ``` public static Map<String, Integer> * minByKey(String key, List<Map<String, Integer>> records); ``` * * ### Examples (in Python): ``` assert min_by_key("a", [{"a": 1, "b": 2}, {"a": * 2}]) == {"a": 1, "b": 2} assert min_by_key("a", [{"a": 2}, {"a": 1, "b": 2}]) * == {"a": 1, "b": 2} assert min_by_key("b", [{"a": 1, "b": 2}, {"a": 2}]) == * {"a": 2} assert min_by_key("a", [{}]) == {} assert min_by_key("b", [{"a": * -1}, {"b": -1}]) == {"b": -1} ``` */

Given an array with n integers, check if it could become non-decreasing by removing at most 1 element. Example: Input: [3,2,4,3], Output: false Input:[1, 4, 2, 3], Output: true Input:[4, 3, 2], Output: false Input:[1, 2, 3], Output: true
avatar

Software Engineer, Backend

Interviewed at Zalando

3.6
Jan 9, 2019

Given an array with n integers, check if it could become non-decreasing by removing at most 1 element. Example: Input: [3,2,4,3], Output: false Input:[1, 4, 2, 3], Output: true Input:[4, 3, 2], Output: false Input:[1, 2, 3], Output: true

Viewing 21 - 30 interview questions

Glassdoor has 15,450 interview questions and reports from Backend developer interviews. Prepare for your interview. Get hired. Love your job.