Skip to content

Instantly share code, notes, and snippets.

View Babitabisht's full-sized avatar

Babita Bisht Babitabisht

  • New Delhi
View GitHub Profile

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

SOLID stands for:

S - Single-responsiblity Principle
O - Open-closed Principle
L - Liskov Substitution Principle
I - Interface Segregation Principle
D - Dependency Inversion Principle
  1. Single Responsibility Principle: A class should have one and only one reason to change, meaning that a class should have only one job.
  2. Open-closed Principle: Objects or entities should be open for extension but closed for modification.
@Babitabisht
Babitabisht / c2d-algo.js
Last active November 25, 2022 11:40
c2d-algo.js
const fs = require('fs')
const inputFolder = '/data/inputs'
const outputFolder = '/data/outputs'
async function processfolder(folder) {
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "[email protected]",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
{
"name": "DEMO",
"script": "/usr/bin/java",
"args": [
"-jar",
"demo-0.0.1-SNAPSHOT.jar"
],
"exec_interpreter": "",
"exec_mode": "fork",
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
version: '3'
services:
node-1:
image: docker:dind
privileged: true
command : dockerd-entrypoint.sh
networks:
- swarm-network
container_name: node_1
# aliases:
@Babitabisht
Babitabisht / Address.sol
Last active September 2, 2021 05:29
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.2+commit.bacdbe57.js&optimize=false&runs=200&gist=
pragma solidity ^0.4.24;
/**
* Utility library of inline functions on addresses
*/
library Address {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
/**
* @dev Contract module that allows children to implement role-based access
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";
/**
* @dev Contract module that allows children to implement role-based access