Greetings fellow nerds! So, you probably stumbled across this page looking for some interview help. Well, I just spent a month going through the process and, unfortunately, it sucks. In my experience, interviewers are asking questions from a shared question bank instead of asking questions that are actually relevant to the position.
It’s a system, and what do developers do best? Build systems. Which means we are the best at gaming those systems, so let’s game the technical interview process, shall we? Here are the questions that I was asked the most, and the answers to those questions.
What is the difference between an abstract class and an interface?
An interface cannot have any implementation details. It is just a collection of members and method declarations. An abstract class CAN have methods that are implemented, although they can be overridden in child classes. Also, if the question is related to C#, you cannot inherit from multiple classes, but you can inherit from multiple interfaces.
What is the difference between public, private, and protected?
These determine the access level of the property, member, method, function:
- Public – can be accessed from outside the class.
- Protected – can be accessed from the class and classes that inherit from the class.
- Private – can only be accessed from within the class itself.
What is a delegate?
A delegate is a reference to a method type. It can be associated with any method that matches its parameters and return type. Typically used for methods/functions that are used as callbacks.
What is overloading?
Overloading is when you have multiple methods/functions with the same name, but different parameters.
What is a closure?
A closure gives a function access to its outer scope. Variables and functions inside a closure are not garbage collected when the application leaves the scope of the closure.
What are the different types of joins in SQL?
- INNER – Only returns records that exist in both tables
- OUTER – Returns all records from the specified table (first table) and all matching records from the joined table. If there are no matching records in the right table, the values will be null.
- CROSS – Returns all combinations of every record in both tables.
- FULL – Shows all records in both tables, matched or not.
Bonus:
- JOIN is the same as “INNER JOIN”. Better to actually specify “INNER JOIN” instead of just “JOIN” for clarity.
- LEFT JOIN is the same “LEFT OUTER JOIN”. Better to actually specify “LEFT OUTER JOIN” instead of just “LEFT JOIN” for clarity.
What is the difference between let, const, and var (JavaScript/Typescript)
- var – Variables declared using “var” can be re-declared using “var” elsewhere. Variables declared outside of a function (i.e. as a class member) using “var” are in the global scope.
- let – declares a variable that can be modified.
- const – declares a variable that cannot be modified.
What is Typescript?
Typescript is a superset of JavaScript which adds typing to JavaScript. It is used like any typed programming language like C#, however when it is compiled, it gets transpiled into plain JavaScript.
What values are “falsy” (equal to false) in JavaScript/TypeScript?
- false
- 0 (zero)
- “” (empty string)
- null
- undefined
- NaN (not a number / invalid number value)
What is the spread operator?
The spread operator, ...
(..
in C# 12+), is used to split an object or array into its component elements. Useful for combining multiple arrays into one, i.e.:
let newArray = [...array1, ...array2];
let newObject = {
...oldObject,
newProperty1: oldObject.someProperty,
newBooleanProperty: false
};
newArray would be the result of sticking array2 onto the end of array1.
newObject would be a new object created from oldObject, with added properties newProperty1 which will equal oldObject's "someProperty" and newBooleanProperty set to false.
Of course there are a lot more questions out there, but these are the ones I was asked the most. Happy interviewing to you, and best of luck in your search!