Apple Interview Questions
- 0of 0 votes
Answersgiven 3 tables:
- crackerfive August 08, 2019 in United States
table_1 has factory, material, date, quantity fields indicating what factory to can produce deliver which material by the specific date.
table_2 has company, material, date, quantity fields indicating what company wants to have some amount of material by the specific date.
table_3 has company, factory, material fields indicating what material a company can buy from which factory.
Write a sql to output a table with company, factory, material, quantity, date fields, for each row, it is the real amount that a factory can deliver to a company
on that date, the quantity might be zero.
If there are more demand than production, a factory takes earlier order or the biggest amount order if both orders have the same demanding date.
sample input
table_1
factory material quantity date
f1 a 100 2010-10-10
f1 b 200 2010-10-10
f1 a 500 2011-11-11
f2 a 300 2010-10-10
table_2
company material quantity date
c1 a 100 2010-10-12
c2 b 200 2010-10-10
c1 a 500 2011-11-11
c3 a 300 2010-10-10
table 3
company factory material
c1 f1 a
c1 f2 a
c2 f1 b
c3 f2 a| Report Duplicate | Flag | PURGE
Apple SQL - 0of 0 votes
AnswersDesign bookshelf class model to perform checkout of book operation
- kay March 16, 2018 in United States| Report Duplicate | Flag | PURGE
Apple Staff Engineer - 0of 0 votes
AnswersTell me how to test whether the high-order bit is set in a byte?
- kay March 16, 2018 in United States| Report Duplicate | Flag | PURGE
Apple Staff Engineer - 0of 0 votes
AnswerWhen would you use a linked list vs. arraylist?
- kay March 16, 2018 in United States| Report Duplicate | Flag | PURGE
Apple Staff Engineer - 0of 0 votes
AnswersSuppose under this directory /web there are 50,000 - html files
- kay March 16, 2018 in United States
List all the files which has phone numbers with below pattern
(xxx)-xxx-xxxx
xxx-xxx-xxxx| Report Duplicate | Flag | PURGE
Apple Staff Engineer - 1of 1 vote
AnswersPrint out the grade-school multiplication table up to 12x12
multiplication output:1 2 3 4 5 6 7 8 9 10 11 12 2 4 6 8 10 12 14 16 18 20 22 24 3 6 9 12 15 18 21 24 27 30 33 36 4 8 12 16 20 24 28 32 36 40 44 48 5 10 15 20 25 30 35 40 45 50 55 60 6 12 18 24 30 36 42 48 54 60 66 72 7 14 21 28 35 42 49 56 63 70 77 84 8 16 24 32 40 48 56 64 72 80 88 96 9 18 27 36 45 54 63 72 81 90 99 108 10 20 30 40 50 60 70 80 90 100 110 120 11 22 33 44 55 66 77 88 99 110 121 132 12 24 36 48 60 72 84 96 108 120 132 144
*/
- kay March 16, 2018 in United States| Report Duplicate | Flag | PURGE
Apple Staff Engineer - 0of 0 votes
AnswersWrite a program to read a string with first_name, last_name, age and sort it based on any of the input column name
- kay March 16, 2018 in United States
sample string
john doe 33
smith black 9
diana yale 12
assume the string to be single giant string| Report Duplicate | Flag | PURGE
Apple Staff Engineer - 0of 0 votes
Answers"Implement a job scheduler which takes in a function `f` and an integer `n`, and calls `f` after `n` milliseconds."
- lkjhgfdsa December 10, 2017 in United States
That's it. :)| Report Duplicate | Flag | PURGE
Apple Software Developer - 0of 0 votes
AnswersExplain event driven programming in C with example
- anaghakr89 August 09, 2017 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer - 2of 2 votes
AnswersApple Map Team
- aonecoding July 25, 2017 in United States
1. Given an array A and some queries, query(i, j) returns the result of Ai*...*Aj, in other words the multiplication from Ai to Aj.
The numbers in A are non-negative.
Implement query(i, j).
2. Flatten nested linked list
3. POI search design
4. LC238 & LC279| Report Duplicate | Flag | PURGE
Apple Software Engineer Algorithm - 3of 3 votes
AnswersApple phone interview
- aonecoding July 23, 2017 in United States
Given an API to find all IPv4 addresses in a log file, find all IPs that occurred only once.
Follow-up: What if the log comes from a data stream.
Follow-up: If the machine has 4GB RAM, is there going to be a problem?| Report Duplicate | Flag | PURGE
Apple Backend Developer Algorithm - 0of 0 votes
AnswersAn ABC notation in a tree is defined as folllows:
- npkatre104 June 16, 2017 in United States
1. "0" means travel left
2. "1" means travel right
3. "Undefined" means hit the root
4. "Not Found" means not present in tree
Given a BST insertion order, {5,2,8,3,6,9,1} find the ABC notation for 6, 1, 10, 2 which is "10","00","NotFound", "0"| Report Duplicate | Flag | PURGE
Apple Software Engineer - 2of 2 votes
AnswersApple On-site at Cupertino
- aonecoding May 10, 2017 in United States
Team Data Warehousing
Questions on Hadoop, Hive and Spark
I. Given a table with 1B of user ID and product IDs that the users bought, and another table with product ID mapped with product name. We are trying to find the paired products that are often purchased together by the same user, such as wine and bottle opener, chips and beer … How to find the top 100 of these co-existed pairs of products. If going with hadoop, where is the bottleneck and how to optimize?
II. Someone put distribute Random()*ID in a Hive script to prevent data skew. What would be the problem here?| Report Duplicate | Flag | PURGE
Apple SDE-3 design - 1of 1 vote
AnswersApple On-site at Cupertino
- aonecoding May 10, 2017 in United States
Team Data Warehousing
III. Given three letters ABC, where AB->C, AC->B, BC->A (sequence doesn’t matter). Get the length of the path to convert from a given string to a single character.
For example, “ABACB” goes to “ACCB” (based on AB ->C, convert s[1] and s[2] to C)
“ACCB” goes to “BCB” (based on AC->B)
“BCB” goes to “AB”
“AB” goes to “C”
So it takes 4 steps to change the given string into a single character.
If a given string cannot be resized to 1 character, such as “AAA” or "ABACABB", return -1.| Report Duplicate | Flag | PURGE
Apple SDE-3 Algorithm - 1of 1 vote
AnswersApple On-site at Cupertino
- aonecoding May 10, 2017 in United States
Team Data Warehousing
There were 6.5 rounds in total, that 0.5 on package negotiation with the HR and the remaining rounds with 2 managers and 4 engineers.
Only three pure coding questions were asked.
I. Use a stack to sort given data.
II. Given an array with positive integers only, find the MIN integer that is missing from the array.| Report Duplicate | Flag | PURGE
Apple SDE-3 Algorithm - -8of 8 votes
Answerswefa
- datbtgbh15262@fpt.edu.vn April 16, 2017 in United States for sdfef| Report Duplicate | Flag | PURGE
Apple Accountant - 0of 0 votes
AnswersWe are speaking about a web page of Todo tasks.
- noam.nta May 06, 2015 in United States
I want the option to add task, edit task or delete task, and mark task as completed (or vice versa).
I also want the ability to filter the tasks by completion status (pending, completed, all).
Please accomplish one of the requirement using directive.
You should write this code in Java Angular| Report Duplicate | Flag | PURGE
Apple Jr. Software Engineer - 2of 2 votes
AnswersWrite code to sum 2 integer but u cant use a+b method, you have to use either ++ or --. How you will handle negative numbers.
- newbee October 10, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer in Test Algorithm - 1of 1 vote
AnswersHow can we divide a large file between multi threads to process it? If we are running a multi threaded application and input is a large file and we have to provide each thread a part of the file to make it fast. How we can achieve it in java?
- newbee September 14, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Java - 0of 0 votes
AnswersThere is a test automation running and fails 14%, say 1/7 times? How you will debug? There is no code change or test code change.
- newbee September 11, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer in Test test - 1of 1 vote
AnswersThere are several words in a file. Get the occurrence of every word and sort it based on the occurrence, if more than one word is having same occurrence than sort it alphabetically.
- newbee September 11, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer in Test Algorithm - 1of 1 vote
AnswersWe have one single linked list. How we’ll travers it that we reach till second last (n-1) node. If we want to reach till (n\2) node.
- newbee September 11, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer in Test Algorithm - 0of 0 votes
AnswersIn a directory we have several big log files? How u’ll find it how many number of lines are there in file? Aggregated count for all the files. What is if multiple threads are using those files? How will u be assigning files to them? What if one file size is way bigger than others.
- newbee September 11, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer in Test Algorithm - 0of 0 votes
AnswersHow can we get square of a number without using * or carrot sign.
- newbee August 30, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWrite a query which return 5 persons who had spent most from a table and table contains customer id, product id and expenses. Customer id can be duplicate.
- newbee August 30, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer SQL - 0of 0 votes
AnswersThere is 3 text file, like file1.txt, file2.txt etc. Every file contains customer id, product id and expenses. Now write java code which will return 5 persons who spent most in these three files. Customer id can be duplicate all over files.
- newbee August 30, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Algorithm - 0of 0 votes
AnswersHow can we get the square of a number without using * or carrot sign.
- newbee August 30, 2014 in United States| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Algorithm - 2of 2 votes
AnswersDesign a parking lot system where you need to provide a token with the parking space number on it to each new entry for the space closest to the entrance.
- duskan February 13, 2014 in United States for Sales
When someone leave you need update this space as empty.
What data structures will you use to perform the closest empty space tracking, plus finding what all spaces are occupied at a give time.| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Algorithm - 0of 0 votes
AnswersFind median from a stream of flowing numbers
- duskan February 13, 2014 in United States for Sales| Report Duplicate | Flag | PURGE
Apple Software Engineer / Developer Algorithm - 0of 0 votes
Answersgiven 2 arrays wrds[] , chars[] as an input to a function such that
- goldy_ssb February 06, 2014 in United States
wrds[] = [ "abc" , "baa" , "caan" , "an" , "banc" ]
chars[] = [ "a" , "a" , "n" , "c" , "b"]
Function should return the longest word from words[] which can be constructed from the chars in chars[] array.
for above example - "caan" , "banc" should be returned
Note: Once a character in chars[] array is used, it cant be used again.
eg: words[] = [ "aat" ]
characters[] = [ "a" , "t" ]
then word "aat" can't be constructed, since we've only 1 "a" in chars[].| Report Duplicate | Flag | PURGE
Apple Software Engineer in Test