Amazon | Phone interview | SQL Query
Anonymous User
8081

I had the phone interview with a senior BIE today in which I was asked below sql question-

Write a SQL query to calculate total time spent by each employee on each day at office-
CREATE TABLE Employee
(
[empid] int,
[Time] DATETIME,
[In_Out] VARCHAR(3)
);
INSERT Employee
VALUES
(1, '2019-01-01 09:00:00', 'In'),
(2, '2019-01-01 12:00:00', 'Out'),
(1, '2019-01-01 13:00:00', 'In'),
(2, '2019-01-01 17:00:00', 'Out'),
(2, '2019-01-02 23:00:00', 'In'),
(3, '2019-01-03 07:00:00', 'Out');

Below is the interview process of BIE (which may differ slightly in some cases) -

  1. Phone interview - 1 hour --> 10 mins Intro + 15 mins LP + 25 mins for SQL Live coding exercise + 10 mins for your questions (Sometimes 25 mins of coding session could contain Python coding exercise also, but it will be an easy program)
  2. Phone interview - 1 hour --> Just LP
  3. Panel round (4 interviews) --> 2 Technical with BIEs, Data engineers + 1 LP with Hiring manager + 1 with Data Scientist
Comments (14)