Apple OA | IS&T | SWE | Hyd
Summary
I applied directly to Apple's careers website for an SWE role in IS&T in Hyderabad and received a Coderpad Online Assessment. The OA consisted of two Java-based data structures and algorithms questions, with a 70-minute time limit, and I have provided my solutions below.
Full Experience
YOE: 5.5 College: Tier-3 Currently SSE @ Walmart Applied directly at Apple's careers website.
Coderpad Link was shared which had 2 questions (Java based) with 70 min time limit.
Interview Questions (2)
You're given a list of strings representing a 2D grid. The first character of the first string is the upper left side of coordinates(0,0). The grid always has the same size: Width = 15 (each string contains 15 characters) Height = 10 (10 strings in the list)
The grid contains a unique path, made of stars(*) and of lowercase letters. The path always starts at the coordinates(0,0) and does not contain any forks or loops. It moves in the four directions (up,down,right,left) but not diagonally. You must follow the path and record the letters in the order as you encounter them (do not record the stars). At the end of the path, output the string made with the letters. The path may immediately start with a letter and may end with a letter too. The path has a minimum length of two characters and contains at least one letter.
Finding the maximum combined weight of items that can be packed into two suitcases with given weight limits (w1 and w2)—you need to implement a variation of the 0/1 Knapsack problem, but with two knapsacks (suitcases).
Implement a method maxWeight(weights, w1, w2) which takes as input
- an array of positive integers weights representing the weights of the items.
- two integers w1 and w2 representing the maximum weight that can be put in suitcase 1 and suitcase 2 respectively.
e.g
weights=[10,8,3,8] w1=5, w2=17Answer: 19