Creative Choase Interview Questions by CoderByte
Copy Below Code
View As A Text File
Show Text Only
Show API
Edit Code
Q: What is a RESTful API and what are its advantages?
Restful APIs are most commonly used. They use HTTP requests to create, update, read, and delete any kind of data. In Restful api data exchange between client and Server in JSON, XML, or HTML.
Advantages:
Fast than others
Scalable: They can handle a large number of requests without any additional resources.
Flexible: They are flexible and can use in any language or framework.
Cachable: To improve performance we can cache API.
Security: Restful APIs are secured using OAuth and SSL/TLS.
==========================================================================
Q: What is the difference between git merge and git rebase?
Git merge and rebase are both used to integrate changes from one branch to other.
In git merge, we keep the history of all comments and create a new MERGED commit that binds changes to the target branch.
While in rebase, we do not keep the history of all commits, we just reapply all commit at top of the target branch.
=======================
Q: What is Denormalization in databases?
Normalization we avoid repetition and redundancy of data and use joins.
But in Denormalization we use redundant data. We duplicate data from one to another table to avoid joins. In this, our Query performance improved. And database can more easily read/crate/update/delete data without performing complex joins.
========================
Q:What is a constraint in SQL?
In SQL constraints are a set of rules that are defined on a Column or Table. SQL constraints help us to improve data integrity and prevent invalid data to insert in tables. Below are some SQL constraints:
NOT NULL
UNIQUE
PRIMARY KEY
FOREIGN KEY
===================
Q:What is the difference between a Clustered and Non-Clustered Index?
Below is the key difference.
There can only be one clustered index per table, But you can create multiple non-clustered indexes
Clustered indexes can only be used for sorting data, therefore, they consume less storage while non-clustered indexes are stored in different places so they consume more storage.
Clustered indexes are faster than non-clustered ones.
Q: What deployment strategies do you know and have used before? How can a company deploy with no downtime?
The deployment technique i have used is names Blue/Green Deployment. Let me explain how its works.
We mostly use 3 environments for our project, Staging, UAT, and Production.
When we add any new feature to our application, first we push it on the Staging server and test it's working. When it's fine from the developer end then we push it to the UAT server where QA completely tests it and runs its all Automated or manual QA operations. When everything is working fine and passed by QA then we deploye it to main Production server by down the older version.
To make all processes bugs-free, We need to follow some testing-driven development. We need to write our Unit/Integeration/E2E test cases for each feature so that in deployment level we can easily know about bugs if any.
==============================
Q:What are some deployment anti-patterns?
Anti-patterns are certain patterns that are considered to be bad programming approaches or practices.
Below are some anit-patterns:
Manual Deployment:
Manual Deployment involves manually deploying the code on the server without proper automation, testing or any version control.
Big Bang Deployment:
Big bang deployment involves deploying a large update or new feature at once without properly testing it. This could lead to errors and down the server.
No Rollback Strategy:
No rollback strategy involves deploying updates without taking backup or rollback strategy in case of errors.
========== XXXXXXXXXXXXXXXXXXXXXXXX ========================
ALGO:
function TreeConstructor(strArr) {
const treeElements = strArr.map(
i=>i
.replace(/[\(\)]/,'')
.split(',')
.map(i=>parseInt(i))
);
const childNodes=treeElements.map(i=>i[0]);
const parentNodes=treeElements.map(i=>i[1]);
return !(('_' + parentNodes.sort().join('_') + '_').match(/(_\d+)\1\1_/)
|| ('_' + childNodes.sort().join('_') + '_').match(/(_\d+)\1_/)
);
}
// keep this function call here
console.log(TreeConstructor(readline()));
=====================
MYSQL Query:
SELECT * FROM maintable_CV1MH WHERE LastName = 'Smith' OR FirstName = 'Robert'
ORDER BY Age ASC;