Apple Interview Questions

Review this list of 125 Apple interview questions and answers verified by hiring managers and candidates.
  • Apple logoAsked at Apple 
    Video answer for 'Product of Array Except Self'
    +38

    "If 0's aren't a concern, couldn't we just multiply all numbers. and then divide product by each number in the list ? if there's more than one zero, then we just return an array of 0s if there's one zero, then we just replace 0 with product and rest 0s. what am i missing?"

    Sachin R. - "If 0's aren't a concern, couldn't we just multiply all numbers. and then divide product by each number in the list ? if there's more than one zero, then we just return an array of 0s if there's one zero, then we just replace 0 with product and rest 0s. what am i missing?"See full answer

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

    "Situation - A time when I worked well on a team was while I was working with the larger team at Blade to do the redesign before their IPO. Essentially, we had a month to launch a redesign (both visual and UX) of the entire project Task - I was tasked to direct all design efforts and strategy for the mobile and web experience on blade - being a lead in the trifecta group. Action - Through effective teamwork, we all led strategy and championed our areas of product, design and engineering. As a"

    Ben G. - "Situation - A time when I worked well on a team was while I was working with the larger team at Blade to do the redesign before their IPO. Essentially, we had a month to launch a redesign (both visual and UX) of the entire project Task - I was tasked to direct all design efforts and strategy for the mobile and web experience on blade - being a lead in the trifecta group. Action - Through effective teamwork, we all led strategy and championed our areas of product, design and engineering. As a"See full answer

    Product Designer
    Product Design
    +1 more
  • Apple logoAsked at Apple 
    +7

    "function findPrimes(n) { if (n < 2) return []; const primes = []; for (let i=2; i <= n; i++) { const half = Math.floor(i/2); let isPrime = true; for (let prime of primes) { if (i % prime === 0) { isPrime = false; break; } } if (isPrime) { primes.push(i); } } return primes; } `"

    Tiago R. - "function findPrimes(n) { if (n < 2) return []; const primes = []; for (let i=2; i <= n; i++) { const half = Math.floor(i/2); let isPrime = true; for (let prime of primes) { if (i % prime === 0) { isPrime = false; break; } } if (isPrime) { primes.push(i); } } return primes; } `"See full answer

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

    "const ops = { '+': (a, b) => a+b, '-': (a, b) => a-b, '/': (a, b) => a/b, '': (a, b) => ab, }; function calc(expr) { // Search for + or - for (let i=expr.length-1; i >= 0; i--) { const char = expr.charAt(i); if (['+', '-'].includes(char)) { return opschar), calc(expr.slice(i+1))); } } // Search for / or * for (let i=expr.length-1; i >= 0; i--) { const char = expr.charAt(i); if"

    Tiago R. - "const ops = { '+': (a, b) => a+b, '-': (a, b) => a-b, '/': (a, b) => a/b, '': (a, b) => ab, }; function calc(expr) { // Search for + or - for (let i=expr.length-1; i >= 0; i--) { const char = expr.charAt(i); if (['+', '-'].includes(char)) { return opschar), calc(expr.slice(i+1))); } } // Search for / or * for (let i=expr.length-1; i >= 0; i--) { const char = expr.charAt(i); if"See full answer

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

    "class ListNode: def init(self, val=0, next=None): self.val = val self.next = next def has_cycle(head: ListNode) -> bool: slow, fast = head, head while fast and fast.next: slow = slow.next fast = fast.next.next if slow == fast: return True return False debug your code below node1 = ListNode(1) node2 = ListNode(2) node3 = ListNode(3) node4 = ListNode(4) creates a linked list with a cycle: 1 -> 2 -> 3 -> 4"

    Anonymous Roadrunner - "class ListNode: def init(self, val=0, next=None): self.val = val self.next = next def has_cycle(head: ListNode) -> bool: slow, fast = head, head while fast and fast.next: slow = slow.next fast = fast.next.next if slow == fast: return True return False debug your code below node1 = ListNode(1) node2 = ListNode(2) node3 = ListNode(3) node4 = ListNode(4) creates a linked list with a cycle: 1 -> 2 -> 3 -> 4"See full answer

    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 'Given stock prices for the next n days, how can you maximize your profit by buying or selling one share per day?'
    +9

    "from typing import List def maxprofitgreedy(stock_prices: List[int]) -> int: l=0 # buying r=1 # selling max_profit=0 while rstock_prices[l]: profit=stockprices[r]-stockprices[l] maxprofit=max(maxprofit,profit) else: l=r r+=1 return max_profit debug your code below print(maxprofitgreedy([7, 1, 5, 3, 6, 4])) `"

    Prajwal M. - "from typing import List def maxprofitgreedy(stock_prices: List[int]) -> int: l=0 # buying r=1 # selling max_profit=0 while rstock_prices[l]: profit=stockprices[r]-stockprices[l] maxprofit=max(maxprofit,profit) else: l=r r+=1 return max_profit debug your code below print(maxprofitgreedy([7, 1, 5, 3, 6, 4])) `"See full answer

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

    "from typing import List def two_sum(nums: List[int], target: int) -> List[int]: prevMap = {} for i, n in enumerate(nums): diff = target - n if diff in prevMap: return [prevMap[diff], i] else: prevMap[n] = i return [] debug your code below print(two_sum([2, 7, 11, 15], 9)) `"

    Anonymous Roadrunner - "from typing import List def two_sum(nums: List[int], target: int) -> List[int]: prevMap = {} for i, n in enumerate(nums): diff = target - n if diff in prevMap: return [prevMap[diff], i] else: prevMap[n] = i return [] debug your code below print(two_sum([2, 7, 11, 15], 9)) `"See full answer

    Software Engineer
    Data Structures & Algorithms
    +5 more
  • "Lyft mission. What do we mean by engagement here? We want higher rides , not just time spent on app. What does social mean? When we create interactions between riders. Lyft line is social. Ideas: Idea: Can we maintain interactions between riders by letting them ride with same people again? Benefit: Increases repeat rides. Idea: Giving riders an option to request a driver they rode with. Benefits: Increases social interaction between riders and drivers. Increases retention and # rides as"

    M N. - "Lyft mission. What do we mean by engagement here? We want higher rides , not just time spent on app. What does social mean? When we create interactions between riders. Lyft line is social. Ideas: Idea: Can we maintain interactions between riders by letting them ride with same people again? Benefit: Increases repeat rides. Idea: Giving riders an option to request a driver they rode with. Benefits: Increases social interaction between riders and drivers. Increases retention and # rides as"See full answer

    Product Design
    System Design
  • Apple logoAsked at Apple 
    Data Engineer
    Data Structures & Algorithms
    +4 more
  • Apple logoAsked at Apple 

    "This is an interesting Favorite Product question. Normally when we're asked this question we pick technology products, but this time the interviewer wanted to throw us a curveball by asking about a non-technical product. Don't worry - it still follows the same approach: Choose a product and briefly explain what it is Who are the users? What are their pain points? How did competitors solve it in the past? **How does this product address these pain points differe"

    Exponent - "This is an interesting Favorite Product question. Normally when we're asked this question we pick technology products, but this time the interviewer wanted to throw us a curveball by asking about a non-technical product. Don't worry - it still follows the same approach: Choose a product and briefly explain what it is Who are the users? What are their pain points? How did competitors solve it in the past? **How does this product address these pain points differe"See full answer

    Product Manager
    Product Design
  • Apple logoAsked at Apple 

    "i am a fresher"

    Akash A. - "i am a fresher"See full answer

    Software Engineer
    Behavioral
  • 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 

    "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

    Product Manager
    Behavioral
  • 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 

    "Hey Grandma, you've had a lot of experience with infants, haven't you? When they were babies, you taught them how to chew in their first six months. This initial phase is like giving them data. Once they learned how to chew, they could handle any food you gave them. Next, you refined their learning by teaching them that they should only chew on food. This is like refining the data so they understand what is relevant. Then, a few months later, they started crawling and walking, learning by observ"

    Hari priya K. - "Hey Grandma, you've had a lot of experience with infants, haven't you? When they were babies, you taught them how to chew in their first six months. This initial phase is like giving them data. Once they learned how to chew, they could handle any food you gave them. Next, you refined their learning by teaching them that they should only chew on food. This is like refining the data so they understand what is relevant. Then, a few months later, they started crawling and walking, learning by observ"See full answer

    Machine Learning Engineer
    Concept
  • Apple logoAsked at Apple 

    "we can create 2 sets for rows and columns and store the rows and column having 0 and then just check in a loop if the count of that row is greater than 0 llly for column then put the row and column to zero"

    Bhavya V. - "we can create 2 sets for rows and columns and store the rows and column having 0 and then just check in a loop if the count of that row is greater than 0 llly for column then put the row and column to zero"See full answer

    Data Engineer
    Data Structures & Algorithms
    +2 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 
    Video answer for 'Merge k sorted linked lists.'
    +6

    "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
  • "Adoption- The number of successful calls by users per day or week. Engagement- Average time duration of the FaceTime call."

    Medha A. - "Adoption- The number of successful calls by users per day or week. Engagement- Average time duration of the FaceTime call."See full answer

    Product Manager
  • Apple logoAsked at Apple 
    Software Engineer
    Data Structures & Algorithms
    +4 more
Showing 41-60 of 125