Apple Software Engineer Interview Questions

Review this list of 89 Apple software engineer interview questions and answers verified by hiring managers and candidates.
  • Apple logoAsked at Apple 
    +1

    "def calc(expr): ans = eval(expr) return ans your code goes debug your code below print(calc("1 + 1")) `"

    Sarvesh G. - "def calc(expr): ans = eval(expr) return ans your code goes debug your code below print(calc("1 + 1")) `"See full answer

    Software Engineer
    Data Structures & Algorithms
    +3 more
  • Apple logoAsked at Apple 

    "I was a student worker at Gordon's Food Service, Schaumburg, My tasks were vacuuming onion peels, checking expiration dates, cleaning the break room, cleaning the shelves from the Ailes, Stocking stuff on shelves, sweeping the backroom, mopping, Refilling bottles with cleaning supplies and cleaning the fridge glass."

    Amparo L. - "I was a student worker at Gordon's Food Service, Schaumburg, My tasks were vacuuming onion peels, checking expiration dates, cleaning the break room, cleaning the shelves from the Ailes, Stocking stuff on shelves, sweeping the backroom, mopping, Refilling bottles with cleaning supplies and cleaning the fridge glass."See full answer

    Software Engineer
    Behavioral
  • Apple logoAsked at Apple 

    "It is very easy to shy away and not make a decision because you might feel the right information is not there to make a decision While dealing with ambiguity it is essential to remain Calm. And Establish what it is you want to achieve by asking a lot of questions to the necessary stakeholders Access the risk, analyze the data at hand, ask the right questions, and be very clear and concise in decision-making"

    Satish murthy D. - "It is very easy to shy away and not make a decision because you might feel the right information is not there to make a decision While dealing with ambiguity it is essential to remain Calm. And Establish what it is you want to achieve by asking a lot of questions to the necessary stakeholders Access the risk, analyze the data at hand, ask the right questions, and be very clear and concise in decision-making"See full answer

    Software Engineer
    Behavioral
    +1 more
  • Apple logoAsked at Apple 
    +4

    "public static void sortBinaryArray(int[] array) { int len = array.length; int[] res = new int[len]; int r=len-1; for (int value : array) { if(value==1){ res[r]= 1; r--; } } System.out.println(Arrays.toString(res)); } `"

    Nitin P. - "public static void sortBinaryArray(int[] array) { int len = array.length; int[] res = new int[len]; int r=len-1; for (int value : array) { if(value==1){ res[r]= 1; r--; } } System.out.println(Arrays.toString(res)); } `"See full answer

    Software Engineer
    Data Structures & Algorithms
    +1 more
  • Apple logoAsked at Apple 
    Software Engineer
    Data Structures & Algorithms
    +4 more
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

  • Apple logoAsked at Apple 
    Video answer for 'Merge k sorted linked lists.'
    +7

    "A much better solution than the one in the article, below: It looks like the ones writing articles here in Javascript do not understand the time/space complexity of javascript methods. shift, splice, sort, etc... In the solution article you have a shift and a sort being done inside a while, that is, the multiplication of Ns. My solution, below, iterates through the list once and then sorts it, separately. It´s O(N+Log(N)) class ListNode { constructor(val = 0, next = null) { th"

    Guilherme F. - "A much better solution than the one in the article, below: It looks like the ones writing articles here in Javascript do not understand the time/space complexity of javascript methods. shift, splice, sort, etc... In the solution article you have a shift and a sort being done inside a while, that is, the multiplication of Ns. My solution, below, iterates through the list once and then sorts it, separately. It´s O(N+Log(N)) class ListNode { constructor(val = 0, next = null) { th"See full answer

    Software Engineer
    Data Structures & Algorithms
    +4 more
  • Apple logoAsked at Apple 

    "SQL databases are relational, NoSQL databases are non-relational. SQL databases use structured query language and have a predefined schema. NoSQL databases have dynamic schemas for unstructured data. SQL databases are vertically scalable, while NoSQL databases are horizontally scalable."

    Ali H. - "SQL databases are relational, NoSQL databases are non-relational. SQL databases use structured query language and have a predefined schema. NoSQL databases have dynamic schemas for unstructured data. SQL databases are vertically scalable, while NoSQL databases are horizontally scalable."See full answer

    Software Engineer
    Concept
    +7 more
  • Apple logoAsked at Apple 

    "Code reviews, automated linting, unit tests, integration tests, validation tests"

    Anonymous Jaguar - "Code reviews, automated linting, unit tests, integration tests, validation tests"See full answer

    Software Engineer
    Behavioral
  • Apple logoAsked at Apple 
    Software Engineer
    Data Structures & Algorithms
    +4 more
  • Software Engineer
    Data Structures & Algorithms
  • Apple logoAsked at Apple 
    +19

    " O(n) time, O(1) space from typing import List def maxsubarraysum(nums: List[int]) -> int: if len(nums) == 0: return 0 maxsum = currsum = nums[0] for i in range(1, len(nums)): currsum = max(currsum + nums[i], nums[i]) maxsum = max(currsum, max_sum) return max_sum debug your code below print(maxsubarraysum([-1, 2, -3, 4])) `"

    Rick E. - " O(n) time, O(1) space from typing import List def maxsubarraysum(nums: List[int]) -> int: if len(nums) == 0: return 0 maxsum = currsum = nums[0] for i in range(1, len(nums)): currsum = max(currsum + nums[i], nums[i]) maxsum = max(currsum, max_sum) return max_sum debug your code below print(maxsubarraysum([-1, 2, -3, 4])) `"See full answer

    Software Engineer
    Data Structures & Algorithms
    +4 more
  • Apple logoAsked at Apple 
    +2

    "This could be done using two-pointer approach assuming array is sorted: left and right pointers. We need track two sums (left and right) as we move pointers. For moving pointers we will move left to right by 1 (increment) when right sum is greater. We will move right pointer to left by 1 (decrement) when left sum is greater. at some point we will either get the sum same and that's when we exit from the loop. 0-left will be one array and right-(n-1) will be another array. We are not going to mo"

    Bhaskar B. - "This could be done using two-pointer approach assuming array is sorted: left and right pointers. We need track two sums (left and right) as we move pointers. For moving pointers we will move left to right by 1 (increment) when right sum is greater. We will move right pointer to left by 1 (decrement) when left sum is greater. at some point we will either get the sum same and that's when we exit from the loop. 0-left will be one array and right-(n-1) will be another array. We are not going to mo"See full answer

    Software Engineer
    Data Structures & Algorithms
    +2 more
  • Apple logoAsked at Apple 

    "I was able to provide the optimal approach and coded it up"

    Anonymous Wasp - "I was able to provide the optimal approach and coded it up"See full answer

    Software Engineer
    Data Structures & Algorithms
    +2 more
  • Apple logoAsked at Apple 

    "A red-black tree is a self-balancing binary search tree. The motivation for this is that the benefits of O(logN) search, insertion, and deletion that a binary tree provides us will disappear if we let the tree get too "imbalanced" (e.g. there are too many nodes on one side of the tree or some branches have a depth that is way out of proportion to the average branch depth). This imbalance will occur if we don't adjust the tree after inserting or deleting nodes, hence our need for self-balancing c"

    Alex M. - "A red-black tree is a self-balancing binary search tree. The motivation for this is that the benefits of O(logN) search, insertion, and deletion that a binary tree provides us will disappear if we let the tree get too "imbalanced" (e.g. there are too many nodes on one side of the tree or some branches have a depth that is way out of proportion to the average branch depth). This imbalance will occur if we don't adjust the tree after inserting or deleting nodes, hence our need for self-balancing c"See full answer

    Software Engineer
    Data Structures & Algorithms
    +1 more
  • Apple logoAsked at Apple 

    "Law is my passion. Traveling all over the world in 5 years"

    Moshe S. - "Law is my passion. Traveling all over the world in 5 years"See full answer

    Software Engineer
    Behavioral
    +4 more
  • Apple logoAsked at Apple 

    "public class HashMap { public class Element { T key; V value; Element(T k, V v) { this.key = k; this.value = v; } } private static final int DEFAULT_CAPACITY = 16; private static final float LOAD_FACTOR = 0.75f; private LinkedList[] table = new LinkedList[DEFAULT_CAPACITY]; private int size = 0; private int threshold = (int) (DEFAULTCAPACITY * LOADFACTOR); public void put(T k"

    Md kamrul H. - "public class HashMap { public class Element { T key; V value; Element(T k, V v) { this.key = k; this.value = v; } } private static final int DEFAULT_CAPACITY = 16; private static final float LOAD_FACTOR = 0.75f; private LinkedList[] table = new LinkedList[DEFAULT_CAPACITY]; private int size = 0; private int threshold = (int) (DEFAULTCAPACITY * LOADFACTOR); public void put(T k"See full answer

    Software Engineer
    Data Structures & Algorithms
    +2 more
  • Apple logoAsked at Apple 
    Software Engineer
    System Design
  • Software Engineer
    Concept
    +1 more
  • Apple logoAsked at Apple 
    Video answer for 'Solve John Conway's "Game of Life".'
    Software Engineer
    Data Structures & Algorithms
    +2 more
  • Apple logoAsked at Apple 

    "class TrieNode { constructor() { this.children = {}; this.isEndOfWord = false; } } class Trie { constructor() { this.root = new TrieNode(); } insert(word) { let node = this.root; for (const char of word) { if (!node.children[char]) { node.children[char] = new TrieNode(); } node = node.children[char]; } node.isEndOfWord = true; } search(word) { l"

    Tiago R. - "class TrieNode { constructor() { this.children = {}; this.isEndOfWord = false; } } class Trie { constructor() { this.root = new TrieNode(); } insert(word) { let node = this.root; for (const char of word) { if (!node.children[char]) { node.children[char] = new TrieNode(); } node = node.children[char]; } node.isEndOfWord = true; } search(word) { l"See full answer

    Software Engineer
    Data Structures & Algorithms
    +3 more
Showing 41-60 of 89