Interview Questions - Position: Software Engineer
What got you into software development or made you decide you wanted to pursue it as a career?
Are there any languages, tools, frameworks you are currently spending time learning, have been wanting to learn, or are excited about learning more about?
What is your greatest weakness as a software developer?
Tell me about a time when you faced a problem with a project. How did you solve it?
Have you ever disagreed with a decision your management team made? How did you handle it?
Do you know your triggers that cause you to feel stressed/overwhelmed? How do handle stress, feelings of being overwhelmed? Mechanisms you use to mitigate those emotions?
How do you respond to criticism?
What did you learn yesterday/this week?
How do you handle disagreements with co-workers?
Describe a time you innovated on the job.
If you could master one technology this year, what would it be?
Describe a coding project or assignment you found really enjoyable or interesting. why?
General Technical Questions
How would you architect the software stack for an application like Airbnb?
Can you describe your workflow when you create a web page?
Do your best to describe the process from the time you type in a website's URL to it finishing loading on your screen?
How would you scale access to a system like Twitter?
Example Answer:
"I would maintain a cache for each users' feed. Then use an asynchronous queue service to handle message consumption to update the feed cache and call push services. Because each push job is stateless, it's linearly scalable by adding more workers to consume the queue."
What are the differences between functional and object-oriented programming?
Answer:Functional programming relies on immutable objects and avoids mutating states. Object-oriented programming depends on state mutation and the in-place modification of objects.
What are the differences between variables created using let
, var
or const
?
What do you understand by loops? Briefly explain the various types of loops.
Answer: A loop is a structure in programming that can repeat a defined set of statements for a set number of times or until a particular condition is satisfied. There are three important types of loops:
What is a recursive function?
Answer: A function that calls itself is called a recursive function. It is based on a terminating condition and uses a stack. The phenomenon is called recursion.
Explain the Difference between SQL vs NoSQL
What is Database Normalization?
Answer:Database normalization is a data design and organization process applied to data structures based on rules that help build relational databases. In relational database design, the process of organizing data to minimize redundancy is called normalization. Normalization usually involves dividing a database into two or more tables and defining relationships between the tables. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database via the defined relationships.
What is Denormalization?
Answer:It is the process of improving the performance of the database by adding redundant data.
What is the difference between primary and foreign key?
Answer:A primary key uniquely identifies a relationship in a database, whereas a foreign key is the key that is in another relationships and it has been referenced from the primary key from another table.
What is a Database Transaction
What are COMMIT and ROLLBACK in SQL?
Answer: COMMIT statement is used to end the current transaction and once the COMMIT statement is exceucted the transaction will be permanent and undone.
Answer: ROLLBACK statement is used to end the current transaction and undone the changes which was made by that transaction.
API
What is REST?
REST (Representational State Transfer) is an architectural style for developing web services which exploit the ubiquity of HTTP protocol and uses HTTP method to define actions. It revolves around resource where every component being a resource that can be accessed through a shared interface using standard HTTP methods.
How would you build a REST API?
What is nodejs
Node.js is a server-side platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. It is an event-based, non-blocking, asynchronous I/O runtime that uses Google's V8 JavaScript engine and libuv library.
What is the difference between ==
and ===
?
Explain the difference between: function Person(){}
, var person = Person()
, and var person = new Person()
?
What is promise.all in Javascript
Answer: Promise.all is a promise that takes an array of promises as an input (an iterable), and it gets resolved when all the promises get resolved or any one of them gets rejected. For example, the syntax of promise.all method is below,
Promise.all([Promise1, Promise2, Promise3]) .then(result) => { console.log(result) }) .catch(error => console.log(`Error in promises ${error}`))
What is the call stack in javascript?
Call Stack is a data structure for javascript interpreters to keep track of function calls in the program. It has two major actions,
Whenever you call a function for its execution, you are pushing it to the stack.
Whenever the execution is completed, the function is popped out of the stack.
Let's take an example and it's state representation in a diagram format
function hungry() {
eatFruits();
}
function eatFruits() {
return "I'm eating fruits";
}
// Invoke the `hungry` function
hungry();
The above code processed in a call stack as below,
Add the
hungry()
function to the call stack list and execute the code.Add the
eatFruits()
function to the call stack list and execute the code.Delete the
eatFruits()
function from our call stack list.Delete the
hungry()
function from the call stack list since there are no items anymore.
Microservices
What are main differences between Microservices and Monolithic Architecture
Answer:
Microservices
Service Startup is fast
Microservices are loosely coupled architecture.
Changes done in a single data model does not affect other Microservices.
Microservices focuses on products, not projects
Monolithic Architecture
Service startup takes time
Monolithic architecture is mostly tightly coupled.
Any changes in the data model affect the entire database
Monolithic put emphasize over the whole project
What are the standard patterns of orchestrating microservices?
Answer:
As we start to model more and more complex logic, we have to deal with the problem of managing business processes that stretch across the boundary of individual services.
With orchestration, we rely on a central brain to guide and drive the process, much like the conductor in an orchestra. The orchestration style corresponds more to the SOA idea of orchestration/task services. For example we could wrap the business flow in its own service. Where the proxy orchestrates the interaction between the microservices like shown in the below picture.
With choreography, we inform each part of the system of its job, and let it work out the details, like dancers all find‐ ing their way and reacting to others around them in a ballet. The choreography style corresponds to the dumb pipes and smart endpoints mentioned by Martin Fowler's. That approach is also called the domain approach and is using domain events, where each service publish events regarding what have happened and other services can subscribe to those events.
Why Would You Opt For Microservices Architecture?
Answer:
There are plenty of pros that are offered by Microservices architecture. Here are a few of them:
Microservices can adapt easily to other frameworks or technologies.
Failure of a single process does not affect the entire system.
Provides support to big enterprises as well as small teams.
Can be deployed independently and in relatively less time.
React
How do you fetch data with React Hooks?
useState
is a hook used to maintain local states in function components. useEffect
is used to execute functions after a component gets rendered (to "perform side effects").
Example:
import React, { useState, useEffect } from "react";
function Users() {
const [users, setUsers] = useState([]);
useEffect(() => {
fetch("https://api.github.com/users")
.then((response) => response.json())
.then((data) => {
setUsers(data);
});
}, []);
return (
<div>
{users.map((user) => (
<div key={user.id}>
<span>
<img src={user.avatar_url} width={"30px"} alt={user.avatar_url} />
</span>
<span> {user.login.toUpperCase()}</span>
</div>
))}
</div>
);
}
What is the use of refs?
The ref is used to return a reference to the element. They should be avoided in most cases, however, they can be useful when we need direct access to DOM element or an instance of a component.
What is React Context?
Context provides a way to pass data through the component tree without having to pass props down manually at every level. For example, authenticated user, locale preference, UI theme need to be accessed in the application by many components.
const {Provider, Consumer} = React.createContext(defaultValue);