Interview Questions I faced

This contains all the interview questions I was asked

Italic question -> means asked more than once

Bold question -> means I got stuck upon

Point Click Care

Software Engineer position

  • F-2-F round with Manager, Barkat Virani - 8 March 2021

  1. Tell a bit about what you do

  2. Since you said Devops, let me ask about how you manage authentication for different groups or categories

  3. What are some of the challenges you / your team faced while working in a team or a project

  4. How do you manage configuration in your apps, meaning if same app is going into different enivornments then how do you manage database and other configs for the same

  5. Let's suppose you're using a chat application, then if we both are chatting and I type a message first which will invoke the backend service, how does it know to send my message to you without you refreshing the page?

  6. How do you split the front-end app into multiple applications as we have that requirement.

  7. What APIs you have worked on?

  • Technical Rounds on March 15

  1. Tell me about yourself

  2. == vs === // (2 times asked)

  3. CSS Specificity

  4. Java try catch finally

  5. SQL Query involving join and groupby, having

  6. Dom input get value by name

  7. How import statement is wriiten in ES5 react (I think this is a wrong question he asked)

  8. ES6 features naming a few

  9. Get first occuring unique element from an array. [1,1,2,3,4,3]. What is the time complexity? // 2 is unique. I struggeled a bit to get the unique element as my logic was not quite right initially.Time complexity is o(n) which I answered correctly

  10. What is wrong with this? [ {name:''S',age:3},[{name:'P',age:4},{name:'L',age:5}] ] // I said it should have an ID to represent it as a unique element for react to not give an error while iterating

  11. What is @Autowire and Dependency injection? // I could not answer them

  12. Tell me about your project you worked on. // I explained marketing web app

  13. Tell me about React

  14. What is Virtual DOM? // 2 times.

  15. What is Redux?

  16. Write a functional component

Amazon

Front-end Engineer position

  • Phone interview Round on April 6

  1. Tell me about yourself

  2. Tell me a time where you worked beyond expected (Told abt the web app i created a vodafone to gather the customer report of all the details)

  3. Tell me a time where you worked under pressure to complete the task on tight deadline (told that my senior was not feeling well so I managed fundserv project)

  4. Normal functions vs Arrow functions

  5. CSS specificity related question -> Which style is applied between id and class. How to make class style take effect (by using important keyword)

  6. [1,2,[3,4,[[[5,6]]]] -> how do you deflat this? I said we can do it by JS built-in technique flat() but he wanted me to implement it myself so I used recusion to solve it. I got stuck upon how to find it the element is array type and he helped me by giving a hint which is Array.isArray([1,2,3])

  7. HMTL css question -> There is a green div inside a blue div. Align green div to the bottom right inside blue div. I had to use position absolute on this which was easy

  8. Continuation of the above question -> when you hover on the blue div, the green div should disappear (solved with a hint)

Amazon

Front-End Engineer II position

This was the coding assessment that was 2 hours long which I didn't do well.

What was asked?

There were 2 questions - All 2 must be answered in plain vanilla JS which I got stuck on. So it's very important to practice coding in JS like accordion or image slider in JS before the interview. These questions were from HackerRank platform (the test got redirected to the hackrank platform)

  1. There was a HTML form and a JS file. The test cases were written by them and I had to make sure they all pass. The question was to

  2. Design an accordion. HTML was written and I had to make sure that if question is clicked, only that answer is visible and all others must be closed until clicked.

Quartermaster

Suppose we have an unsorted log file of accesses to web resources. Each log entry consists of an access time, the ID of the user making the access, and the resource ID.

The access time is represented as seconds since 00:00:00, and all times are assumed to be in the same day.

For example:

logs1 = [
    ["58523", "user_1", "resource_1"],
    ["62314", "user_2", "resource_2"],
    ["54001", "user_1", "resource_3"],
    ["200", "user_6", "resource_5"],    
    ["215", "user_6", "resource_4"],
    ["54060", "user_2", "resource_3"],
    ["53760", "user_3", "resource_3"],
    ["58522", "user_22", "resource_1"],
    ["53651", "user_5", "resource_3"],
    ["2", "user_6", "resource_1"],
    ["100", "user_6", "resource_6"],
    ["400", "user_7", "resource_2"],
    ["100", "user_8", "resource_6"],
    ["54359", "user_1", "resource_3"],
]

We would like you to compute the user sessions, specifically: write a function that takes the logs and returns a data structure that associates to each user their earliest and latest access times.

Should return:

{'user_1': [54001, 58523], 
 'user_2': [54060, 62314], 
 'user_3': [53760, 53760], 
 'user_5': [53651, 53651], 
 'user_6': [2, 215], 
 'user_7': [400, 400], 
 'user_8': [100, 100],
 'user_22': [58522, 58522], 
}

Example 2:

logs2 = [
    ["300", "user_1", "resource_3"],
    ["599", "user_1", "resource_3"],
    ["900", "user_1", "resource_3"],
    ["1199", "user_1", "resource_3"],
    ["1200", "user_1", "resource_3"],
    ["1201", "user_1", "resource_3"],
    ["1202", "user_1", "resource_3"]
]

Should return:

{'user_1': [300, 1202]}

Example 3:

logs3 = [
    ["300", "user_10", "resource_5"]
]

Should return:

{'user_10': [300, 300]}

Complexity analysis variables:

n: number of logs in the input

My code for this which I COMPLETED ON TIME

const logs1 = [
    ["58523", "user_1", "resource_1"],
    ["62314", "user_2", "resource_2"],
    ["54001", "user_1", "resource_3"],
    ["200", "user_6", "resource_5"],   
    ["215", "user_6", "resource_4"],
    ["54060", "user_2", "resource_3"],
    ["53760", "user_3", "resource_3"],
    ["58522", "user_22", "resource_1"],
    ["53651", "user_5", "resource_3"],
    ["2", "user_6", "resource_1"],
    ["100", "user_6", "resource_6"],
    ["400", "user_7", "resource_2"],
    ["100", "user_8", "resource_6"],
    [ "54359", "user_1", "resource_3"],
];

const logs2 = [
    ["300", "user_1", "resource_3"],
    ["599", "user_1", "resource_3"],
    ["900", "user_1", "resource_3"],
    ["1199", "user_1", "resource_3"],
    ["1200", "user_1", "resource_3"],
    ["1201", "user_1", "resource_3"],
    ["1202", "user_1", "resource_3"],
];

const logs3 = [
    ["300", "user_10", "resource_5"],
];

// Function to sort the timestamps
const sortLogs = (logs) => {
  sortedUser = logs.sort((a,b)=> a[0] - b[0])
  const firstTimeStamp = sortedUser[0][0]
  const lastTimeStamp = sortedUser[sortedUser.length - 1][0]
  // console.log('First',firstTimeStamp,' Last', lastTimeStamp)
  return [firstTimeStamp, lastTimeStamp]
}

// user1
const extractUser = (logs, user) => {
  const users = logs.filter(log => log[1] === user)
  // console.log(users)
  return users
} 



const sortedUser1 = sortLogs(extractUser(logs1, 'user_1'))
const sortedUser2 = sortLogs(extractUser(logs1, 'user_2'))
const sortedUser3 = sortLogs(extractUser(logs1, 'user_3'))



const users = (logs) => {
  const myUsers = {}
  logs.forEach(log => {
    if (log[1] in myUsers){
      myUsers[log[1]].push(log)
    }else{
      myUsers[log[1]] = [log]
    }
  })
  return myUsers
}

const getLogs = (users) => {
  const result = {}
  Object.entries(users).forEach(user => {
    const [userId, value] = user;
    // console.log(userId, sortLogs(value) )
    result[userId] = sortLogs(value)

  })
  
  return result
}


const extractedLogs = getLogs(users(logs1))
console.log(extractedLogs)

I took it step by step. First I hardcoded the user and wrote the sortLogs function for individual user. Then I wrote extractUser to extract the users and tried to combine both. But at the end, did not have to use extractUser function.

Then I wrote users function and then getLogs function. I got stuck a little bit in for of loop, so interviewer suggested me to use forEach loop. I THINK I DID VERY WELL. GOOD JOB!!!!!!!!!!!!!

Last updated