Interview Questions - spinningideas/resources GitHub Wiki
General Questions
- "How would you approach building ______?"
- "Can you describe big O notation and how to classify a given implementation or functions efficiency?" - See https://www.youtube.com/watch?v=v4cd1O4zkGw
- "How would you go about creating a search capability for small data sets from various screens that need to search local data sets (eg search my contacts or order history)?"
Node
Javascript
- https://github.com/lydiahallie/javascript-questions
- 70+ JavaScript quiz questions with explanation
- https://medium.com/javascript-in-plain-english/facebook-on-site-technical-interview-1264cacad263
- https://blog.canumeet.com/2016/09/16/101-javascript-interview-question/
- https://github.com/young/frontend-interviewing
Easy
- "Show how you would swap the values of two variables."
- "Write a function that reverses the words of a sentence. Ex: "live eat play" -> "play eat live". Punctuation can be ignored."
More Difficult
-
Implement Stack "Design and implement a stack WITHOUT using Array.push() and Array.pop(). Implement the different methods: push, pop & length."
-
Implement Purchasing Options (SubSet of Sums)
Front End Question
Specific Questions
1) Create a page that asks user for value and lets them know if its an odd value or not:
One Solution: https://codesandbox.io/s/basicjavascriptdomexample-6i49y
2) Create user edit screen:
"Create a screen that allows editing a single user where user property passed into screen in contains {firstname, lastname, email}"
Requirements:
1. Add textboxes to edit first/last/email data.
2. Add save/cancel buttons.
3. Save button should be disabled if any field is empty or data is unchanged.
4. Cancel button should revert any changes made.
5. Save button should console.log updated user object and allow saving if any of the values are empty.
One Solution: https://codesandbox.io/s/reactbasicinterviewexample-3drnz
3) Implement Purchasing Options (SubSet of Sums)
"Given a list of menu items that each have a name and price, and a budget amount that you have to spend, implement a solution to return ALL the possible menu item combinations that can be purchased with a given target budget"
One Solution: https://codesandbox.io/s/example-coding-subsetsum-complex-fcmnx
4) Implement Basic Client Side Search
"Create an implementation that takes 1) an array of JSON objects and 2) a set of properties to search and 3) search term and returns collection of results whose properties have values that contain given search term. Search should be case insensitive and match on values that contain the input search term."
Solutions: https://github.com/spinningideas/resources/wiki/JavaScript-Searching
5) Implement string character occurrence analysis
Create a function with a string as an argument, make it return results that specify amount of times each letter occurs in the string sorted by its original order
example: word is "bananas"
result should be: { b: 1, a: 3, n: 2, s: 1}
6) Implement function that determines true/false if given string is a palindrome
https://www.freecodecamp.org/news/two-ways-to-check-for-palindromes-in-javascript-64fea8191fd7/
- palindrome(“race car”) should return true
- palindrome(“not a palindrome”) should return false
- palindrome(“A man, a plan, a canal. Panama”) should return true
7) Confirm understanding of IIFE and setTimeout
What would the console display if this code was run?
(function(w) {
console.log('STEP: 1');
})(window);
setTimeout(function() {
console.log('STEP: 2');
}, 0);
console.log('STEP: 3');
ANS:
'STEP: 1'
'STEP: 3'
'STEP: 2'
8) In TypeScript:
Show how you would swap the values of two variables.
let x = 1;
let y = 2;
let z = 0;
z=y
y=x
x=z
9) In TypeScript:
Write a function that reverses the words of a sentence. Ex: "bob likes dogs" -> "dogs likes bob". Punctuation can be ignored.
ANS:
var val = "bob likes dogs"
var data = val.split(' ');
var results = []
for(let i = data.length; i < 0; i--){
results.push(data[i]);
}
return results.join(' ');
9) In TypeScript:
Design and implement a stack. Implement the different methods: push, pop & length. Do not simply use Array.push() and Array.pop()
Back End Questions
Database/TSQL
General Interviewee Questions
-
"What would an average workday for this position look like?"
-
"What are the biggest challenges I’ll face in the first 90 days, and how will success be measured?"
-
"Is there anything about my background that makes you hesitant to move me forward in the interview process that I can address or elaborate on?"