Apple OA | IS&T | SWE | Hyd

apple logo
apple
SWEHyderabad5.5 years
May 21, 20254 reads

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)

Q1
Follow Path in 2D Grid and Extract Letters
Data Structures & AlgorithmsMedium

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.

Q2
Two Suitcase Knapsack Problem
Data Structures & AlgorithmsHard

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=17 Answer: 19
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!