Apple Interview Questions

Review this list of 125 Apple interview questions and answers verified by hiring managers and candidates.
  • Apple logoAsked at Apple 

    "import java.util.Arrays; import java.util.stream.Collectors; class Main { // Recursive function to print all combinations of numbers from \i\ to \n\ // having sum \n. The index\ denotes the next free slot in the output array \out\ public static void printCombinations(int i, int n, int[] out, int index) { // if the sum becomes n, print the combination if (n == 0) { System.out.println(Arrays.stream(out).limit(index) .boxed().collect(Collectors.toList())); } // start from the previous e"

    Relynn may silver B. - "import java.util.Arrays; import java.util.stream.Collectors; class Main { // Recursive function to print all combinations of numbers from \i\ to \n\ // having sum \n. The index\ denotes the next free slot in the output array \out\ public static void printCombinations(int i, int n, int[] out, int index) { // if the sum becomes n, print the combination if (n == 0) { System.out.println(Arrays.stream(out).limit(index) .boxed().collect(Collectors.toList())); } // start from the previous e"See full answer

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

    "The height of a binary tree is the maximum number of edges from the root node to any leaf node. To calculate the height of a binary tree, we can use a recursive approach. The basic idea is to compare the heights of the left and right subtrees of the root node, and return the maximum of them plus one."

    Prashant Y. - "The height of a binary tree is the maximum number of edges from the root node to any leaf node. To calculate the height of a binary tree, we can use a recursive approach. The basic idea is to compare the heights of the left and right subtrees of the root node, and return the maximum of them plus one."See full answer

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

Showing 121-125 of 125