Java Hyd Team
746 subscribers
986 photos
39 videos
670 files
690 links
https://teamhydteam.my.canva.site/

Can visit us on our website 😊
Still working on it 😊
Download Telegram
Write a java program to store some text into a disk file

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class StoreTextToFile {
public static void main(String[] args) throws IOException {
File file = new File("textfile.txt");
FileWriter writer = new FileWriter(file);
writer.write("This is some random text");
writer.close();
}
}
//Write a java program to store some text into a disk file

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class WriteToFile {
public static void main(String[] args) {
BufferedWriter bw = null;
try {
String text = "This is some text that will be written to the disk file";
FileWriter fw = new FileWriter("myFile.txt");
bw = new BufferedWriter(fw);
bw.write(text);
System.out.println("Text written to file successfully!");
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
try {
if (bw != null)
bw.close();
} catch (Exception ex) {
System.out.println("Error in closing the BufferedWriter" + ex);
}
}
}
}
a java program to store text in hard-disk

import java.io.*;

public class TextStorage {
public static void main(String[] args) {
String str = "This is a sample text to be stored in hard-disk";

try {
FileWriter writer = new FileWriter("text.txt");
writer.write(str);
writer.close();
}
catch (IOException e) {
e.printStackTrace();
}
}
}
AGE 30.pdf
1.1 MB
👍1
7 Interviews while hiring.
0 discussions while firing.

And you expect the employee to be loyal?

Dear Companies,

Once upon a time there was a species called..."Loyal Employee".

You lost him/ her when you fired them while they were driving to work!

That "Loyal Employee" isn't traveling to 2023.
BE LOYAL TO YOURSELF THAT'S MORE THAN ENOUGH
ALGORITHM YOU SHOULD KNOW for PREPARING SYSTEM DESIGN INTERVIEW 💡

🔺REQUIREMENTS :-
KNOW WHEN TO USE
KNOW HOW IT WORKS

1) BLOOM FILTER
It is a data structure designed to tell you, rapidly and memory-efficiently, whether an element is present in a set.
- use case :: Build a Web crawler

2) FRUGAL STREAMING
It uses only one unit of memory per group to compute a quantile for each group.
-use case :: Find the nth percentile of the data stream.

3) GEOHASH/ S2 GEOMETRY
A collection of efficient yet exact mathematical predicates for testing relationships among geometric primitives.
-use case :: Location-based search results with DynamoDb and Geohash.

4) HYPERLOGLOG
It is an algorithm for the count-distinct problem, approximating the number of distinct elements in a multiset.
-use case :: privacy-preserving traffic heat map for the city.

5) LEAKY BUCKET/ TOKEN BUCKET
A mechanism to control the amount and the rate of the traffic sent to the network.
-use case :: Design a scalable rate-limiting algorithm.

6) LOSSY COUNT
It is used to identify elements in a data stream whose frequency count exceeds a user-given threshold.
-use case :: Frequency count over the data streams.

7) OPERATIONAL TRANSFORMATION
It is used for supporting a range of collaboration functionalities in advanced collaborative software systems.
-use case :: Handling editing collision in Google docs.

8) QUADTREE/ RTREE
It is a two-dimensional analog of octrees and is most often used to partition a two-dimensional space by recursively subdividing it into four quadrants or regions.
-use case :: Find nearby interest points

9) RAY CASTING
It is the most basic of many computer graphics rendering algo that uses geometric algo of ray tracing.
-use case :: Using longitude and latitude, return the Country of the point.

10) REVERSE INDEX
It is an index of keywords that stores records of documents that contain keywords in the list.
-use case: Building a complete Tweet index.

11) RSYNC ALGORITHM
Used for reducing the cost of a file transfer by avoiding the transfer of blocks that are already at the destination.
-use case :: Streaming file Sync

12) TRIE ALGORITHM
Trie is an efficient information reTrieval data structure. Using Trie, search complexities can be brought to optimal limit (key length)
-use case :: Autocomplete features using Trie

13) STRING BUFFER
-use case ::  Banking transactions because it follows thread synchronisation

13) STRING BUILDER
-use case ::  BOOKMYSHOW OR IRCTC ticket booking because it NOT following thread synchronisation


collab credit - windsoon / ansh /Aman

#software #design #google #systemdesign #backend #backenddeveloper #softwareengineer #algorithms
Life throws you challenges all the time.

Sometimes when we least expect it.

Getting rejected from all the jobs.

Being made redundant at work.

Work hours extending into the night and weekends.

Or just not hitting the goals you wanted to, it can be easy to just say, “You know what? I give up.”

But giving up means you’ve let the hurdles win.

If you want something, you can’t expect the path to be easy.

If you want something, you have to want ALL of it.

The journey, the challenges, and the final result.

It’s all about mindset.

But I know that sometimes, resetting your outlook can be easier said than done.

If you’re in need of a mindset makeover, I’m here to help.

I’m launching my free masterclass on Monday, December 5th, where I’ll be guiding building your confidence and self-belief, as well as teaching you exactly how to stand out from the crowd so that YOU can be the one to land your dream job next.

Are you in?

#nailyourinterview #coaching #motivation #careeradvice #professionaldevelopment #interviews #jobseekers #growthacademy #mindset #success
public class Swastik {
public static void main(String...args){
int n=9;
int mid=(n+1)/2;
for(int i=1 ; i<=n ; i++) {
for(int j=1 ; j<=n ; j++) {
if( j==mid i==mid (i==1 && j>mid) (i<= mid && j==1) (i == n && j<=mid) || (i>= mid && j==n))
System.out.print("*");
else
System.out.print(" ");
}
System.out.println();
}
}
}
import java.util.Scanner;

public class kShapeAlphabets1 {

private static Scanner sc;

public static void main(String[] args) {

sc = new Scanner(System.in);
int i, j, alphabet;

System.out.print("Enter K Shape Alphabets Pattern Rows = ");
int rows = sc.nextInt();

System.out.println("Printing K Shape Alphabets Pattern");

for (i = rows - 1; i >= 0; i-- )
{
alphabet = 65;
for (j = 0 ; j <= i; j++ )
{
System.out.print((char)(alphabet + j) + " ");
}
System.out.println();
}

for (i = 1 ; i < rows; i++ )
{
alphabet = 65;
for (j = 0 ; j <= i; j++ )
{
System.out.print((char)(alphabet + j) + " ");
}
System.out.println();
}
}
}