Skip to content

JapneetSachdeva1/JavaCodingQuestionsPractice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A collection of Java utility programs to demonstrate problem-solving techniques for strings, arrays, and basic programming challenges. Ideal for practice or as references for coding interviews.

Skills Gained:

  • String Manipulation
  • Array Processing
  • Character Frequency Analysis
  • Handling Special Characters
  • Substring Generation
  • Sorting and Reordering Elements
  • Iterative Problem Solving
  • Debugging Java Programs
  • Optimizing Algorithms
  • Modular Code Design

Key Files and Descriptions

  • ReverseString.java: Reverses a given string character by character.
    Example: Hello WorlddlroW olleH

  • ChangeSpecialCharacter.java: Replaces a specific special character with another.
    Example: Hello @JapneetHello _Japneet

  • ReverseSentence.java: Reverses the order of words in a sentence.
    Example: Hello I am JapneetJapneet am I Hello

  • FindFirstNonRepeatedCharacter.java: Finds the first non-repeated character in a string.
    Example: swissw

  • RemoveAllSpecialCharacters.java: Removes all special characters from a string.
    Example: Hello^^%#$(!)_+ J@apneetHello Japneet

  • RemoveDuplicateWordsFromSentence.java: Removes duplicate words in a sentence.
    Example: Hello I am Japneet Japneet amJapneet am

  • RemoveWhiteSpaces.java: Removes all white spaces from a string.
    Example: Hello JapneetHelloJapneet

  • MoveNegativeNumbersToStart.java: Moves all negative numbers to the beginning of an array.
    Example: [-1, 2, 3, -4, -7, 8][-1, -4, -7, 2, 3, 8]

  • FindRepeatingElements.java: Identifies elements that repeat in an array and their counts.
    Example: [4, 2, 3, 5, 1, 2, 4]4: 2 times, 2: 2 times

  • ExtractLast4CharactersOfString.java: Extracts the last 4 characters of a string.
    Example: swisswiss

  • FindMaximumDifference.java: Finds the maximum difference between the largest and smallest elements in an array.
    Example: [10, 90, 2, 40, 1, 25]89

  • ReverseEachWord.java: Reverses each word in a string.
    Example: Hello WorldolleH dlroW

  • PrintAllTheSubstrings.java: Prints all substrings of a string.
    Example: abca, ab, abc, b, bc, c

  • FindLargestSmallestAnd2ndLargest.java: Finds the largest, smallest, and second-largest numbers in an array.
    Example: [23, 5, 1, 89, 65]Largest: 89, 2nd Largest: 65, Smallest: 1

  • PrintFirstLetterOfString.java: Extracts and prints the first letter of each word in a string.
    Example: Hello I am JapneetH I a J

  • PrintWordsVowelsFrequencyofeachCharacter.java: Prints the total word count, count of vowels, and frequency of each character.

napkin-selection (2)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages