# Apple’s interview questions database | by Anjali Viramgama | Jun, 2021 | Medium Here is a list of 42 questions asked by Apple in their interviews with solutions/a link to their solution. I got the questions from Glassdoor. I prepared this database before my own interview and since I found them useful, I thought I’d publish it as a quick resource. Try to solve or at least skim through all of these starting 2 weeks before your scheduled interview, and you’ll be good to go. For more information about the internship interview, read more here.

Better optimization of hardware and software

Simple and clean interface

Less Malware

2. Unix vs Linux — Read here

3. What do you think of Siri? What improvement can you suggest for Siri?

4. What’s your career plan in the next coming 5 years?

5. What happens when you click on a URL? Solution

1. Given an array of integers and a value, determine if there are any three integers in the array whose sum equals the given value.

After asking about edge case handling, the solution should be similar to ThreeSum.

2. Given a sorted array, return the sorted array of their squares — Read discuss section of leetcode here.

3. Determine whether a string is a palindrome. Solution

4. Implement a Queue With Two Stacks. Solution

5. Revert an integer bitwise. Solution1 or Solution2

6. Design a HashSet. Solution

7. Design HashMap. Solution

8. Given a list of strings, provide the number of strings that are unique within the list.

Solution- Throw everything in a hashset and then build a list out of it.

``ArrayList<String> answer = new ArrayList<>(new HashSet<String>(givenList));``

9. Find depth of a binary tree. Solution

10. Write a function that counts the number of times a given int occurs in a Linked List. Solution

1. Implement an iterator that supports the peek operation on a list in addition to the hasNext and the next operation: Solution

2. Copy a graph. Solution

3. Reverse a linked list. Solution

4. Word search, Given a grid of characters board and a string word, returns true if the word exists in the grid. Solution

5. Given a function magicNumber() that returns a random integer 1 or 0, write a new function that will generate a random number that uses this magicNumber() function.

Solution — Ask for the range of the number (example up to 100) and then generate a bit for that many digits using magicNumber() function.

6. Perform matrix multiplication given 2 matrices. Solution

7. Design a data structure that can be used for Least Recently Used (LRU) cache. Solution

8. Check completeness of a binary tree. Solution

9. Find Least common ancestor in a binary tree. Solution

10. Integrate interval ranges. Solution

11. Implement Merge Sort. Solution

12. Exchange the odd and even bits of an integer. Solution

13. Maximum subarray sum. Solution

14. Topological sorting. Solution

15. Merge overlapping intervals. Solution

16. Count number of ways to reach nth stair in a staircase. Solution

1. Given a board of characters and a list of strings words, return all the words on the board. Solution
2. Given three strings and return true if the third string is the interleaving of the other two. Solution

3. Design a data structure for a Least Frequently Used (LFU) cache. Solution

4. Select a random node from LinkedList. Solution

6. Find median from a stream. Solution

7. Write a code to add two linked lists that contained a digit each to represent huge numbers. Solution

8. Design file management system. Solution

9. Write a program that uses two threads to print the numbers from 1 to n. Solution

10. Print the different ways to open and close brackets with x opens. For 3, this would be : {{{}}}, {}{}{}, {{}{}} {{}}{}, {}{{}}. Solution.

11. Sort an array of 10M unique ints faster than merge/quick sort. Solution: Since we know the range, use radix sort.

That’s all, I’ll add more as I find them. I hope this was helpful. Thanks for reading, feel free to dm me if you have any questions!

Anjali Viramgama

Articles that might interest you: