Java Programs
Small programs train you to combine if, loops, and print. First read: what is input, what is output? Dry-run on paper with a tiny example. Then code the normal case.
After it works, test edges: 0, 1, negative, empty. Starter set every fresher should write from memory: sum 1 to n, factorial, even/odd count, a simple star pattern.
In interviews, speak your plan while coding. Jumping into code with no dry-run multiplies bugs. Keep three tiny programs you can write in under five minutes.
Let's take this on the board with one tiny Main class — no extra files. Java Programs — output: 15. 1+2+3+4+5. Trace sum on paper before you compile. Start from main, go line by line, and stop at each print. That output is the proof for Programs.
Keep sum, factorial, and one pattern ready from memory.