Ultimate Backend Interview Guide
Ultimate Backend Interview Guide
BackendInterview Guide
www.bosscoderacademy.com 2
Q.1 EASY
EASY
What are the different languages present
in DBMS?
www.bosscoderacademy.com 3
Q.2 EASY
EASY
What are ACID properties?
ACID properties are a set of properties that ensure reliable and secure
transactions among databases. To maintain data consistency, ACID
properties are followed. ACID stands for Atomicity, Consistency,
Isolation, Durability.
www.bosscoderacademy.com 4
Q.3 MEDIUM
MEDIUM
What is normalization? Explain the
different types of normal forms.
www.bosscoderacademy.com 5
BCNF: It is known as Boyce Codd Normal Form which is a strict
version of 3NF. A relation is said to be in BCNF if it is in 3NF and for
every functional dependency X->Y, X is a super key of the table. It is
also called the 3.5 Normal Form.&
4NF: It is known as the fourth normal form. A relation is said to be
in 4NF if it is in BCNF and there is no multivalued dependency in
the table.&
5NF: It is known as the fifth normal form. A relation is said to be in
5NF if it is in 4NF and it cannot be further decomposed into smaller
tables.
www.bosscoderacademy.com 6
Q.4 EASY
EASY
What is an ER diagram?
www.bosscoderacademy.com 7
Q.5 MEDIUM
MEDIUM
Give the resulting tables arising from
applying Joins on the following tables in
SQL
Employees Table:
id name department_id
1
Alice
101
2
Bob
102
3
Charlie
101
4 David 103
Departments Table:
id department_id
101
HR
102
IT
103
Marketing
104 Sales
www.bosscoderacademy.com 8
Inner Join:
Returns only the rows with matching values in both tables.
Filters out rows with no match.
SQL Query:
SQL
FROM employees
Output:
name department_name
Alice
HR
Bob
IT
Charlie
HR
David Marketing
www.bosscoderacademy.com 9
Left Join (Left Outer Join):
$ Returns all rows from the left table and the matched rows from
SQL Query:
SQL
FROM employees
departments.id;
Output:
name department_name
Alice
HR
Bob
IT
Charlie
HR
David Marketing
www.bosscoderacademy.com 10
Right Join (Right Outer Join):
& Returns all rows from the right table and the matched rows from
& If there is no match in the left table, NULL values are returned.
SQL Query:
SQL
FROM employees
departments.id;
Output:
name department_name
Alice
HR
Bob
IT
Charlie
HR
David
Marketing
NULL Sales
www.bosscoderacademy.com 11
Full Outer Join:
$ Returns all rows when there is a match in either the left or right
table.
SQL Query:
SQL
FROM employees
employees.department_id = departments.id;
Output:
name department_name
Alice
HR
Bob
IT
Charlie
HR
David
Marketing
NULL Sales
www.bosscoderacademy.com 12
Self Join:
tables.
SQL Query:
SQL
FROM employees e1
Output:
name manager
Alice
NULL
Bob
NULL
Charlie
Alice
David NULL
www.bosscoderacademy.com 13
Q.6 EASY
EASY
What is statelessness in REST?
www.bosscoderacademy.com 14
Q.7 HARD
HARD
What are Idempotent methods in REST?
Idempotent implies that the outcome of a single request remains the
same, even if the request is called multiple times.
www.bosscoderacademy.com 15
Q.8 MEDIUM
MEDIUM
What is CAP Theorem?
becoming unavailable
stop the system
Pick two
Memcache Big table Redis (Oracle SQL Server MySQL)
P A
AP Category
Clients may read inconsistent data
www.bosscoderacademy.com 16
Q.9 MEDIUM
MEDIUM
What is CAP Theorem?
SQL Injection:
SQL injection is a cyber attack where an attacker injects malicious SQL
code into a website's input fields, exploiting vulnerabilities in the code.
The aim is to manipulate the executed SQL query, gaining unauthorized
access to, modifying, or deleting data, and potentially executing
administrative operations on the database.
Example:
In a login form with the SQL query:
SQL
SQL
www.bosscoderacademy.com 17
Resulting in:
SQL
The double hyphen (-- ) comments out the rest of the query, allowing
unauthorized access.
Prevention
ov Input Validationl
Sv Security Audits
www.bosscoderacademy.com 18
Q.10 MEDIUM
MEDIUM
What is the difference between
clustered and non clustered indexes?
Leaf Nodes Actual data in leaf nodes Leaf nodes may contain
included columns, not data
Order Clustered key defines order Index key defines order in the
Definition in the table index
Default for Primary keys are clustered Composite keys with unique
constraints act as non-
Primary Keys indexes by default clustered indexes
www.bosscoderacademy.com 19
Q.11 EASY
EASY
What is a web server?
www.bosscoderacademy.com 20
Q.12 MEDIUM
ME IUM D
What is SQL injection? How can we
prevent it?
NoSQL is a Non-relational or Distributed Database. Non-relational
databases store their data in a non-tabular form. Instead, non-relational
databases have different storage models based on specific
requirements of the type of data being stored.
"Empid":101,
“empid” is the name (column)
"lastname":"Sharma",
1 is the value (for this row)
"firstname":"Rahul",
"title":"Programmer",
"titleofcourtesy":"MS.",
"birthdate":"12-09-1997",
"hiredate":"18-06-2010",
"address":"Sector 19 Chandigarh",
"postalcode":"500025",
"country":"USA",
"phone":"8768561213"
Comma separates this first
www.bosscoderacademy.com 2 1
Example products include MongoDB, CouchDB, and BaseX.
BaseX.
The Edge explains the relationship between two nodes. Edges can also
nodes.
s
d
n
i e
r
F
)
..
,.
L
ik
..
,.
Person e
ss
s
(r
re
a
d
ti
d
n
g
(a
. ) ,r
..
n
e
w
sI
i e
ie
e
v
e
iv
,r
..
L
g
.)
i n
t
r a
(
s
e
i k
L
Restaurant
City
LocatedIn (address,...,...)
www.bosscoderacademy.com 22
--> Key Value Data-Model
In this model every data element in the database is stored as a key value
pair.
with only two columns, the key and and the value.
Username Rahul
ID 101
Madhya
State
Pradesh
Pincode 500035
www.bosscoderacademy.com 23
--> Column Oriented Databases
www.bosscoderacademy.com 24
Q.13 EASY
EASY
How do you create a simple server in
Node.js that returns Hello World?
res.end('Hello World\n');
www.bosscoderacademy.com 25
Q.14 MEDIUM
MEDIUM
What is MVC Architecture?
The Model-View-Controller (MVC) framework is an architectural/design
pattern that separates an application into three main logical
components Model, View, and Controller. It comprises three main
components: Controller, Model, and View.
Controller: The controller focuses on processing business logic and
handling incoming requests. The controller instructs the model,
manipulates data, and collaborates with the view to produce the final
output.
View: Responsible for the application's UI logic, the view generates the
user interface based on data collected through the controller. It
interacts solely with the controller, ensuring separation of concerns.
www.bosscoderacademy.com 26
Q.15 MEDIUM
MEDIUM
a client (or user) can make to an API within a specified time frame. It
helps prevent abuse, protect server resources, and ensure fair usage of
delayed or discarded.
www.bosscoderacademy.com 27
Fixed Window Counter:
www.bosscoderacademy.com 28
Q.16 MEDIUM
MEDIUM
How can you select which webservice to
use between REST and SOAP?
When deciding between SOAP and REST for web services, consider the
following factors:
MP Nature of Data/Logic Exposure:
n SOAP: Used for exposing business logic.h
n REST: Used for exposing data.
~P Formal Contract Requirement:
n SOAP: Provides strict contracts through WSDL.h
n REST: No strict contract requirement.
¹P Data Format Support:
Û SOAP: Limited support.h
Û REST: Supports multiple data formats.
çP AJAX Call Support:
Û SOAP: No direct support.h
Û REST: Supports XMLHttpRequest for AJAX calls.
www.bosscoderacademy.com 29
Synchronous/Asynchronous Requests:
% SOAP: Supports both sync and async.-
% REST: Supports only synchronous calls.
K Statelessness Requirement:
% SOAP: No.-
% REST: Yes.
a Security Level:
% SOAP: Preferred for high-security needs.-
% REST: Security depends on underlying implementation.
Transaction Support:
% SOAP: Provides advanced support for transactions.-
% REST: Limited transaction support.
Å Bandwidth/Resource Usage:
% SOAP: High bandwidth due to XML data overhead.-
% REST: Uses less bandwidth.
www.bosscoderacademy.com 30
Q.17 EASY
EASY
What is DRY principle in software
development?
Here's an example:
Without DRY:
def validate_email(email):
return False
return True
if not validate_email(email):
user.email = email
def send_confirmation_email(email):
if not validate_email(email):
# send email...
www.bosscoderacademy.com 31
In this example, the email validation logic is repeated three times. Any
change to this logic would require three edits, increasing the risk of
errors and inconsistencies.
With DRY:
def validate_email(email):
return False
return True
if not validate_email(email):
user.email = email
def send_confirmation_email(email):
if not validate_email(email):
www.bosscoderacademy.com 32
Q.18 MEDIUM
MEDIUM
What is the difference between first
party and third party cookies?
Both first-party and third-party cookies are small files stored on your
computer by websites you visit. They track your activity and
preferences, but they do so in different ways.
First-party cookies are created by the website you're on and can only
be accessed by that website. They're like a little note that the website
leaves on your computer to remember you next time you visit. They're
used for things like:
q Keeping track of your login information so you don't have to type it
in every timez
q Remembering what items you've added to your shopping cartz
q Tailoring the website to your preferences, such as language or font
size
www.bosscoderacademy.com 33
Feature First-party cookies Third-party cookies
Who can Only the website that Any website that uses the
access them? created them same third-party code
Privacy concerns
Third-party cookies have raised concerns about privacy, as they can be
used to track your activity across the internet without your knowledge
or consent. Many browsers now allow you to block or delete third-party
cookies.
www.bosscoderacademy.com 34
Q.19 MEDIUM
MEDIUM
principles.
www.bosscoderacademy.com 35
Q.20 MEDIUM
MEDIUM
principles.
of software:
abstract classes.s
consistency in polymorphism.s
improving flexibility.
www.bosscoderacademy.com 36
Q.21 HARD
HARD
What are the advantages and
disadvantages of microservices
architecture?
Key Concepts:
e Independence: Each service has specific business function.
Developed & scaled separately.[
e Modularity: Breaking down a large, monolithic application into
smaller, manageable pieces.
Advantages of Microservices:
Agility and Speed: Faster development and deployment cycles due
to independent services.[
Scalability: Individual services can be scaled up or down
independently based on demand.[
Resilience: Failure of one service doesn't cripple the entire app.[
Technology Choice: Each service can use the best tool for the job
without affecting others.
www.bosscoderacademy.com 37
Disadvantages of Microservices:
( Complexity: Increased overhead in managing infrastructure,
communication, and monitoring./
( Testing: Testing complex distributed systems can be challenging
and time-consuming./
( Debugging: Identifying and fixing issues across services can be
difficult./
( Cost: Initial setup and ongoing maintenance can be more expensive
than monolithic.
www.bosscoderacademy.com 38
Q.22 MEDIUM
MEDIUM
What is the difference between
horizontal and vertical scaling?
www.bosscoderacademy.com 39
Processing large datasets efficiently.
www.bosscoderacademy.com 40
Q.23 MEDIUM
MEDIUM
What is the difference between HTTP
methods GET and POST?
Host: example.com
Host: example.com
Content-Type: application/x-www-form-urlencoded
param1=value1¶m2=value2
www.bosscoderacademy.com 41
Feature GET POST
Bookmarks Yes No
Idempotency Yes No
www.bosscoderacademy.com 42
Q.24 MEDIUM
MEDIUM
How can you maintain API Security?
www.bosscoderacademy.com 43
Q.25 HARD
HARD
something on www.google.com?
IT Query Submission:
your search query and other information (IP address, browser type,
etc.).
recognition.
www.bosscoderacademy.com 44
Serving the Results:
7 The search engine selects the top results and retrieves the necessary
data from the database.0
7 This data is formatted into HTML snippets with titles, descriptions,
and links to the original pages.0
7 The HTML response is sent back to your browser.
O Displaying the Results:
7 Your browser receives and interprets the HTML response, displaying
the search results page with the ranked snippets.0
7 You can then click on the snippets to visit the relevant websites.
www.bosscoderacademy.com 45
Why
Bosscoder?
750+ Alumni placed at Top
Product-based companies.
Explore More