Техническое собеседование для Амазон:



Есть 2 таблицы А и Б, нужно сказать сколько строк выведется при соединении.

TableA

id1

1

1



TableB

id2

1

1

1

1

NULL





Please provide the count of rows for each join for Table A and Table B:

Left join:

Right join:

inner join:

full join:





Задание 2:

Department table (id, name)

D1 Finance Dept

D2 HR Dept

D3 AR Dept

F1 AP Dept



Employee table (id, name, deptNo, sex, hireDate, Salary,effectiveDate)

E1, sample1, D1,M,01/01/2000, 5000, 01/01/2000

E1, sample1, D1,M,01/01/2000, 6000, 01/01/2001

E1, sample1, D2,M,01/01/2000, 6000, 01/02/2001

E2, sample1, D2,M,01/01/2000, 6000, 01/02/2001

E3, sample1, D1,M,01/01/2000, 5000, 01/01/2000

E3, sample1, D1,M,01/01/2000, 6000, 01/01/2001

E4, sample1, F1,M,01/01/2000, 5000, 01/01/2000

E4, sample1, D1,M,01/01/2000, 6000, 01/01/2001

E4, sample1, D3,M,01/01/2000, 8000, 01/02/2001

E5, sample1, D3,F,01/01/2001, 8000, 01/02/2001

E6, sample1, D3,F,01/01/2001, 9000, 01/02/2001



1.Write a query to display latest salary of each employee



2. Write a query to display department name where employees count in the department is

more than 2



Задание 3 (code):

Given two strings, output the words that are unique to each string.

Example:

String 1: The quick brown fox jumped over the lazy fox

String 2: The slow blue whale swam over the quick shark



Output: slow, brown, blue, fox, whale, jumped, swam, lazy, shark





Задание 4 (моделирование):

Employee Seat Assignment

Daily some employees in the organization transfer from one manager to another manager.

This transfer leads to new seat assignment at his new work location.



Can you do a data model to maintain the history of work location changes? (нужно прикинуть какой подход для моделирования использовать, какие колонки будут в таблице, как отображать историю)



@machinelearning_interview