⏱ 0:00est. 30 min
Epam
//Q. JavaScript: Explain the difference between Async/Await and Promises.
//A. async/await simply gives you a synchronous feel to asynchronous code. It's a very elegant form of syntactical sugar.
// The async keyword before a function has two effects:
// Makes it always return a promise.
// Allows await to be used in it
// The word “async” before a function means one simple thing: a function always returns a promise
// Other values are wrapped in a resolved promise automatically.
// For simple queries and data manipulation, Promises can be simple, but if you run into scenarios where there's complex data manipulation and whatnot involved, it's easier to understand what's going on if the code simply looks as though it's synchronous
// https://javascript.info/async-await
// A “producing code” that does something and takes time. For instance, some code that loads the data over a network. That’s a “singer”.
// A “consuming code” that wants the result of the “producing code” once it’s ready. Many functions may need that result. These are the “fans”.
// A promise is a special JavaScript object that links the “producing code” and the “consuming code” together.
// https://javascript.info/promise-basics
/*
let promise = new Promise(function (resolve, reject) {
// setTimeout(() => resolve("done"), 1000);
setTimeout(() => reject(new Error("Woops!")), 1000);
})
promise.then((result) =>{
console.log(result);
}).catch((error) => {
console.error(error);
}).finally(() => {
console.log('done finally');
})
new Promise((resolve, reject) => {
setTimeout(() => resolve("value"), 2000);
})
.finally(() => alert("Promise ready")) // triggers first
.then(result => alert(result)); // <-- .then shows "value"
function loadScript(src) {
return new Promise( function (resolve, reject) {
let script = document.createElement('script');
script.src = src;
script.onload = () => resolve(script);
script.onerror = () => reject(new Error('Script failed'));
document.head.append(script);
})
}
let p = loadScript("https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js");
p.then(
script => console.log(`${script.src} loaded`),
error => console.error(`Error: ${error}`),
);
let promise = new Promise(function(resolve, reject) {
resolve(1);
setTimeout(() => resolve(2), 1000);
});
promise.then(alert); // 1
function delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
delay(3000).then(() => alert('runs after 3 seconds'));
*/
// promise chaining
// sequence of asynchronous tasks to be performed one after another — for instance, loading scripts. How can we code it well?
// https://javascript.info/promise-chaining
/*
new Promise(function (resolve, reject) {
setTimeout(() => resolve(1), 1000)
}).then(function(result) {
console.log(result); //1;
return result * 2;
}).then(function(result) {
console.log(result); //2;
return result * 2;
}).then(function(result) {
console.log(result); //4;
return result * 2;
})
*/
// --------
//Q.Microtasks queue
//A. Asynchronous tasks need proper management. For that, the ECMA standard specifies an internal queue PromiseJobs, more often referred to as the “microtask queue”
// As stated in the specification:
// The queue is first-in-first-out: tasks enqueued first are run first.
// Execution of a task is initiated only when nothing else is running
// when a promise is ready, its .then/catch/finally handlers are put into the queue; they are not executed yet. When the JavaScript engine becomes free from the current code, it takes a task from the queue and executes it
// https://javascript.info/microtask-queue
/*
let p1 = Promise.resolve();
p1.then(() => console.log('p1 done')); // then second
console.log('p1 finished'); // this shows first
*/
// --------
// Doctype in html
// The HTML document type declaration, also known as DOCTYPE, is the first line of code required in every HTML or XHTML document. The DOCTYPE declaration is an instruction to the web browser about what version of HTML the page is written in. This ensures that the web page is parsed the same way by different web browsers.
// --------
// How to center a div with CSS2 and CSS3?
// css3
// .container{
// display: flex;
// align-items: center;
// justify-content: center;
// }
// css2
// .outer {
// display: table;
// position: absolute;
// height: 100%;
// width: 100%;
// }
// .middle {
// display: table-cell;
// vertical-align: middle;
// }
// .inner {
// margin-left: auto;
// margin-right: auto;
// width: 100px
// /*whatever width you want*/
// ;
// }
// https://stackoverflow.com/questions/29708036/how-to-center-align-div-using-css3
// --------
// context api, HOC, hooks
// --------
// Pollfill of bind, prototype, this, js engine, microtask queue, flatten array, implement singleton pattern,
Function.prototype.myBind = function (context, ...args1) {
let fn = this;
return function (...args2) {
fn.apply(context, [...args1, ...args2]);
}
}
// What is this?
// The JavaScript this keyword refers to the object it belongs to.
// It has different values depending on where it is used:
// 1 In a method, this refers to the owner object.
// 2 Alone, this refers to the global object.
// 3 In a function, this refers to the global object.
// 4 In a function, in strict mode, this is undefined.
// 5 In an event, this refers to the element that received the event.
// 6 Methods like call(), and apply() can refer this to any object.
// --------
// How to reverse an array and save it into the same array?
let arrToReverse = [1, 2, 3, 4];
console.log(arrToReverse.reverse());
let arrToReverse1 = [1, 2, 3, 4];
let reversedArray = [];
arrToReverse1.forEach(element => {
reversedArray.unshift(element);
})
console.log(reversedArray);
let arrToReverse2 = [1, 2, 3, 4];
for(let i=0; i<arrToReverse2.length/2; i++) {
[arrToReverse2[i], arrToReverse2[arrToReverse2.length-i-1]] = [arrToReverse2[arrToReverse2.length-i-1], arrToReverse2[i]];
}
console.log(arrToReverse2);
// Frontend developer/React
// Local storage/session storage/cookies and its related questions
// SetTimeout code snippets
// Event loop concept/microtask queue
// object cloning/Object.assign()
// promises
// simple program with Array.reduce function
// reduce/reduceRight
// https://javascript.info/array-methods#reduce-reduceright
Arguments:
// accumulator – is the result of the previous function call, equals initial the first time (if initial is provided).
// item – is the current array item.
// index – is its position.
// array – is the array.
// When we need to iterate over an array – we can use forEach, for or for..of.
// When we need to iterate and return the data for each element – we can use map.
// The methods arr.reduce and arr.reduceRight also belong to that breed, but are a little bit more intricate. They are used to calculate a single value based on the array.
// reduce
let nums = [1,2,3,5,5]
let sum = nums.reduce(function (accumulator, item, index, array) {
return accumulator+item;
}, 0)
console.log(sum);
// Prototypal inheritance
// Object,create() and its related questions
// Let's compare obj1 and obj2 in this code:
var target1 = {}, target2 = {};
var obj1 = Object.create(target1, {myProp: {value: 1}});
var obj2 = Object.assign(target2, {myProp: 1});
// Prototypical chain
// Object.create creates a new object with the specified [[Prototype]], and Object.assign assigns the properties directly on the specified object:
// Arrow functions with 'this' keyword
React:
// Reconcilliation
// Context api
// virtual dom
// keys in react
// Coding - URL will be given.. Create a component and get the results from url and show it in the component
// flexbox, eventloop,
// OOP, JS core, React, Functional programming and more
// 1. questions about how some of the concepts in JavaScript work
// 2. questions about React fundamentals
// 3. how would I write tests and what kind of things I would test for
// 4. the interviewer asked me to write Promise.all polyfill in JavaScript
/*
const prom1 = new Promise(function (resolve, reject) {
setTimeout(() => {
resolve("gfg1")
}, 1000)
})
const prom2 = new Promise(function (resolve, reject) {
setTimeout(() => {
reject("error")
}, 2000)
})
Promise.myall = function (values) {
const promise = new Promise(function (resolve, reject) {
let result = [];
let total = 0;
values.forEach((item, index) => {
Promise.resolve(item).then((res) => {
result[index] = res;
total++;
if (total === values.length)
resolve(result);
}).
catch((err) => {
reject(err);
})
})
})
return promise
}
Promise.myall([
prom1,
prom2,
])
.then((res) => {
console.log(res);
})
.catch((er) => {
console.log(er)
})
*/
// sorting a list of custom objects with multiple fields
// Flatten a nested array
// I/P: [1,2,[3],[[4]],[[[5]]]]
// O/P: [1,2,3,4,5]
a.flat(Infinity)
let arrayToFlat = [1,2,[3],[[4]],[[[5]]]]
function flatten (arr) {
return arr.reduce(function (accumulator, item) {
return accumulator.concat(Array.isArray(item) ? flatten(item) : item)
}, [])
}
console.log(flatten(arrayToFlat));
// Sort it first on the basis of age then on the basis of salary.
// [{name:'a',salary:20000,age:25},
// {name:'b',salary:25000,age:23},
// {name:'c',salary:34000,age:25}
// {name:'d',salary:13000,age:30}]
let arrobj = [{name:'a',salary:20000,age:25},
{name:'b',salary:25000,age:23},
{name:'c',salary:34000,age:25},
{name:'d',salary:13000,age:30}]
console.log(arrobj.sort(
function(a, b) {
if (a.age == b.age) {
return a.salary-b.salary
}
return a.age-b.age
}
))
// Half reverse the string:
// i/p: microsoft
// o/p: orcimtfos
// Hoisting, call, bind, apply, flatten array.
// Questions were directly asked from the courses of will sentence and kyle Simpson frontend masters.
// asked about closures, hoisting, prototype inheritance in JS
// Reverse a linked list in 1 traversal
// First nth element in linked list
// Anagram program in a set of string
// What is parallelization what are issues related to concurrency what basic concepts are there to resolve them?
// How would I solve problem with huge db table that needs to be cleaned up (1TB and 99.5% of data have to be removed)
// 1. SDLC(Waterfall, Agile etc)
// 2. HTML(DOM working, Synchronous, Asynchronous)
// 3. CSS(positions, layout, grid, flexbox)
// 4. JS(basic to advanced)
// 5. GIT(rebase vs merge)
// 6.Design Patterns
// 7. Unit Testing
// 8. Miscellaneous (Architecture, folder structure etc)
// https://github.com/KonstantinDinev/EPAM-JS-CodingInterview
/*
var colors = ["#_111", "#111", 222, ["#_345", "#_546", "#CCC"], "#_333", "#_666"];
//0. Implement a function that returns the last color from the list: "#_666"
//1. Implement a function that returns the last color from the list in the proper format: "#666"
//2. Return the array with all colors in a formatted matter, ignoring invalid items ["#111, "#111", ["#345", "#546", "#CCC"], "#333", "#666"];
//3. Return the array without the duplicates ["#111", "#345", "#546", "#CCC", "#333", "#666 "];
//4. Most probably you are cleaning your array like that: getColors(colors). Change you code so it can be called like: colors.cleanDuplicates();
// Add some tests for it
//5. Optimize the performance of the previous implementation if possible (indexOf, includes, … are looping all over the items) (BigO)
//6. Generate an array of div elements for each color. Each div should have text inside (the name of the color). Use the current color as a border color.
//7. Make possible to add more colors while executing the function. Like that: colors.cleanDuplicates(["#_F00", "#_0F0)"]);
//8. Make it possible to add colors like that: colors.cleanDuplicates(["#_F00"]) (["#_0F0"]) (["#_00F"]);
*/
/*
Difference between null and undefined in Javascript.
JWT Token - Three important parts -Header,Subject,Signature and all are in encoded form .
How to create a JWT Token .
What are Prototype methods in Javascript.
How to Detect changes made to all public properties.
Jquery to find odd rows of table and apply css to background.
Difference between let and Var
Difference between null and undefined .
Download huge files using Web API
*/
// System design for Outlook meeting schedule.
var colors = ['#_111', '#111', 222, ['#_345', '#_546', '#CCC'], '#_333', '#_666'];
// 0
const lastColor = () => {
let lastItem = colors.length - 1;
return colors[lastItem];
};
console.log(`${lastColor()} -- last color in the array`);
// 1 proper format and throw exception on invalid
const formatColor = (hex) => {
let tempArr = [];
if (hex[0] !== '#') {
// tempArr = `#${hex}`.split('');
// throw exception
}
else
tempArr = hex.split('');
let idx = tempArr.indexOf('_');
if (idx) tempArr[idx] = '';
const validColor = tempArr.join('');
return validColor;
}
// /^#[0-9A-F]{3}$/i.test(colors[1])
// /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i
var regex = new RegExp("^#[0-9A-F]{3}$", 'i');
// 2 - Validate colors and remove the invalid
let getColors = (colorsArr) => {
let validatedColors = [];
for (let item of colorsArr) {
// console.log(item);
if (typeof(item) === 'string' && item.match(regex)) validatedColors.push(item);
if (typeof(item) !== 'object') {
// console.log(`${item} - ${regex.test(item)}`);
if (!regex.test(item) && item[0] === '#') validatedColors.push(formatColor(item));
}
else {
let tempCollection = [];
for (let subItem of item) {
// console.log(`${subItem} from subItem - ${regex.test(subItem)}`);
if (!regex.test(subItem) || subItem.match(regex)) tempCollection.push(formatColor(subItem));
}
validatedColors.push(tempCollection);
}
}
return validatedColors;
}
console.log('getColors(colors) - ', getColors(colors) );
// 3 JS Set Collection
const set = new Set(getColors(colors));
// console.log(set);
// 4 prototype function -> Optionaly call this with argument
// It is not mutating the collection so it has to be assigned
Array.prototype.cleanDuplicates = function(add = [], arr = this) {
arr = getColors(arr);
let temp = [];
// Check for duplicates in a sub-collection
for (let item of arr) {
if (typeof(item) === 'object') item.map((subItem) => temp.push(subItem));
else temp.push(item);
}
if (add.length > 0)
for (let addItem of add) temp.push(formatColor(addItem));
let resultSet = new Set(temp);
console.log(resultSet);
return resultSet;
}
// 5, 6 Generate some html
// Task 7, 8 - optionally send more colors as first argument and specify an array to clean as a second argument
// in case there is no arguments specified, the function will proceed with the collection that invoked it
class ColorBox {
constructor(htmlTagName, txtNode, color) {
this.htmlTagName = document.createElement(htmlTagName);
this.txtNode = document.createTextNode(txtNode);
this.color = color;
this.htmlTagName.id = this.color.replace('#', '');
this.htmlTagName.appendChild(this.txtNode);
};
};
// All the three behaviours - comment to test
let workArr = [...colors.cleanDuplicates()];
workArr = [...colors.cleanDuplicates(['#F_00', '#_0F0'])];
//workArr = [...colors.cleanDuplicates(['#F_00', '#_0F0'], ['#111', '#683', '#921', '#CA5'])];
let divsArray = [];
workArr.map((hex, index) => {
divsArray.push(new ColorBox('div', `${hex}`, hex));
});
console.log('divsArray ', divsArray);
const generateMarkup = () => {
window.addEventListener('load', function () {
let el = '';
divsArray.map((item) => {
document.body.appendChild(item.htmlTagName);
el = document.getElementById(item.color.replace('#', ''));
//el.style.color = item.color;
//el.style.backgroundColor = item.color;
el.style.border = `10px solid ${item.color}`;
el.style.margin = '5px';
el.style.textAlign = 'center';
});
}, false);
};
generateMarkup();
/*
https://anywhere.epam.com/en/blog/javascript-interview-questions-at-epam-anywhere
You could be asked general JS questions about the:
Difference between an event loop, a microtask, and a macrotask;
Promise and peculiarities of working with JS;
Prototypes and prototype inheritance; and
General pros and cons of JavaScript, its domain, and use cases.
Other JavaScript senior interview questions you can expect may focus on specific JavaScript frameworks and libraries. For example, React questions may include:
Different approaches to state management and the advantages and drawbacks;
Virtual DOM and what it's used for; and
What JSX is, and some advantages and drawbacks of the technology.
https://alitoshmatov.medium.com/interview-questions-for-javascript-developer-epam-s-bdb995c0fa20
Quite a while ago I was invited to have an interview for the JS developer position at EPAM Systems. Below I am going to share questions I had and leave some comments on them. These are common questions for javascript developers, so this article should help you to understand how any javascript interview goes, and help you prepare for your interview.
Some questions might be different from what I had originally but I do my best to keep main context.
So we started with some warm-up questions like:
const a = [1];
const b = a;
b.push(2);
console.log(a, b);
There are two main things to consider, both related to object reference: a) After assigning a to b both constants contain a reference to the same object, thus changes made through either of them affect the same object, and logging them prints the same value; b) Although we declared b as a constant, you can still make changes on it, as it is just holding object reference value, and this something you can not change, meaning that you can not reassign another object to constant.
Var, let, const
The question was about the difference between var, let, and const. This question might look simple, but answering it correctly and completely proves that you know the basic and fundamental concepts of javascript. When answering this question consider their scope, and explain how hoisting affects each of them. Also, you can provide additional information about how the function keyword behaves and how it is different from arrow functions.
Context, this keyword
This question was both a bit of theory and coding. Here you have to explain what is context and how it works. Also based on the below code you should tell what each properties value is
const obj = {
a: this,
b: function(){
return this;
},
c: ()=>{
return this;
},
d(){
return this;
},
e: function(){
return this.a;
}
}
This one was quite tricky. Pay attention how this keyword is used in different contexts. Sometimes it is pointing to the global context, and sometimes to object. Try to be as clear as possible explaining what is happening in each case.
Array
I think most interviews have at least one question related to arrays. In my case, I had to explain the difference between Set and Array. I don"t think not knowing Set would affect your scores negatively, but I am pretty sure that knowing what Set is, how to use it, and its common methods would give you an advantage over others. Also, there were some basic questions related to map and forEach.
Macro, micro tasks, event loop, stack
This set of questions was more about how Javascript works in background, how event loop works, what is stack, macro and micro tasks. Personally, I think very few people can answer these questions, and having knowledge of these concepts, really shows how serious you are about JS.
console.log(1);
setTimeout(()=>console.log(2), 0);
Promise.resolve().then(()=>console.log(3));
setTimeout(()=>console.log(4), 1);
console.log(5);
I was asked to tell in which order each number is logged into the console. Keep in mind that although these statements might seem to be equal, each one of them is handled differently by the compiler.
Object deep copy
const obj = {
a: 1,
b: "hello",c: {
d: "world"
},
e: {
f: {
g: 100
}
}
};
The task here was making a function that takes an object and gives its exact copy by eliminating every object reference it contains. So I would suggest that you should mention that you can do it easily by JSON stringify, and parse methods, but also provide an in-depth logical solution using recursive functions.
function objectClone(obj) {
var clone = {}
for (var i in obj) {
if (typeof(obj[i]) == "object" && obj[i] != null) {
clone[i] = objectClone(obj[i]);
} else {
clone[i] = obj[i];
}
}
return clone;
}
Some tips
Try to be as clear as possible, don"t make up answers if you have no idea about how to answer the question.
If questions are simple try to cover every aspect of it, include relevant information but don"t make it boring
If you have difficulty explaining some concept verbally, ask to show it in code. Keep in mind that you don"t have to be a good speaker, but prove that you know the concept
*/
// Glassdoor
/*
How decorators are used in angular
-How hackers attack you website / app?
-Node.js commands, what are the numbers of version in package.json.
- how we store data on backend
Had to code some basic OOP things like classes and inheritance, and answer some advanced Javascript specific questions like closures, object instantiation, etc.
Find the k-th maximum element in an array.
*/
// https://codepen.io/tsing/pen/MxdxGO
// #1. Display all five images once they are loaded
window.onload = () => {
document.body.classList.add("ready");
/**
* With SCSS
* img {
* display: none;
*
* .ready & {
* display: block;
* }
* }
*/
};
// #2. Make a modal with automatic width & height.
const template = () => /*html*/ `
<button class="button primary" id="button" data-modal="lucky">LAUNCH MODAL</button>
<div class="modal" id="lucky">
<a href="#" class="close">×</a>
<h1 class="modal-body">Hello EPAM</h3>
</div>
<!-- For #5 question below -->
<form id="say-hi">
<select id="greeting" name="greeting">
<option value="">SELECT</option>
<option value="hello">Hello</option>
<option value="world">World</option>
</select>
<input id="msg" name="msg" />
<button type="submit" id="submit">UPDATE</button>
</form>
<div id="result"></div>
`;
// render
document.getElementById("app").innerHTML = template();
const button = document.getElementById("button");
const closeBtn = document.querySelector(".close");
button.addEventListener("click", (event: MouseEvent) => {
const modalTarget = (event.currentTarget as HTMLButtonElement).dataset.modal;
modalTarget && document.getElementById(modalTarget).classList.add("in");
});
closeBtn.addEventListener("click", (event: MouseEvent) => {
event.preventDefault();
(event.target as HTMLAnchorElement).parentElement.classList.remove("in");
});
// #5. A PubSub pattern to communite between components
const Hub = {
store: Object.create(null),
on(event: string, handler: (data: any) => void) {
if (!handler) {
throw new Error(`Pls offer a handler for event: ${event}`);
}
(this.store[event] = this.store[event] || []).push(handler);
},
off(event: string, handler: (data: any) => void) {
if (this.store[event]) return;
const i = (this.store[event] || []).findIndex(h => h === handler);
i > -1 && this.store[event].splice(i, 1);
},
emit(event: string, data: any) {
(this.store[event] || []).forEach(handler => handler(data));
}
};
const sayHi = document.getElementById("say-hi");
sayHi.addEventListener("submit", event => {
event.preventDefault();
const target = event.target;
Hub.emit("say-hi", {
greeting: (target as HTMLFormElement).elements.greeting.value,
msg: (target as HTMLFormElement).elements.msg.value
});
});
Hub.on("say-hi", ({ greeting, msg }) => {
const result = document.getElementById("result");
result.innerHTML = /*html*/ `${
greeting ? `You selected ${greeting}` : `You DO NOT select anything`
}, and filled ${msg ? msg : "with nothing"}`;
});
/**
* #3. Explain about event-loop
*
* Event loop is a sequence.
* If it's mepty, the event handler will be pushed into it and executed A.S.A.P.
* Otherwise, handler will be pushed, waiting all of prior ones to be called.
*/
// https://trello.com/b/X7rlgWEB/epam-interview
// Java - Write a function that adds up all the values in an array
// Java - What does the modifier final mean when – a)used on a class declaration b) used on a method declaration
// XML/Java- Whats a technology to use when you need to retrieve a small amount of data from a small XML file (id and name from a request for example), and provide pseudocode
// Oracle and Java - What would you use to make them talk to each other
// Java - add inheritance child override method question
public class Base {
public void baseCall(){
test();
}
public void test(){
System.out.println("Base.test() Executed");
}
}
public class Child extends Base {
public static void main(String[] args) {
Base baseRef = new Child();
baseRef.baseCall();
}
public void test(){
System.out.println("Child.test() Executed");
}
}
// Java Exceptions
public class TestClass {
public static void main(String args[]) {
try {
aMethod();
}
catch( NullPointerException npex ) {
System.out.println( "NullPointerException thrown " );
}
catch( Exception ex ) {
System.out.println( "Exception thrown " );
}
catch (Throwable th) {
System.out.println( "Throwable thrown " );
}
finally {
System.out.println( "Done with exceptions " );
}
System.out.println( "main is done" );
}
private static void aMethod() {
throw new IllegalArgumentException();
}
}
// Oracle - How often should you commit?
// Oracle - How do you determine which fields should be indexed?
// optimized SQL performance - explain how
// Oracle - A query is running slowly, what steps do you take to make it perform better?
// Oracle - When do you use an inner join in oracle? What is an outer join and what's an example use case?
// Oracle - If you had to move a column from a table to it's own table. What steps would you take, and what things would you need to consider?
// Sql - Tables: Product, Document, Relationship. Write a query that retrieves the 'published' relationships for the given product name.
looking for them to ask about:
- FKs
- what exactly a client, document and relationship are
- relationships between what?
select rr.*
from product p, document d, relationship r
where p.name = 'SQA'
and p.id = d.product_id
and d.id = r.source_document_id
and r.is_published = 1;
// REST - Walk me through the steps you would take to use that SQL query and make it available over and HTTP GET.
// suggest layers if they stumble, remember config
// XML - Can you explain the difference between a SAX and DOM XML parser
// XML - if you had to parse large xml files (500MB+ each), what would your approach be?
/*
looking for:
streaming
SAX
break into chunks
questions they should ask:
what is the output, goal of the parse?
*/
// Spring - What are the options for configuring beans
// Queues JMS - Purpose of backout queue
// Queues JMS - whats the difference between a queue and topic
// What agile methodology have you most worked in? What were it's pros and cons? What do you think is best and why?
// How long have you worked directly with Java, Oracle, XML, Spring, JMS, REST
// What piece of coding / component designed/implemented are you most proud of and why?
// Have you had to learn a new technology or framework on the job? What was your approach?
// Done any grails?
// Aspose - Are you familiar with Aspose-Words or Apache POI?
// Eclipse RCP - explain
// Big Text Structures - extract logical entities
// algorithm to build a word cloud
// javascript api - how did you document? anything automated?
// csv import - explain
// GAE - Google Cloud Storage
// Any backend work with XML files?
// Spring - annotations vs config files
// https://www.linkedin.com/learning/programming-foundations-data-structures-2/understand-data-structures?autoAdvance=true&autoSkip=false&autoplay=true&courseClaim=AQHUvBM3dJUo3gAAAX1IQI5387Boe7z30izXd6CQAo1UKzQDlztqd_-HlHghjrbeX0VraL4C0CZVxQPV-me3tTjXK42t5wvvJe-6iWgY66emJG5lfendPCAaS1yo_0CT0bOzkcMR_FykOsYt5ptn3WRnczRRDFlDxKaM2JWh7ogiCw-VZe7JJbGwJqqTGMQVIzZubzwqTdYfFulfZsI6QeGd8ryKqQJPNhaWjQAaIb7ioNWL_Fi-pr7ra4mZIZt9e7EViRUx2L4ApPwL9Bq_L6BuX9Ke2lIf5XpUy1XsG-XmBAJMoQ1FnVZAR0zcvkkY6ssjbaPB36K6NBNg0kGQFN0mfloo9KQdXJ0dY6mc6f5s82PPwm_B5eHoRfT0SvO3YbQ2a6IiiWTRcZ82KfeXlGIf9_Mb_K2K4uvK7RmevB7Ltc_Qbg1Y-atYpX6coVxGfObqBl5oW9zKao0THg2MXT3S3F4Y4iqGBt-giWCBKXzaqvN0Y4RNfaHI0q4p5Z0rDxfZu5jgpbpqFqJIrnQHRkSLTCrXZ1B9X1GSkdDuO94MKkeBYPSSyG0klWYeaiedsREzwW0VfWWgqcGovB1EpduYq2l7u7rfUl6SeI3EE00oqbSTlwHQMVaKyv_Z7obfsBd7HEPSpL5amwmo0aPhLeG-PmDj_5X3VBCaQjIMEl8sChnf1JpJhpIHxOolcALuR-KQX8PWTjMzdl2svyv_6RnRQzwv3YEifwsRPV4SlnraPwp5NcaTxJKe2l8&resume=true
// Coding test: 1. Given a string, find out if there's repeat characters in it.
/*
public class test
{
public static void main(String[] args) {
String str = "abdc";
char[] arr = str.toCharArray();
HashSet set = new HashSet();
for (char i : arr ) {
set.add(i);
}
if((set.size()) == (arr.length))
System.out.println("unique character");
else
System.out.println("repetition");
}
}
*/
// 2. SQL. Given a Customer table and a Payment table (with Customer ID as primary and foreign key), write a query to output a list of customers who have not paid their bills in the last 3 months.
// select a.customer_name from Customer a left join Payments p
// on p.cid =a.cid where DATEDIFF(day,p.lastPaymentDate,getdate())>90;
// https://github.com/robertkovacs93/Hackerrank_EPAM/tree/master/src/com/robertkovacs
// Level easy : Uniquess of integer array.
// Level medium : maximum streak problem.
// Level hard : Non - overlapping palinromic subsequence problem.
// Maximum streak (Dynamic Programming)
// Mobile numeric keypad problem.
// Least operators to express number
// Maximum vowel sub-string.
// A basic arithmetic problem (Using Hash-maps)
// Question based on graph(DFS, BFS).
// Reverse the palindromic sub-string.
// Given 8x8 chess board with (x1, y1) and (x2, y2) as co-ordinates where x1,y1 represents the co-ordinate of a queen and x2,y2 represent co-ordinate of a king. Find the no of ways the king can be placed in a chess board to win the game.
// Given an unsorted array. Find the minimum no of ways to equalize the array
// 1.>>find the final position of robot on 2d array after executing following commands UP,DOWN,LEFT,RIGHT . the robot starting position is at (0,0).
// 2.>>count the number of distinct substrings of a string.
// 3.>>sort the date(DD,MMM,YYYY) .
// 4.>>whether the string is a balanced parenthesized expression .
// 1. find the smallest and nearest value from the x index check only previous values in arr.
// if value is small than replace x with it
// if it is more than replace x with -1.
// 2 3 4 1 9
// output:
// -1 2 2 -1 1
// 2. print true if given paranthesisis balanced
// [({})]
// {(}
// output:
// true
// false
// 3. In 6 x 6 matrix add all the of hour glass items
// and print the maximum
// eg
// 0 0 0 2 2 2
// 0 0 0 0 2 0
// 0 0 0 2 2 2
// 4 4 4 1 1 1
// 0 4 0 0 1 0
// 0 4 0 1 1 1
// 2 2 2
// 2
// 2 2 2
// 18 20 7
// output:
// 20
// https://github.com/Ashwin7mak/hackerrank-react-challenges
// https://codesandbox.io/examples/package/h8k-components
// https://github.com/villalva03/hackerrank-react
// Sorting Articles
// https://codesandbox.io/s/9yupc?file=/src/App.test.js
// https://codesandbox.io/s/mub9z (with test, most upvoted, most down voted)
// https://codesandbox.io/s/w44vu
// https://codesandbox.io/s/we1eb (most upvoted, most down voted, title, reverse)
// https://codesandbox.io/s/xl7lc?file=/src/App.test.js
// https://github.com/GowriKrishnamurthy/React-sorting-articles
// https://github.com/Augani/hacker/blob/master/src/App.js
// Slideshow App
// https://codesandbox.io/s/vfl67
// https://codesandbox.io/s/y136j (with test)
// Country Filter
// https://codesandbox.io/s/e9eil?file=/src/App.js
// https://codesandbox.io/s/8tl7k (with test)
// Transaction Table
// https://codesandbox.io/s/hnmw5
// Calculator
// https://codesandbox.io/s/zlfnb?file=/src/components/calculator/index.js
// Favourite Movie Directory
// https://codesandbox.io/s/8wk5o
// Add Products To Cart
// https://codesandbox.io/s/t9g4z
/**
* 15 advanced Node JS interview questions and answers
* https://anywhere.epam.com/en/blog/advanced-node-js-interview-questions-answers
*
* 1. How do you decide whether to use Node.js Express or Node.js Nest based on the project size?
For smaller projects that require less structure and simplicity, Express can be a suitable choice. Express is a lightweight framework that is easy to set up and allows for flexibility in how you structure your application. It is ideal for building small to medium-sized applications where speed and simplicity are a priority.
On the other hand, for larger projects that require more organization and structure, Nest can be a better choice. Nest is a TypeScript-based framework that is built on top of Express, and it provides a more opinionated and structured approach to building applications. It includes features like dependency injection, modules, and decorators, which make it easier to manage larger and more complex applications.
In summary, if you're working on a smaller project that requires simplicity and speed, you might choose to use Express. However, if you're working on a larger project that requires more structure and organization, Nest might be a better choice. Ultimately, the decision between the two frameworks depends on the specific requirements and goals of your project.
test yourself in a tech interview with us
Ready for a real-life test of your skills? Send us your CV, pass prescreening, and get invited to a tech interview with our top experts at EPAM Anywhere.
yes, find me a job
checkmark icon
2. Explain 0auth2.0 and its benefits
OAuth2.0 is an authorization framework that allows a user to grant a third party application access to their resources without sharing their credentials (i.e., username and password). It is commonly used to enable users to authenticate and authorize applications to access their data and services without sharing their login credentials.
Here are some of the benefits of using OAuth2.0:
Improved security: OAuth2.0 provides an additional layer of security by eliminating the need for users to share their passwords with third-party applications. Instead, applications are authorized to access the user's resources with a token, which can be revoked by the user at any time.
Better user experience: OAuth2.0 eliminates the need for users to create separate accounts for each application they use. Instead, users can log in to an application using their existing credentials from a trusted provider (e.g., Google, Facebook).
Access control: OAuth2.0 allows users to control the level of access granted to each application. Users can choose to grant read-only access, read-write access, or full access to their resources.
Scalability: OAuth2.0 is widely adopted and supported by many major providers, making it easy for developers to integrate with multiple services and platforms.
Overall, OAuth2.0 provides a secure and convenient way for users to share their resources with third-party applications, without compromising their credentials or data.
3. Compare service-oriented architecture (SOA) and microservice architecture (MSA)
Service-oriented architecture (SOA) and microservice architecture (MSA) are two popular software architecture styles used for building complex software systems. While both of them are used for designing distributed applications, there are some fundamental differences between the two:
Architecture style: SOA is an architecture style that focuses on the decomposition of an application into loosely coupled services, whereas MSA is an architecture style that decomposes an application into independent, small and modular services.
Service granularity: SOA typically deals with larger, coarse-grained services that handle multiple functions, while MSA services are fine-grained and focused on performing a single function.
Communication mechanism: SOA relies heavily on web services and middleware for communication between services, while MSA primarily relies on lightweight communication protocols such as REST or messaging for inter-service communication.
Deployment: SOA services are typically deployed in a centralized manner, with a few large services running on dedicated servers, while MSA services are deployed in a decentralized manner, with small services running on their own servers or containers.
Development: SOA services are developed using a top-down approach, with a focus on standardization and reuse, while MSA services are developed using a bottom-up approach, with a focus on agility and flexibility.
Scalability: SOA services are less scalable than MSA services due to their larger size and centralized deployment, while MSA services are highly scalable due to their small size and decentralized deployment.
SOA vs Microservices in advanced Node.js developer interview questions
In summary, while both SOA and MSA are designed to build complex software systems, they differ in their architecture style, service granularity, communication mechanism, deployment, development approach, and scalability. SOA services are larger and more tightly coupled, while MSA services are smaller and more loosely coupled, making them easier to develop, deploy, and scale.
4. What does “low in coupling and high in cohesion” mean in backend development?
In backend development, "low in coupling and high in cohesion" refers to the design principles that aim to make software systems more modular, maintainable, and scalable.
Low coupling means that the components or modules of the system are designed to be independent of each other. In other words, they have minimal or no dependencies on each other. This design principle makes the codebase easier to maintain, test, and modify because changes in one module do not affect other modules in the system. It also allows for better scalability as new features can be added without disturbing the existing system.
High cohesion, on the other hand, refers to the design principle of grouping related functionality together within a module or component. This means that the functions or methods within a module have a common purpose and work together to achieve that purpose. This design principle also makes the codebase easier to maintain, test, and modify, as changes to one function or method affect only the related functionality.
In summary, low coupling and high cohesion are two important design principles that promote modularity, maintainability, and scalability in software systems. By minimizing dependencies and grouping related functionality, developers can create software systems that are easier to work with and modify, leading to a more stable and maintainable codebase over time.
Backend_inteview_questions_preview.png
related:
top 18 backend developer interview questions answered
read morego to
5. How do you ensure the security of backend systems?
There are several measures one can take to ensure the security of backend systems, including:
Secure coding practices: Ensuring that the code written for backend systems is secure is one of the most important ways to ensure system security. Developers should follow secure coding practices such as input validation, output encoding, and avoiding the use of vulnerable libraries.
Authentication and access control: Backend systems should implement strong authentication mechanisms such as multi-factor authentication and role-based access control. This ensures that only authorized personnel have access to the system.
Encryption: Backend systems should encrypt sensitive data at rest and in transit. This includes using secure communication protocols such as HTTPS and SSL/TLS for network communication.
Regular security testing: Regular security testing, including penetration testing and vulnerability assessments, can help identify and address security issues in backend systems.
Monitoring and logging: Backend systems should be continuously monitored for suspicious activity, and logs should be kept for audit and analysis purposes. This can help identify security breaches and provide insight into system weaknesses.
Regular updates and patches: Backend systems should be regularly updated with the latest security patches and updates to ensure that any known vulnerabilities are addressed.
Overall, ensuring the security of backend systems requires a holistic approach that includes secure coding practices, strong authentication and access control, encryption, regular security testing, monitoring and logging, and regular updates and patches.
6. What’s the difference between using PostgreSQL and MongoDB for Node.js server projects?
PostgreSQL and MongoDB are both popular databases used for Node.js server projects, but they have some key differences that can affect their suitability for specific use cases. Here are some of the main differences between the two:
Data structure: PostgreSQL is a relational database, which means it stores data in tables with predefined relationships between them. On the other hand, MongoDB is a NoSQL database that stores data as JSON-like documents.
Scalability: MongoDB is designed for scalability and can handle large amounts of unstructured data, making it a good choice for big data and real-time applications. PostgreSQL, on the other hand, may require more setup and optimization to handle large data sets.
Query language: PostgreSQL uses SQL, a standardized query language, while MongoDB uses its own query language, which is based on JavaScript. If you're familiar with SQL, PostgreSQL may be easier to work with, but if you're comfortable with JavaScript, you may prefer MongoDB.
ACID compliance: PostgreSQL is fully ACID-compliant, meaning it ensures data consistency and accuracy even in the event of a system failure. MongoDB, on the other hand, sacrifices some of the guarantees of ACID compliance in favor of performance and scalability.
Community and support: Both PostgreSQL and MongoDB have large and active communities, but PostgreSQL has been around longer and has a more established support network.
In summary, the choice between PostgreSQL and MongoDB largely depends on the specific needs of your Node.js project. If you need a database that can handle large amounts of unstructured data and prioritize scalability, MongoDB might be a better choice. On the other hand, if you require a fully ACID-compliant database with a proven track record, PostgreSQL may be a better fit.
Node_js_resume_preview.jpg
related:
Node JS resume example
read morego to
7. How do you decide when to implement caching in your backend systems?
Caching is a technique that can help improve the performance and scalability of backend systems by storing frequently accessed data in memory or on disk, allowing it to be retrieved more quickly. However, it's important to carefully consider when and where to implement caching, as it can also introduce complexity and potential tradeoffs.
Here are some factors to consider when deciding whether to implement caching in your backend systems:
Frequency of data access: Caching is most effective when data is frequently accessed and rarely updated. If a piece of data is only accessed once in a while, caching it may not provide a significant performance improvement.
Data size and complexity: Caching large or complex data structures can be expensive in terms of memory and processing overhead. It's important to balance the benefits of caching with the cost of storing and retrieving the cached data.
Latency and response time requirements: If your system requires very low latency and fast response times, caching can be an effective way to achieve those goals. However, if your system can tolerate some delay or variability in response times, caching may not be as important.
Scalability requirements: Caching can help improve the scalability of a system by reducing the load on backend databases or other services. If your system needs to handle high volumes of traffic, caching can be a valuable tool for managing that load.
Data consistency requirements: Caching introduces the potential for data inconsistency, since the cached data may not always be up to date with the latest changes. It's important to carefully consider the impact of stale or outdated data on your system and whether the benefits of caching outweigh that risk.
Overall, the decision to implement caching in your backend systems should be based on a careful evaluation of your specific requirements and constraints, taking into account factors such as data access patterns, latency and response time requirements, scalability, and data consistency.
8. How does the architecture of a Nest.js application differ from other Node.js frameworks like Express.js?
Nest.js is a popular Node.js framework that uses modern JavaScript and TypeScript features to build scalable and efficient applications. The architecture of a Nest.js application is based on the principles of the Model-View-Controller (MVC) design pattern and draws inspiration from Angular's architecture. Here's an overview of the architecture of a Nest.js application:
Modules: The application is divided into multiple modules, each responsible for a specific set of features. Each module contains its own set of controllers, services, and providers.
Controllers: Controllers are responsible for handling incoming HTTP requests and returning the appropriate HTTP responses. Controllers are linked to a specific route and can have multiple endpoints.
Services: Services are responsible for performing business logic and interacting with the data layer. Services can be shared across multiple modules and can have dependencies injected using the built-in dependency injection system.
Providers: Providers are a type of service that can be instantiated multiple times within a module. Providers can be used to create custom classes, factories, or utilities that can be used across the application.
Middleware: Nest.js supports middleware, which are functions that are executed before or after a request is handled by a controller. Middleware can be used to perform operations like logging, authentication, or error handling.
Compared to other Node.js frameworks like Express.js, Nest.js provides a more structured approach to building applications. Nest.js encourages the use of TypeScript and uses decorators to define controllers, services, and providers, which can help improve code readability and maintainability.
Nest.js also includes built-in support for features like dependency injection, middleware, and WebSocket support, which can help simplify application development. Additionally, Nest.js integrates well with other popular Node.js libraries like TypeORM and GraphQL, making it a popular choice for building scalable web applications.
9. How can you test Nest.js applications?
Nest.js applications can be tested using a variety of approaches. Here are some steps to consider:
Unit tests: Write unit tests for each module, service, controller, and other components of your application using a testing framework such as Jest. Ensure that each unit test runs independently of other tests and provides a clear, concise output of the results.
Integration tests: Test the interaction between the different modules and components of your application using integration tests. This will help you to identify any issues that may arise due to dependencies between different parts of your code.
End-to-end (e2e) tests: Use e2e testing frameworks such as Cypress or Protractor to test your application from the user's perspective. These tests simulate the user's actions and interactions with your application, and can help you to identify issues related to user experience and usability.
Mocking: Use mocking frameworks such as Sinon or Jest to simulate dependencies in your application. This will help you to isolate and test individual components without having to rely on external resources or services.
Code coverage: Use a code coverage tool such as Istanbul to ensure that your tests cover as much of your code as possible. This will help you to identify any areas of your code that are not being tested adequately.
Continuous integration (CI): Use a CI tool such as Travis CI or CircleCI to automate your testing process. This will help you to catch any issues early in the development process and ensure that your code is always in a deployable state.
By following these steps, you can ensure that your Nest.js application is thoroughly tested and ready for production.
10. What is an interceptor in Nest.js?
In Nest.js, an interceptor is a middleware that can intercept incoming requests and outgoing responses. Interceptors provide a way to modify the request or response objects, execute additional logic, or even terminate the request/response cycle prematurely.
Interceptors can be used to implement cross-cutting concerns, such as authentication, logging, error handling, and caching. They are registered globally, per module, or per controller and can be synchronous or asynchronous.
11. Can you describe the role of modules in a Nest.js project?
In Nest.js, modules are a fundamental building block of the application architecture. Modules help to organize and structure the codebase into smaller, more manageable units, which can be developed, tested, and deployed independently.
A module can be seen as a container for a specific feature or domain of the application. Each module can have its own controllers, services, providers, and other related components, which are encapsulated within the module's scope.
Modules can also be used to define the dependencies and relationships between different parts of the application. For example, a module can import other modules to access their functionality or export its own functionality for use by other modules.
Some of the key roles of modules in Nest.js include:
Encapsulation: Modules encapsulate related functionality, making it easier to reason about and maintain the codebase.
Dependency management: Modules define the dependencies of a feature or domain, ensuring that the necessary components are available and properly configured.
Reusability: Modules can be reused in other applications or projects, providing a modular and reusable architecture.
Testability: Modules can be tested in isolation, allowing for easier and more thorough testing of individual features or domains.
Overall, modules provide a powerful mechanism for structuring and organizing the codebase in a modular and maintainable way, which is essential for developing robust and scalable applications.
12. How would you describe a good approach to deploying a backend project?
Here is a step-by-step approach to backend project deployment:
Prepare your application for deployment: Before deploying your application, you need to ensure that it is properly configured and optimized for production use. This includes setting environment variables, configuring any necessary database connections, and optimizing any performance-related settings.
Choose a hosting provider: There are many hosting providers available that can host your Express application, such as AWS, Google Cloud Platform, Heroku, and Digital Ocean. Consider your budget, deployment needs, and other factors when selecting a provider.
Create a deployment environment: Once you have chosen a hosting provider, create a deployment environment that mirrors your production environment. This typically involves setting up a virtual machine or container with the necessary dependencies and configurations.
Install dependencies: Install any necessary dependencies using a package manager like npm. Ensure that you only include production dependencies, not development dependencies.
Build and bundle your application: Use a build tool like webpack or gulp to bundle your application's code and assets into a single file or set of files. This can help optimize performance and reduce load times.
Test your application: Before deploying your application, test it in your deployment environment to ensure that everything is working as expected. This may include functional testing, performance testing, or security testing.
Deploy your application: Once you are confident that your application is ready to be deployed, use a deployment tool like Git, FTP, or a CI/CD pipeline to deploy your application to your hosting provider.
Monitor and maintain your application: After deployment, monitor your application to ensure that it is running smoothly and perform regular maintenance tasks, such as updating dependencies and performing security updates.
Senior_software_engineer_interview_questions_preview.jpg
related:
top 23 senior software engineer interview questions
read morego to
13. Can you give an example of a project that required WebSocket communication?
Imagine you're building a real-time multiplayer game where players can move around a virtual world and interact with each other. To make this work, you need to establish a persistent, bidirectional communication channel between the game client (running in the player's web browser) and the game server (running on a remote server).
One way to achieve this is by using WebSockets. With WebSockets, the client and server can exchange data in real time, without the need for repeated HTTP requests/responses. The server can push updates to the client whenever something important happens (e.g., a player moves or scores points), and the client can send messages to the server whenever the player takes an action (e.g., moves, attacks, chats).
To implement this, you might use a WebSocket library like socket.io (for Node.js), which abstract away some of the lower-level details of WebSocket communication. You would need to create a WebSocket server on the backend, which listens for incoming WebSocket connections and handles incoming/outgoing messages. You would also need to create a WebSocket client on the frontend, which establishes a connection to the server and sends/receives messages as needed.
With this infrastructure in place, you could then implement the game logic on top of the WebSocket communication layer. For example, when a player moves, the client would send a "move" message to the server over the WebSocket connection. The server would receive this message, update the game state accordingly, and then broadcast the new state to all connected clients. Each client would receive the updated state and redraw the game world to reflect the changes. This would happen in real time, with no need for page refreshes or long polling.
15 technical interview life hacks
14. List pros and cons of using GraphQL vs REST API approaches
GraphQL and REST are both widely used approaches for building APIs.
Pros of GraphQL:
Flexible data querying: With GraphQL, clients can specify exactly what data they need, and the server will only return that data. This reduces the amount of over-fetching or under-fetching of data and makes it easier to manage complex queries.
Efficient data loading: GraphQL allows you to fetch multiple resources in a single query, which can improve performance and reduce network overhead.
Versioning is easier: With REST APIs, versioning is often a challenge. However, GraphQL's schema-based approach makes versioning easier since changes to the schema can be made without breaking existing clients.
Self-documenting: GraphQL APIs are self-documenting, meaning that clients can easily explore the API schema and understand how to use it.
Cons of GraphQL:
Increased complexity: GraphQL requires a more complex infrastructure, and it can be more difficult to implement than REST.
Caching can be difficult: Since GraphQL queries are often more dynamic than REST queries, caching can be more difficult to implement.
Learning curve: The learning curve for GraphQL can be steep, especially for developers who are used to working with REST APIs.
Pros of REST:
Simplicity: REST APIs are easy to understand and implement. They are a well-established standard and have a large community of developers working with them.
Caching is straightforward: REST APIs are designed to be cacheable, making it easy to implement caching strategies to improve performance.
No learning curve: REST APIs are simple and familiar to many developers, so there is no significant learning curve to get started.
Cons of REST:
Over-fetching or under-fetching of data: With REST APIs, clients often receive more data than they need, or not enough. This can lead to performance issues and wasted network resources.
Versioning can be difficult: With REST APIs, versioning can be challenging since changes to the API can break existing clients.
Multiple requests required: With REST APIs, clients often need to make multiple requests to fetch all the data they need. This can increase latency and network overhead.
In summary, GraphQL provides more flexibility and efficient data loading but comes with increased complexity and a steeper learning curve. REST APIs are simpler and easier to implement but can be less flexible and require more requests to fetch all the data needed. The choice between GraphQL and REST will depend on the specific needs of your project and the resources available to you.
GraphQL vs REST in Node JS advanced interview questions and answers
15. How do you ensure that your Nest.js applications are scalable and maintainable? What techniques or best practices do you follow?
Use modular architecture: Nest.js encourages a modular architecture that separates different parts of the application into modules. Each module should have a clear and specific responsibility, and modules can be easily added or removed as needed. This makes the application more scalable and easier to maintain.
Dependency injection: Nest.js uses dependency injection, which makes it easy to write testable and maintainable code. By using dependency injection, you can easily replace dependencies with mock objects during testing, and you can change the behavior of the application without changing the code.
Use pipes and filters: Pipes and filters are powerful tools in Nest.js that allow you to validate and transform data as it moves through the application. By using pipes and filters, you can ensure that data is valid and consistent, which makes the application more scalable and maintainable.
Use Interceptors: Interceptors are middleware functions that can be used to modify the behavior of HTTP requests and responses. By using interceptors, you can add common functionality, such as logging or error handling, to the application without duplicating code.
Use guards: Guards are middleware functions that can be used to control access to resources in the application. By using guards, you can ensure that only authorized users can access sensitive data or perform certain actions.
Use async/await: Nest.js makes heavy use of async/await, which allows you to write asynchronous code in a synchronous style. This makes the code easier to read and maintain, and it allows you to write scalable applications that can handle large amounts of traffic.
Use Swagger/OpenAPI: Nest.js integrates easily with Swagger/OpenAPI, which is a tool for documenting and testing APIs. By using Swagger/OpenAPI, you can ensure that your API is well-documented, which makes it easier for developers to use, and it allows you to test your API automatically.
Use TypeScript: Nest.js is written in TypeScript, which is a superset of JavaScript that adds static typing and other features to the language. By using TypeScript, you can catch errors at compile-time rather than run-time, which makes the code more robust and easier to maintain.
By following these best practices and techniques, you can ensure that your Nest.js application is scalable, maintainable, and robust.
*/
// https://www.glassdoor.co.in/Interview/EPAM-Systems-Javascript-Developer-Interview-Questions-EI_IE15544.0,12_KO13,33.htm
// Had to code some basic OOP things like classes and inheritance, and answer some advanced Javascript specific questions like closures, object instantiation, etc.
// Find the k-th maximum element in an array
// ----
// https://alitoshmatov.medium.com/interview-questions-for-javascript-developer-epam-s-bdb995c0fa20
// Q14. What do you mean by Quick Sort, and which is its pivot element?
// Q18. Could you explain Partition Algorithm used with the Quick Sort module?
// Q39. Explain how the stack can be implemented using the array.
// Q40. Write a program to implement abstraction
/**
* Job Description
Responsibilities
Work with UX Designers, Business Analysts and Product Managers to get the complete requirements and designs
Analyze requirements for technical feasibility and participate in designing the solution
Identify reusable components and build/update component library avoiding duplicate code
Translate designs and wireframes to produce quality code adhering to performance, readability, reusability best practices
Build pixel-perfect, buttery smooth responsive UIs for the mobile and the web
Diagnose and fix bugs and performance bottlenecks for performance
Participate in scrum team activities
Requirements
In-depth knowledge in JavaScript including ES6+ and Typescript
Expert in Node.js and frameworks available for it such as express, etc
Expert in node.js file system, HTTP module, Events, etc
Knowledge of functional and Object oriented programming
Experience with common FrontEnd tools like Webpack, gulp, npm, babel, etc
Proficient in writing Unit test, migration test, end-to-end test
Proficient understanding of code versioning tools, such as Git
Proficiency with RESTful APIs
Experience with the core AWS services
Experience with Docker and Kubernetes is a plus
Experience with micro-services using NodeJS
Understanding the nature of asynchronous programming and its quirks and workarounds
*/
// ----------------------------- //
// Random questions on NodeJS
// https://www.glassdoor.co.in/Interview/node-js-senior-software-engineer-interview-questions-SRCH_KO0,32_SDRD_IP6.htm
// ----------------------------- //
// quick sort
// Design an API endpoint for searching and filtering products
// How to archive multi thread in NodeJS?
// Different between fork() and spawn() in child process?
// What are exit codes in Nodejs
// What is piping in NodeJS?
// Theorical questions about Node. Async methods for APIs, differences from var, let and cost. Event queue...
// How to convert string into array and array into string?
// multi threading in node js
// basic node questions. questions about socket js
// What is deep copy and shallow copy? A matrix question to find cluster in it. How to search any text in 10k files using Node js
// what is hashmap and how it works
// - write a function that can be called like sum(2)(3)...(10)
// Node Js event loop architecture, diff between async await and promises, simple SQL queries
// Algo questions on Array, pointers, permutations etc.
// What's the difference between `var`, `let` and `const`?
// How does the event loop works in node.js?
// What is a closure
// What are javascript classes
// What are .bind, .call, .apply
// write a function to find an intersection in arrays
// What's the difference between nextTick vs setImmediate?
// Why is package.json used, What is the purpose of Javascript and what will happen to the session storage when you switch tabs or open new browser. How will you retain storage between browsers.
// Context of a function
// https://www.simplilearn.com/tutorials/nodejs-tutorial
// https://www.simplilearn.com/tutorials/nodejs-tutorial/nodejs-interview-questions
// https://www.fullstack.cafe/blog/node-js-interview-questions