Skip to content

Instantly share code, notes, and snippets.

View anushshukla's full-sized avatar
💭
Silently and secretly building awesome applications

Anush Shukla anushshukla

💭
Silently and secretly building awesome applications
View GitHub Profile
@anushshukla
anushshukla / decode-str.js
Created January 18, 2023 23:01
Encode-Decode string count
var fs = require('fs');
const readline = require('readline');
const getDecodedStr = async (filePath) => {
let output = '';
let charCounts = [];
const rl = readline.createInterface({
input: fs.createReadStream(filePath),
crlfDelay: Infinity
@anushshukla
anushshukla / layoff-todo.md
Last active June 28, 2023 07:47
Layoff queries

Queries

  • What's the reason for layoff?
  • What's the reason for our individual termination?
  • When is the last day?
  • How can we retain the office properties?
  • When will receive the relieving and experience letters?
  • Could we please confirm that nothing related to layoff would be mentioned in the relieving and experience letters?
  • What are the severance package's benefits offered?
  • How will the leave encashment be adjusted?
  • How can we avail outplacement services?
@anushshukla
anushshukla / products-inventory-feed.md
Created January 16, 2023 07:52
System design questions

product feed ingestion design for an e-commerce platform

Requirements:

  • Product feeds are ingested into a kafka topic by several systems.
  • Product feed means all the inventory about products (quantity, price, name, brand, color, description,etc...)
  • We have to store them in a DB.
  • We have to expose one API which will give the details about products based on product id/color/category etc.
  • During the ingestion we have to do some processing, transformation etc

Product feed data examples

// Given an array of DISTINCT elements, rearrange the elements of array in zig-zag fashion in O(n) time.
// The converted array should be in form a < b > c < d > e < f.
// Example:
// Input: arr[] = {4, 3, 7, 8, 6, 2, 1}
// Output: arr[] = {3, 7, 4, 8, 2, 6, 1}
// Input: arr[] = {1, 4, 3, 2}
// Output: arr[] = {1, 4, 2, 3}
@anushshukla
anushshukla / eslintrc.yaml
Last active January 5, 2023 21:58
Typescript best Eslint configurations
root: false
parser: "@typescript-eslint/parser"
"parserOptions":
ecmaVersion: 2020
sourceType: "module"
# relative path to tsconfig file
project: "tsconfig.json"
env:
es6: true
node: true
@anushshukla
anushshukla / find-k-char-encrypted-repeat-str.ts
Created October 30, 2022 02:24
Find K’th Character of Decrypted String
function getCharAtPos(str, pos) {
let letters = [];
let repeats = 0;
let positionToFind = pos;
let currIndex = 0;
for (const char of str) {
// console.log({ char, letters, positionToFind, currIndex, repeats });
currIndex++;
if (char.match(/[a-z]/i)) {
if (repeats > 0) {
@anushshukla
anushshukla / job-checklist.md
Last active April 19, 2023 05:32
Job checklist

Benefits

  • Is the hiring budget for the given role expectable?
  • How much medical insurance is provided?
  • Is the designation suitable?
  • Are the responsibility for the job within aspirations or/and expertise?

Culture

  • How many leaves are provided?
  • What is office location?
  • What is the working model?
@anushshukla
anushshukla / agile-best-practices.md
Last active October 4, 2022 13:03
Software development and management best practices

Scrum

  • BAU projects
  • 2 weeks sprints with exceptions at times.
  • First day of sprint should be backlog grooming and sprint planning sessionn.
  • DSM (Daily Stand-up meetings) should be conducted with precise answers to below questions
    • What did you do yesterday?
    • What will you do today?
    • What is blocking your progress?
  • Last day of sprint should be a review of sprint with retrospection session.
  • Last day of project sprint should be a post mortem of the project with retrospection session.
@anushshukla
anushshukla / merge-sort.ts
Last active April 30, 2023 20:16
Sorting implementation (Typescript)
const isBothArraySame = (a: any[], b: any[]) => !!a && !!b && !(a < b || b < a);
const mergeSort = (nums: number[]): number[] => {
if (nums.length < 2) {
return nums;
}
if (nums.length === 2) {
const currentNum = nums[0];
const nextNum = nums[1];
return currentNum <= nextNum ? [currentNum, nextNum] : [nextNum, currentNum];
@anushshukla
anushshukla / pull-request-checklist-template.md
Last active November 21, 2022 09:25
Pull / Merge request checklist template

Functionality Checklist

  • Environment variables are up-to-date
  • Infra changes are provisioned
  • Business logic compliant
  • Required migration scripts added
  • Changes are backward compatible
  • Breaking changes if any, information is broadcasted to relevant audience
  • Self review of the PR is completed
  • Internal team / peer review of the PR is completed