Licious SDE2 PSDS round

licious logo
licious
SDE II
October 3, 202319 reads

Summary

I recently completed an interview for an SDE2 position at Licious, where I was tested on two challenging Data Structures and Algorithms problems focusing on optimization and subarray properties.

Full Experience

My interview experience for the SDE2 role at Licious included a dedicated PSDS (Problem Solving and Data Structures) round. During this round, I was presented with two distinct algorithmic challenges. The first problem required me to determine the minimum number of days needed for multiple buses to complete a given total number of trips. The second problem involved finding the longest subarray within a given array where the absolute difference between any two elements did not exceed a specified value k. Both problems were quite thought-provoking and tested my problem-solving skills.

Interview Questions (2)

Q1
Minimum Days for All Buses to Complete Trips
Data Structures & Algorithms

You have n buses operating out of a city. You’ll be given an array “times” which denotes the number of days needed for the bus to complete the trip. You’ll also be given “totalTrips” which is the number of trips all the buses have to complete. You’ll need to return the minimum number of days needed for all the buses to complete totalTrips together.

Example 1 times = [1,2,3], totalTrips = 5 minimum no of days required - 3 Example 2 times = [2], totalTrips = 2 minimum no of days required - 4

Q2
Longest Subarray with Absolute Difference <= K
Data Structures & Algorithms

Given an array A of n numbers and you’ll also be given a positive integer k. You need to find the longest subarray such that the absolute difference of any two elements in the subarray is <= k.

Ex input : A = [8,2,4,3,7], k = 3

Ex output : 2

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!