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.
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()
A) addEventListener()
B) attachEventListener()
C) listenEvent()
D) eventHandler()
Books and other copyrighted content on various topics is available on private group -
https://t.me/+eweUkdFwlho4YjRl
https://t.me/+eweUkdFwlho4YjRl
Telegram
Resources
Miguel P. invites you to join this group on Telegram.
Give some suggestion.. Should I start blog or youtube channel?
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=="
}
}
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
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
Web Development CS JS Python JavaScript Hacking ReactJs Python django Flask CSS Frontend Backend Full Stack Java Node Pdf Books
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β¦
Make sure you are using HTML 5 semantic elements in your markup
What will be the output of the following JavaScript code?
Forwarded from Learn Python with Python Video Tutorial Python Course Python Note Python Book Python PDF Django Flask Python
If your goal is to be a Python expert in 2024, this thread is for you:
Here's what we will cover:
β A 12-months roadmap
β Some prerequisite activities
(described at the end of the thread)
β€ Month-1
Activity: Working with Data [1]
Effort: 2 hours daily w/ simple practice
β§ Boolean
β― bool
β§ Number
β― int
β― float
β― complex
β§ String
β― str
β§ Bytes
β― bytes
β― bytearray
β― memoryview
β€ Month-2
Activity: Working on Logic
Effort: 2 hours daily w/ simple practice
β§ Operators
β― Arithmetic
β― Assignment
β― Comparison
β― Logical
β― Precedence
β― Associativity
β§ Conditionals
β― If
β― Else
β― Elif
β§ Loops
β― while
β― for
β€ Month-3
Activity: Modularize your Code
Effort: 2 hours daily w/ simple practice
β§ Function
β― Definition
β― Arguments
β― Positional
β― Keyword
β― Return
β― Execution
β§ Module
β― Define
β― Import
β§ Scope and Namespace
β€ Month-4
Activity: Working with Data [2]
Effort: 2 hours daily w/ simple practice
β§ list
β§ tuple
β§ set
β§ frozenset
β§ dict
β€ Month-5
Activity: Working with Data [3]
Effort: 2 hours daily w/ simple practice
Learn about these modules
β§ datetime
β§ csv
β§ json
β§ logging
β§ re
β§ os
In addition,
β― Files
β― String Formatting
β― Named Tuples
β€ Month-6
Activity: Exam Time
Effort: 2 hours daily w/ rigorous practice
β¬ Build at least 5 simple projects (Example: Scientific Calculator, File Manager, etc.)
β¬ Revise previous topics.
β€ Month-7
Activity: Deep-dive Python Concepts
Effort: 2 hours daily w/ simple practice
β§ Iterators
β§ Generators
β§ Closure
β§ Decorators
β§ Exception Handling
β€ Month-8
Activity: Object Oriented Programming
Effort: 2 hours daily w/ simple practice
β§ Class
β§ Variable
β§ Method
β― Static Method
β― Magic Method
β§ Overloading
β§ Inheritance
β§ Property Decorators
β€ Month-9
Activity: Exam Time
Effort: 2 hours daily w/ rigorous practice
β¬ Build at least 3 projects using OO feature (Examples: FIFA World Cup, COVID Tracker, etc.)
β¬ Revise all previous topics.
β€ Month-10
Activity: Take it to next level [1]
Effort: 2 hours daily w/ simple practice
β§ Jupyter Notebook
β§ Spyder
β§ pip
β§ anaconda
β€ Last 2 months
Activity: Take it to next level [2]
Effort: 2 hours daily
β§ numpy
β§ pandas
β§ matplotlib
β§ scipy
P.S: Practice while learning
β€ Prerequisite: Know the History
Before start learning a language, read about its history.
β― Why and how did it come into existence?
β― How does it evolve over time?
β― What are its alternatives?
β― Where is it going to be a show-stopper?
β€ Prerequisite: Know the Ecosystem
β― Which version you should be using?
β― How to update to newer versions?
β― Where would you write a program?
β― How would you run a program?
β― What additional software do you need?
β― How would you include third-party libraries?
β€ Prerequisite: OS Challenge
Although the majority of languages strive to be similar across all operating systems, some dependencies may exist.
β― Which installation package to download?
β― How to install it?
β― What are the different commands available?
π Final Words
β¬ Though I have time bound it, you should try to cover everything based on your suitability.
β¬ Spend at least two hours per day learning and practicing.
β¬ With a proper structure and goal, it's never hard to learn Python.
Here's what we will cover:
β A 12-months roadmap
β Some prerequisite activities
(described at the end of the thread)
β€ Month-1
Activity: Working with Data [1]
Effort: 2 hours daily w/ simple practice
β§ Boolean
β― bool
β§ Number
β― int
β― float
β― complex
β§ String
β― str
β§ Bytes
β― bytes
β― bytearray
β― memoryview
β€ Month-2
Activity: Working on Logic
Effort: 2 hours daily w/ simple practice
β§ Operators
β― Arithmetic
β― Assignment
β― Comparison
β― Logical
β― Precedence
β― Associativity
β§ Conditionals
β― If
β― Else
β― Elif
β§ Loops
β― while
β― for
β€ Month-3
Activity: Modularize your Code
Effort: 2 hours daily w/ simple practice
β§ Function
β― Definition
β― Arguments
β― Positional
β― Keyword
β― Return
β― Execution
β§ Module
β― Define
β― Import
β§ Scope and Namespace
β€ Month-4
Activity: Working with Data [2]
Effort: 2 hours daily w/ simple practice
β§ list
β§ tuple
β§ set
β§ frozenset
β§ dict
β€ Month-5
Activity: Working with Data [3]
Effort: 2 hours daily w/ simple practice
Learn about these modules
β§ datetime
β§ csv
β§ json
β§ logging
β§ re
β§ os
In addition,
β― Files
β― String Formatting
β― Named Tuples
β€ Month-6
Activity: Exam Time
Effort: 2 hours daily w/ rigorous practice
β¬ Build at least 5 simple projects (Example: Scientific Calculator, File Manager, etc.)
β¬ Revise previous topics.
β€ Month-7
Activity: Deep-dive Python Concepts
Effort: 2 hours daily w/ simple practice
β§ Iterators
β§ Generators
β§ Closure
β§ Decorators
β§ Exception Handling
β€ Month-8
Activity: Object Oriented Programming
Effort: 2 hours daily w/ simple practice
β§ Class
β§ Variable
β§ Method
β― Static Method
β― Magic Method
β§ Overloading
β§ Inheritance
β§ Property Decorators
β€ Month-9
Activity: Exam Time
Effort: 2 hours daily w/ rigorous practice
β¬ Build at least 3 projects using OO feature (Examples: FIFA World Cup, COVID Tracker, etc.)
β¬ Revise all previous topics.
β€ Month-10
Activity: Take it to next level [1]
Effort: 2 hours daily w/ simple practice
β§ Jupyter Notebook
β§ Spyder
β§ pip
β§ anaconda
β€ Last 2 months
Activity: Take it to next level [2]
Effort: 2 hours daily
β§ numpy
β§ pandas
β§ matplotlib
β§ scipy
P.S: Practice while learning
β€ Prerequisite: Know the History
Before start learning a language, read about its history.
β― Why and how did it come into existence?
β― How does it evolve over time?
β― What are its alternatives?
β― Where is it going to be a show-stopper?
β€ Prerequisite: Know the Ecosystem
β― Which version you should be using?
β― How to update to newer versions?
β― Where would you write a program?
β― How would you run a program?
β― What additional software do you need?
β― How would you include third-party libraries?
β€ Prerequisite: OS Challenge
Although the majority of languages strive to be similar across all operating systems, some dependencies may exist.
β― Which installation package to download?
β― How to install it?
β― What are the different commands available?
π Final Words
β¬ Though I have time bound it, you should try to cover everything based on your suitability.
β¬ Spend at least two hours per day learning and practicing.
β¬ With a proper structure and goal, it's never hard to learn Python.
2250 congratulations π π π π₯³
Special :
Hard skills get you hired, but soft skills get you promoted.
9 soft skills to fast-track your career:
Hard skills get you hired, but soft skills get you promoted.
9 soft skills to fast-track your career:
π1