0% found this document useful (0 votes)
1 views21 pages

Software Engineer Interview

The document provides a comprehensive overview of JavaScript basics, including ES6 features, interview preparation resources, and system design principles. It covers various topics such as currying, event loops, sorting algorithms, and memory management, along with practical coding examples and interview questions. Additionally, it discusses backend development concepts and includes links to external resources for further learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views21 pages

Software Engineer Interview

The document provides a comprehensive overview of JavaScript basics, including ES6 features, interview preparation resources, and system design principles. It covers various topics such as currying, event loops, sorting algorithms, and memory management, along with practical coding examples and interview questions. Additionally, it discusses backend development concepts and includes links to external resources for further learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

javascript basics

Javascript/es6
https://docs.google.com/document/d/1ZqWeTBRcnYMpjBYp3lcAf1ou4bQkoENzqcvS
16GHgqw/edit?tab=t.0#heading=h.brc5vz1c4c0

Just write for interview only:


https://docs.google.com/document/d/1IyuqwdE6WcQwRu5gb25uh5AqH8oQhEFK6g
C-32o5bAw/edit?tab=t.0

Backend developer interview :


https://docs.google.com/document/d/1Zx0mqi5Ey_FxJydzq2nbcsOmBRpUIyWJJiIrT
nU_PEU/edit?tab=t.0

Interview Preparation guide :


https://docs.google.com/document/d/1i01HAwgFuEjyvL11LYllJif5ScvnC
-ZzlE1AHSRa2KM/edit?tab=t.0#heading=h.sd6306c9oz8e

explainthis.io: https://www.explainthis.io/en/swe/js-zero-point-one-plus-
zero-point-two

System design:
https://docs.google.com/document/d/1nc75sQHkKNe4iEscJJAMeXPVS
k3ISngh_9Te1ZDgV8g/edit?tab=t.0#heading=h.dtal9bylx2ff

Why does 0.1 + 0.2 equal 0.30000000000000004?

JavaScript uses IEEE 754 64-bit double precision floating-point numbers

● Curing: Currying
is a technique of transforming function with
multiple arguments into a sequence of functions, each with a
single argument. https://dev.to/spukas/curring-in-javascript-1o45#:~:text=Currying
%20is%20a%20technique%20of,each%20with%20a%20single%20argument.

● Javascript most used built- in methods implementations


