Web Development CS JS Python JavaScript Hacking ReactJs Python django Flask CSS Frontend Backend Full Stack Java Node Pdf Books
3.99K subscribers
878 photos
11 videos
995 files
354 links
One place for the latest in JavaScript, Python, Django, React, and more. Get top-notch tutorials, tips, and downloadable resources. Join us to elevate your tech skills!
Download Telegram
This javascript question is a bit advanced. If you get it correctly without thinking twice, you are a PRO🫑.
Hint: mapping over an array
#programming
Tip:

Take full-size screenshots of websites.

1. Open Dev Tools
2. Right-click on the <body> tag, and select "Node Screenshot"

Works in both Chrome and FF.
Sites for FREE HTML/CSS TemplatesπŸ”₯

🎯html5up .net
🎯htmlrev .com
🎯free-css .com
🎯templated .co
🎯freehtml5 .co
🎯startbootstrap .com
🎯bootstrapmade .com
🎯bootswatch .com
🎯bootstraptaste .com
🎯cruip .com
🎯styleshout .com
🎯tooplate .com
🎯html5xcss3 .com
πŸ‘4
Mastering data structures and algorithms can help you crack top programming jobs

Here’s 5 most popular DSA patterns asked in interviews:

Sliding Window:

Explanation: Sliding window problems involve maintaining a dynamic window over a sequential data structure (e.g., an array or string) and efficiently processing elements as the window "slides" from one position to another.

Sample Problem: Given an array of integers, find the maximum sum of any contiguous subarray of a fixed size k.


Binary Search:

Explanation: These questions involve efficiently searching for an element in a sorted data structure.

Sample Problem: Implement a binary search algorithm to find an element in a sorted array.


Two Heaps (or Priority Queues):

Explanation: This pattern involves using two heaps, typically a max-heap and a min-heap, to efficiently maintain and retrieve certain elements while satisfying specific conditions.

Sample Problem: Implement a data structure that supports adding elements and finding the median of the elements in constant time.


Graph Traversal

Explanation: These questions involve navigating through graphs or trees.

Sample Problem: Perform a breadth-first search (BFS) to find the shortest path between two nodes in an undirected graph.

Dynamic Programming:

Explanation: These questions require solving problems by breaking them down into smaller overlapping subproblems.

Sample Problem: Calculate the nth Fibonacci number using dynamic programming.
❀1πŸ‘1
Which function is used to add an event listener in JavaScript?

A) addEventListener()
B) attachEventListener()
C) listenEvent()
D) eventHandler()
Interview Question -
What is package-lock.json file in react/node projects?
Ans- The npm package manager automatically generates the package-lock.json file for each project. This lock file resolves a problem introduced by the use of semantic versioning for dependencies


β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”_

@javascript_resources
@python_assets

example of package-lock.json file

{
"name": "sample-express",
"lockfileVersion": 2,}

"requires": true,
"packages": {
"": {
"dependencies": {
"express": "^4.18.2"
}
},
"node_modules/accepts": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
"integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEhosdQ==",
--snip--
},
--snip--
"node_modules/express": {
"version": "4.18.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
"integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEI==",
"dependencies": {
"accepts": "~1.3.8",
--snip--
"vary": "~1.1.2"
},
"engines": {
"node": ">= 0.10.0"
}
},
--snip--
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+bfhskkh=="
}
}
πŸ‘2
You're a frontend engineer.

Your boss asked you this:

"For our project, should we use client-side or server-side rendering?"

Here's how to answer:

First of all, what does 'client' and 'server' mean? πŸ‘€

For 'Server', it obviously refers to the backend server that runs your code.

For 'Client', in web development context, we're usually talking about browser like Chrome or Safari.

So, what are client-side rendering (CSR) and server-side rendering (SSR)?

1️⃣ CSR means the rendering is managed by the JavaScript engine, in your browser.

2️⃣ SSR, means all dynamic elements are rendered on the server, and plain HTML contents are delivered to the client.


When deciding between CSR and SSR, you can think about:

Thin server vs. thin client (where should the code run?)
SSR is better for SEO (do you need SEO for your project?)

And there's also a technique called 'Rehydration' (CSR+SSR).

It converts client-side JavaScript into a static HTML web page, delivered either through static hosting or server-side rendering, by attaching event handlers to the HTML elements.

Bonus:

For rendering, generators and template engines, here's some go-to libraries:

β€’ React ➑️ NextJs, GatsbyJs
β€’ Vue ➑️ NuxtJs, Gridsome
πŸ‘4