Backend Developer Interview Questions

9,181 backend developer interview questions shared by candidates

Phase 4b (Problem Solving) ii. Given an array of integers, find the longest subarray where the absolute difference between any two elements is less than or equal to 1. Example There are two subarrays meeting the criterion: and . The maximum length subarray has elements. Function Description Complete the pickingNumbers function in the editor below. pickingNumbers has the following parameter(s): int a[n]: an array of integers Returns int: the length of the longest subarray that meets the criterion Input Format A = [1,1,2,2,4,4,5,5,5] The first line contains a single integer , the size of the array . The second line contains space-separated integers, each an . Ans: [4,4,5,5,5] Constraints 2<=n<=100 0< a[i]<100 The answer will be >=2 6 4 6 5 3 3 1 Answer: 3 {4,3,3} 6 1 2 2 3 1 2 Answer: 5 {1,2,2,1,2}

Backend Software Engineer

Interviewed at Pathao

3.7
Sep 13, 2021

Phase 4b (Problem Solving) ii. Given an array of integers, find the longest subarray where the absolute difference between any two elements is less than or equal to 1. Example There are two subarrays meeting the criterion: and . The maximum length subarray has elements. Function Description Complete the pickingNumbers function in the editor below. pickingNumbers has the following parameter(s): int a[n]: an array of integers Returns int: the length of the longest subarray that meets the criterion Input Format A = [1,1,2,2,4,4,5,5,5] The first line contains a single integer , the size of the array . The second line contains space-separated integers, each an . Ans: [4,4,5,5,5] Constraints 2<=n<=100 0< a[i]<100 The answer will be >=2 6 4 6 5 3 3 1 Answer: 3 {4,3,3} 6 1 2 2 3 1 2 Answer: 5 {1,2,2,1,2}

Viewing 611 - 620 interview questions

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