● Write own methods with same functionality as built-in methods
● Time complexity of hashmap crud and set crud and array crud, .slice(), .splice(),
subString(), subStr(), Number vs New Number, Array vs new Array, String vs New String
.prototype. In jS
● iterate hashmap (keys and values) using for… and .map and object.keys will work in
hashmap or not
● Iterate object (keys and values using for.. And map and object.keys
● iterate javascript set
● Javascript Date
● Sorting O(N log n) what is N here
● Javascript eventLoop
● Currying implementation
● Write a delay function in JS
● Callback vs Promise vs async await implementation
● Promise .all vs .race
● SetTime vs setInterval implementation and usecase
● thow vs new Error
● Hoisting and temporal dead zone
● Event Loop diagram, explanation and related all the tricky questions
● .prototype related interview questions
● Clouser
● Spread vs rest operator
● Destructuring array and object
● Arrow function vs regular function tricky questions
● Primitive vs no-primitive
● Pass by value vs pass by reference
● SyntaxError vs referenceError vs typeError
● Memory leak in javascript
● Garbage collector
● .call vs .bind vs apply
● try… catch..finally

● Build cloud music platform


● Build data with transaction feature
● Build parking lot system
● Build vending system
● Build booking system with locking just like DB ACID
● Class diagram in Javascript
● design pattern

Firefox uses merge sort. Chrome, as of version 70, uses a hybrid of merge sort and
insertion sort called Timsort.

The time complexity of merge sort is O(n log n). And space O(log n)
The time complexity of merge sort is O(n log n). And space O(1)

/*
design a database and listed ADD, UPDATE, DELETE commands to be expected.
Input would be as list of strings. ["ADD key1 value1"] ["UPDATE key1
value2"] ["DELETE key1"] read the entries and process required command.

Follow up: How can we handle transactions? Input can be like, START
TRANSACTION followed by some other inputs which should only be updated in
the database when COMMIT is received and can be rolledback in case ROLLBACK
is received.
*/

/**
* The question was to build a music player like Spotify with the following
functionality:
* - add_song (song_title:string) - Adds song to catalog and generates an
id starting with 1 -play_song (song_id:int, user_id:int)
* - Tracks a song played and by a given user
* -print_summary () - Prints song names and how many unique listens it
received sorted in descending order by unique listens
* -last_three_played_songs (user_id: int) Takes a userId and prints their
last 3 played songs
* -Update print_summary method to only print k songs, and ensure all
methods run better than O(N log N) solve this problem in functional
javascript
*/
nodejs
NodeJS -> https://github.com/learning-zone/nodejs-basics

How to write Custom Error Handler Middleware in Express.js using JavaScript:


https://dev.to/qbentil/how-to-write-custom-error-handler-middleware-in-expressjs-
using-javascript-29j1

At which point memory will leak:

function createLeak() {

const largeArray = new Array(1000000).fill('Leak');

return function () {

console.log(largeArray[0]);

};

const leak = createLeak()

More Closure related questions:


database
Code karle: which database and why ?

MongoDB: https://github.com/learning-zone/mongodb-basics/tree/master
system.profiler, local.oplog.sh, journaling
system design
● Jay Prakash HLD round clickpost: Design Code Deployment Pipeline
1. RabbitMQ
2. Kafka Architecture: https://blog.bytebytego.com/p/why-is-kafka-so-fast-how-does-it
3. Why kafka fast :
https://blog.bytebytego.com/p/why-is-kafka-fast

Kafka can send millions of messages per second as it uses sequential disk I/O to enable
a high-throughput message exchange. Sequential disk I/O is a storage system that
stores and accesses data from adjacent memory space, and it's faster than random disk
access.
4. Kafka vs RabbitMQ, which one to use and why ?
https://aws.amazon.com/compare/the-difference-between-rabbitmq-and-kafka/

5. What is JWT (JSON Web Token)? How does JWT Authentication work? JWTs can
be encrypted, but they are typically encoded & signed
6. JWT access token vs refresh token: https://www.geeksforgeeks.org/jwt-
authentication-with-refresh-tokens/
7. SSO: https://blog.bytebytego.com/p/what-is-sso-episode-7
8. DNS: https://www.youtube.com/watch?v=e2xLV7pCOLI
9.
10. CORS, Preflight request and OPTIONS Method: https://dev.to/didof/cors-preflight-
request-and-option-method-30d3
https://drive.google.com/drive/u/0/folders/1lfgJzUnpixsE-hsnrkpVtR-N6tq0FZI-

Ecommerce System design ( Eg : Amazon ): Concurrency issues handling


https://leetcode.com/discuss/interview-question/211415/interview-question-ecommerce-
system-design-eg-amazon-concurrency-issues-handling

Handling Distributed Transactions in the Microservice world


https://medium.com/swlh/handling-transactions-in-the-microservice-world-c77b275813e0

11. RPC and gRPC


12. Reverse Proxy: https://codeminion.hashnode.dev/proxy-and-reverse-proxy?
source=more_articles_bottom_blogs

13. HTTP vs GraphQL: https://youtu.be/yWzKJPw_VzM

14. Which http method best or support Idempotent apis: https://developer.mozilla.org/en-


US/docs/Glossary/Idempotent

15. HTTP api best practices or standard


16. Handle booking concurrent requests in a queue or what ? during sell or peak event
17. Horizontal scalable means pods or containers
18. Caching strategy
19. CAP theorem
20. Consist hashing
21. How you resolve conflicts with peers
project descission
DSA
1. https://leetcode.com/problems/subarray-sum-equals-k/
2. Count no of occurance

function run(input){
const hashMap = new Map();

function calculate(array){
array.forEach(element =>{

if(typeof element === 'string'){


if(hashMap.has(element)){
const count = hashMap.get(element);
hashMap.set(element, count + 1);
}else{
hashMap.set(element, 1);
}
};

if(Array.isArray(element) && element.length){


// process
calculate(element);
}

if(!Array.isArray(element) && typeof element === 'object' &&


Object.keys(element).length){

// process object
for(const [key, value] of Object.entries(element)){
if(typeof value === 'number'){
hashMap.set(key, (hashMap.get(key) || 0) + value);
}
}
}
});
}
calculate(input);
return hashMap;
};

console.log(run(['a', ['a', {b:2},'b',['c',{c:4},'d'],'e']]));


https://dev.to/alexmercedcoder/introduction-to-sorting-algorithms-in-javascript-b60

function quickSort(arr) {
if (arr.length <= 1) {
return arr;
}

let pivot = arr[Math.floor(arr.length / 2)];


let left = [];
let right = [];

for (let i = 0; i < arr.length; i++) {


if (i !== Math.floor(arr.length / 2)) {
if (arr[i] < pivot) {
left.push(arr[i]);
} else {
right.push(arr[i]);
}
}
}

return quickSort(left).concat(pivot, quickSort(right));


}

// Example usage
let array = [10, 7, 8, 9, 1, 5];
console.log("Sorted array:", quickSort(array));

3. Quick Sort in-place sorting

function partition(items, leftIndex, rightIndex) {


const pivotIndex = Math.floor((leftIndex + rightIndex) / 2);
const pivot = items[pivotIndex]; // Store the pivot value

while (leftIndex <= rightIndex) {


while (items[leftIndex] < pivot) { // Compare with the pivot value
leftIndex++;
}

while (items[rightIndex] > pivot) { // Compare with the pivot value


rightIndex--;
}

if (leftIndex <= rightIndex) {


[items[leftIndex], items[rightIndex]] = [items[rightIndex], items[leftIndex]];
leftIndex++;
rightIndex--;
}
}

return leftIndex;
}

function quickSort(items, leftIndex, rightIndex) {


leftIndex = leftIndex || 0;
rightIndex = rightIndex || items.length - 1;

const pivotIndex = partition(items, leftIndex, rightIndex);

if (leftIndex < pivotIndex - 1) {


quickSort(items, leftIndex, pivotIndex - 1)
}

if (rightIndex > pivotIndex) {


quickSort(items, pivotIndex, rightIndex)
}

return items
};

console.log(quickSort([ 10, 1, 9, 2, 8, 3, 7, 4, 6, 5 ]));

● Stack
● Queue
● Binary search
● Tow pointer
● Array
● string
Behavioural Interview Questi
Top Behavioural Interview Questions and example Answers for Software Engineers
https://pradeesh-kumar.medium.com/top-behavioural-interview-questions-and-
example-answers-for-software-engineers-c5c4df7ce5fe
Interview Experience
Regular Check Interview Experiences

Leetcode
Geeksforgeeks

1. HLD Questions:

2. LLD/Machine Coding Questions:

3. LeetCode Questions:

You might also like