May 27, 2024

Top Books for #systemdesign #sql #java #shellscripting #ruby & More! 📚💡



🌟 Master System Design and More! 🌟
Looking to boost your skills in system design, SQL, Java, shell scripting, and Ruby? Check out my latest YouTube video, where I recommend the top books that have helped me excel in these areas. 📚✨

DB Book
SQL Cookbook: Query Solutions and Techniques for All SQL Users, Second Edition
https://amzn.to/4bNWhOh

Shell Scripting Book
Classic Shell Scripting: Hidden Commands that Unlock the Power of Unix
https://amzn.to/3V7eEbs

Java Books
Effective Java
https://amzn.to/4bughFU
Java Concurrency in Practice, 1e
https://amzn.to/3yvafGA
Java Performance: In-Depth Advice for Tuning and Programming Java 8, 11
https://amzn.to/3Kch8Pv
Seven Concurrency Models in Seven Weeks: When Threads Unravel
https://amzn.to/3Kch2r7
Reactive Systems in Java: Resilient, Event-Driven Architecture with Quarkus
https://amzn.to/4bnvIQe

Design and System Design Books
Head First Design Patterns: Building Extensible and Maintainable
https://amzn.to/4e1d6Ya
Designing with Objects - Object-Oriented Design Patterns Explained with Stories
https://amzn.to/3V95sTX
Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable
https://amzn.to/3V9y4wj
System Design Interview: An Insider's Guide – Volume 1
https://amzn.to/4bOLP9e
System Design Interview: An Insider's Guide – Volume 2
https://amzn.to/3Vb28aY
Cracking Microservices Interview
https://amzn.to/3WSdcv8
Data Mesh: Delivering Data-Driven Value at Scale
https://amzn.to/3WRv8pr

PM book:
Cracking the PM Career: The Skills, Frameworks, and Practices To Become a Great Product
https://amzn.to/44RcYpO

Ruby Books
Head First Ruby: A Brain-Friendly Guide
https://amzn.to/4bLk3ud
Ruby on Rails For Beginners: Rails Web Development Programming and Coding Tutorial
https://amzn.to/4aLyii5
Head First Rails: A Learner's Companion to Ruby on Rails
https://amzn.to/4ayhlr7

hashtagsystemdesign hashtagsql hashtagjava hashtagshellscripting hashtagruby hashtagbookrecommendations hashtagprogramming

May 25, 2024

#dsa #book: Mastering Data Structures and Algorithms | Deep Dive into DSA


Join us on a journey to master Data Structures and Algorithms (DSA) with our comprehensive guide! In this video, we delve deep into DSA topics, providing detailed explanations, algorithms, and practical examples. Learn essential DSA concepts topic-wise, enhance your problem-solving skills, and prepare for coding interviews like a pro. Plus, get valuable interview preparation tips inspired by Bruce Lee's philosophy of continuous improvement. Don't miss out on this ultimate guide to DSA mastery!

Topic Wise:

Author : Meenakshi & Kamal Rawat

Author: Aditya Chatterjee

Deep Dive Books:

Author: Sanjoy Dasgupta

Author: Tim Roughgarden

Interview Books:

Author: Amit Prakash 

Author: Hemant Jain

March 21, 2021

Sappient : Star Pattern problem



Question: WAP to print the number in the below format.
star pattern for size :7
    1
   232
  34543
 4567654
  34543
   232
    1


Answer :

December 26, 2020

Maximum size square sub-matrix with all 1s

 

Maximum size square sub-matrix with all 1s

 Approach: Think how you what information you are getting while traversing  the matrix. I find that while traversing the matrix i try to store that how many ones i have encountered  in past. So that is the key of solve the problem, just use your memory/result to get the result. Maximum size square can find as maximum number in the result matrix.

it can used to print the small matrix, but in actual there can be multiple places where you can find the square size coordinates.so returning the maximum size can solve the problem. To get the coordinates we in count how many max size matrix we have then we can try to use it.that coordinates with max square sum.

complexity space:(m*n) time: O(m*n)

December 23, 2020

Print different views of Tree like a Top, Bottom, Left, Right?

Question: Print different views of Tree like a Top, Bottom, Left, Right?

Problem link: https://www.hackerrank.com/challenges/tree-top-view/problem
Answer 
I am using Recursive approach to solve this Question, As it is easier to understand and explain, but it can lend up in stack overflow problem in case of a huge tree. It is good if we have some idea about the iterative approach. Followup Question may be asked that is the internal working of TreeMap and its data structure and its time complexity of inserting the data and traversing it.
1. TopView
 
To solve this Question, First, start thinking about how we can traverse the tree.
We can use recursion with the base condition that starts traversing left part of the tree and then right part. Here we got the hit that if we maintain horizontal distance from the root node that can give us the Top/Bottom view tree. 
To get the particular tree we use the level to get the specific Top/Bottom view tree.
Pair is a class that holds the two number that is node value and its level.
Time Complexity: O(n)
Space Complexity: O(n)
2. Bottom View
Only this below condition is changed.In order to get the bottom view of tree.
!map.containsKey(dist) || level >= map.get(dist).level
Time Complexity: O(n)
Space Complexity: O(n)
3. Left View 
now, this becomes easier as here we just need to maintain the max level till now while doing pre-order traversal.
Time Complexity: O(n)
Space Complexity: O(1)
4.Right View
now, this becomes easier as here we just need to maintain the max level till now while doing post-order traversal.
Time Complexity: O(n)
Space Complexity: O(1)
Code Solution :
Console 
6
1 2 5 3 6 4
Tree:  
  1
    \
     2
      \
       5
      /  \
     3    6
      \
       4
Top View: 
1 2 5 6 
Bottom View: 
1 3 4 6 
Left View: 
1 2 5 3 4 
Right View: 
1 2 5 6 4 

March 29, 2020

Google Code jam 2019 | Qualification Round | Foregone Solution


Problem: Someone just won the Code Jam lottery, and we owe them N jamcoins! However, when we tried to print out an oversized check, we encountered a problem. The value of N, which is an integer, includes at least one digit that is a 4... and the 4 key on the keyboard of our oversized check printer is broken.

Fortunately, we have a workaround: we will send our winner two checks for positive integer amounts A and B, such that neither A nor B contains any digit that is a 4, and A + B = N. Please help us find any pair of values A and B that satisfy these conditions.

Input

The first line of the input gives the number of test cases, T. T test cases follow; each consists of one line with an integer N.

Output

For each test case, output one line containing Case #x: A B, where x is the test case number (starting from 1), and A and B are positive integers as described above.
It is guaranteed that at least one solution exists. If there are multiple solutions, you may output any one of them. (See "What if a test case has multiple correct solutions?" in the Competing section of the FAQ. This information about multiple solutions will not be explicitly stated in the remainder of the 2019 contest.)

Solution :
Problem link: https://codingcompetitions.withgoogle.com/codejam/round/0000000000051705/0000000000088231?show=progress