You can prepare for a Java internship coding round in 14 days if you spend each day on a narrow set of array, string and collections problems, time every attempt and log every failure. Most first-round tests reward clean, correct code on common patterns, not exotic algorithms. The plan below is built around that, with a timing tracker and an error log you can copy.
What a Java internship coding round usually tests
Formats differ by company, so treat this as a general pattern rather than a rule. Short online screens often give two or three problems in 45 to 90 minutes, and a live interview may ask for one problem plus follow-up questions on how your code behaves. The topics that appear most often at the entry level are:
- Arrays: two pointers, prefix sums, sliding window, in-place rotation, sorting-based tricks.
- Strings: palindromes, anagrams, character frequency, substring search, parsing.
- Collections:
ArrayList,HashMap,HashSet,ArrayDeque,PriorityQueue,TreeMap, and comparators. - Java fundamentals:
equalsversus==, immutability, autoboxing, generics, exceptions.
Enterprise Java roles add questions on object-oriented design and the standard library. In a screening round, though, fluent use of the standard library on small problems is what gets you through.
Java-specific idioms that save time and avoid silly bugs
Many failed attempts come from Java habits rather than weak logic. Keep this table beside you while practising.
| Situation | Idiom to use | Trap to avoid |
|---|---|---|
| Comparing strings | a.equals(b) |
a == b compares references and may pass or fail unpredictably |
| Comparing boxed values from a map | .equals() or unbox to int first |
map.get(x) == map.get(y) on Integer objects |
| Counting frequencies | map.merge(k, 1, Integer::sum) or getOrDefault |
Calling map.get(k) + 1 on a missing key, which throws NullPointerException |
| Grouping values | computeIfAbsent(k, x -> new ArrayList<>()).add(v) |
Forgetting to create the list before adding |
| Building strings in a loop | StringBuilder with append and reverse |
s += c in a loop, which is quadratic |
| Sorting objects or arrays of arrays | Comparator.comparingInt(...) or Integer.compare(a, b) |
Returning a - b, which can overflow |
| Sorting descending | Use Integer[] with Collections.reverseOrder() |
Arrays.sort(int[], comparator) does not compile |
| Printing an array | Arrays.toString(arr) |
System.out.println(arr) prints a reference |
| Midpoint in binary search | lo + (hi - lo) / 2 |
(lo + hi) / 2 can overflow |
| Removing while iterating | Iterator.remove() or removeIf |
Calling list.remove inside a for-each, which throws ConcurrentModificationException |
Removing by value from List<Integer> |
list.remove(Integer.valueOf(5)) |
list.remove(5) removes the element at index 5 |
| Quick fixed lists | new ArrayList<>(Arrays.asList(...)) if you need to modify it |
Arrays.asList and List.of do not allow adding or removing |
| Stack or queue | ArrayDeque |
The legacy Stack class and LinkedList without a reason |
Custom keys in HashMap or HashSet |
Override both equals and hashCode |
Overriding only one of them |
| Characters to indices | c - 'a' with an int[26] |
Assuming input is lowercase without checking |
Free 2-Week CareerSwami Internship
Online, 14 days, with a free offer letter and a free completion certificate once you finish the work. Check with your college that it fits your requirement before you enrol.
The 14-day Java practice schedule: arrays, strings and collections
Some prep guides use three-week plans. This one is compressed into 14 days, which also matches the length of a two-week internship. If you have more time before your test, repeat days 8 to 13 with new problems rather than adding new topics. Plan for 90 to 120 focused minutes a day, and put the first 15 minutes into reviewing yesterday’s error log.
| Day | Focus | Practice (3 to 4 problems each) | Java idioms to drill |
|---|---|---|---|
| 1 | Array basics | Find max and second max, reverse in place, remove duplicates from a sorted array, move zeroes | Arrays.toString, Arrays.fill, Arrays.copyOfRange, index bounds |
| 2 | Two pointers and prefix sums | Pair with given sum in a sorted array, subarray sum, running totals, merge two sorted arrays | Using long for sums, off-by-one checks |
| 3 | String basics | Palindrome check, reverse words, count vowels, first non-repeating character | charAt, toCharArray, StringBuilder, equals |
| 4 | String patterns | Valid anagram, longest common prefix, compress a string, check rotation | int[26] counters, Arrays.equals, split with regex pitfalls |
| 5 | HashMap and HashSet | Two sum, contains duplicate, group anagrams, majority element | getOrDefault, merge, computeIfAbsent, entrySet |
| 6 | Sliding window | Longest substring without repeats, max sum of size k, minimum window length | HashSet add/remove in a window, Math.max |
| 7 | Timed mock 1 | Three mixed problems in 60 minutes | Fill in the tracker and error log in full |
| 8 | Sorting and comparators | Merge intervals, sort by frequency, sort strings by length then alphabetically | Comparator.comparingInt, thenComparing, Integer.compare |
| 9 | Stack and queue | Balanced brackets, next greater element, queue using stacks, sliding window maximum | ArrayDeque methods: push, pop, peek, offer, poll |
| 10 | PriorityQueue and TreeMap | Kth largest element, top K frequent, merge K sorted lists (lite), floor/ceiling queries | Min-heap versus max-heap, comparator lambdas, TreeMap.floorKey |
| 11 | Binary search on arrays | Search in a sorted array, first and last occurrence, rotated array search, square root | Safe midpoint, loop invariants, Arrays.binarySearch return values |
| 12 | Timed mock 2 | Three problems in 60 minutes, at least one string and one collections problem | Update tracker and log, then compare with mock 1 |
| 13 | Repair day | Redo every problem in your error log that took over its target time or failed | Your five most frequent error types |
| 14 | Final mock and explanation drill | Two problems in 45 minutes, then explain each solution aloud in two minutes | Stating time and space complexity in one sentence |
Rules for each practice session
- Read the problem, then write down two or three edge cases before typing any code.
- Say the brute-force approach and its complexity, then improve it.
- Write code in a plain editor, or an online editor with autocomplete off, at least twice a week. Many assessment platforms offer little help.
- Dry-run the code on a small example by hand before running it.
- Record the attempt in your tracker immediately, while you still remember what slowed you down.
Timing tracker for Java coding practice
A tracker shows whether you are slow because of thinking, typing, or debugging. Copy this layout into a spreadsheet or notebook. The rows below are blank templates, not real data.
| Date | Problem | Topic | Target (min) | Time to first approach | Time to working code | Debug time | Passed first run? (Y/N) | Edge cases checked? (Y/N) |
|---|---|---|---|---|---|---|---|---|
| Array | 20 | |||||||
| String | 20 | |||||||
| Collections | 25 |
Suggested targets for easy problems are 15 to 20 minutes and for medium problems 25 to 35 minutes. Adjust them after your first mock. Review the tracker weekly with three questions:
- Is most of your time going to understanding the problem, writing code, or debugging?
- Which topic has the lowest first-run pass rate?
- Do you skip edge-case checks when you are short of time?
Error log template for failed Java attempts
A failed attempt is useful only if you record why it failed. Write the cause in one sentence, not just “wrong answer”.
| Date | Problem | Symptom | Root cause | Category | Fix and rule for next time | Redo date |
|---|---|---|---|---|---|---|
| Illustrative | Count character frequency | NullPointerException on first occurrence of a letter |
Called map.get(c) + 1 for a key not yet in the map |
Java API | Use merge or getOrDefault for every counter |
Day after |
Use a short fixed list of categories so patterns show up: Java API, logic, edge case, complexity, misread problem, typing or syntax, time management. After a week, count entries per category. If “edge case” leads, add a mandatory edge-case line to your routine, such as empty input, single element, duplicates, negatives and very large values.
Worked example: two sum with HashMap, including a logged mistake
This is an illustrative walk-through, not a record of tests that were run. The problem: given an integer array and a target, return the indices of two elements that add up to the target.
Step 1, brute force. Two nested loops check every pair, which takes O(n²) time. State this first, then improve it.
Step 2, improvement. While scanning, store each value and its index in a HashMap. For each element, check whether target - nums[i] was already seen. This takes O(n) time and O(n) space.
import java.util.*;
static int[] twoSum(int[] nums, int target) {
Map<Integer, Integer> seen = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
int need = target - nums[i];
Integer j = seen.get(need);
if (j != null) {
return new int[] { j, i };
}
seen.put(nums[i], i);
}
return new int[0];
}
Step 3, edge cases to say aloud. An empty array returns an empty result. Duplicate values such as [3, 3] with target 6 work because the lookup happens before the current value is stored. Negative numbers work the same way. If the problem guarantees exactly one answer, say so, and ask what to return otherwise.
Step 4, the logged mistake. A common first attempt calls seen.put(nums[i], i) before the lookup. With [3, 2, 4] and target 6, the first element would match itself. Log it as: category logic, root cause “stored current element before checking”, rule “look up first, then insert”. Another trap is writing if (seen.get(need) == null) and then using the result as an int, which fails by unboxing a null. Storing the result in an Integer variable, as above, avoids that.
Preparing for a Java coding round: JC Bose YMCA internship rules to check first
Practising code is only half the preparation. If you want an internship to count toward your degree, the university’s rules decide what is acceptable. The following points come from published university documents; read the current versions yourself, because some are undated.
The Training & Placement Cell’s Training Rules say B.Tech students in Computer Engineering, IT, Mechanical, Electrical and Electronics do a 6 to 7 month internship in the 8th semester, from 1 January to 30 June each year, and MCA students do six months of project training in the 6th semester over the same dates. The same document says internships are allowed only in industry or R&D labs, training at an institute or academy is not allowed, trainings where the student pays are not allowed, and every internship needs prior T&P Cell approval. Before training starts you submit a training file that includes the T&P training letter, the industry offer letter, a no-dues certificate, mark sheets, a CV and an undertaking, among other items.
Those rules appear to cover the University Teaching Departments, not affiliated colleges. The official even-semester calendar refers to both kinds of institution, and gives 30 June 2026 as the due date for training, thesis and project reports. A separate T&P policy excerpt lists training forms T01 to T10 and T19, including an undertaking for interns marked 2020 batch, so treat the form list as possibly out of date.
What this means for your Java preparation: a long 8th-semester internship is usually selected through company hiring rounds, so the coding practice above matters. A short, free, online programme is a different thing. The documents above say nothing about online internships, so do not assume one counts toward your semester requirement. You can use the free two-week online internship from CareerSwami, which gives a free offer letter and a free completion certificate after successful completion, as extra practice and a portfolio item. It is independent of your university. Do not treat it as a substitute for the T&P-approved internship until the Cell tells you in writing how it will be treated.
Verification steps for JC Bose YMCA students before you apply
- Email the internship contact listed on the T&P Cell contact page (tnpcell@jcboseust.ac.in) and ask whether the Training Rules you read are the current version for your batch.
- Ask in the same email whether a short, free online internship is acceptable for any purpose, such as a skill add-on, and whether it needs prior approval. Keep the reply.
- Confirm whether your department is a University Teaching Department or an affiliated institute, and which rules apply to you.
- Ask your department which scheme year your batch follows and how final-semester training is credited and evaluated, since this is set in the scheme document for your course.
- Check the current academic calendar on the university site for report deadlines and vacations before planning any extra internship.
- Collect the current training-file checklist and forms from the Cell so you know what an offer letter must contain before you accept it.
Mock round routine for the week before your Java test
In the last seven days, stop learning new topics. Use this routine instead:
- Day -7 and -5: two full timed mocks in the exact environment you will face, such as browser editor, no IDE hints, webcam if required.
- Day -4 and -3: redo only problems from your error log. Aim for correct code at or below target time.
- Day -2: revise the idiom table and write five short snippets from memory: frequency map, comparator sort,
ArrayDequestack,PriorityQueuewith lambda, binary search. - Day -1: light practice, then check logistics: login, internet, permitted languages, Java version, and how input is read (
ScannerversusBufferedReader).
Input and output habits for online judges
- Use
BufferedReaderwithStringTokenizerwhen inputs are large;Scanneris slower. - Print with a single
StringBuilderand oneSystem.out.printwhen you have many lines. - Match output format exactly, including spaces and newlines.
- Know whether the platform expects a class named
Mainor a function signature supplied by the problem.
How to talk through your Java solution in a live round
Interviewers are often scoring communication as much as correctness. A simple script helps:
- Restate the problem in your own words and confirm the input constraints.
- Give an example and an edge case.
- Describe the brute force, then the better approach, with time and space complexity.
- Write the code in small named steps, using meaningful variable names.
- Test aloud with your example, then with the edge case.
- If stuck, say what you have tried and what you are considering next. Silence is harder to score than a partial approach.
Frequently Asked Questions
How many problems should I solve in 14 days?
The schedule above comes to roughly 40 to 50 problems including mocks. Quality matters more than count: a problem you solved, logged and redid is worth more than three you skimmed. If you must trim, keep the mock days and the repair day.
Should I use Java or switch to Python for coding rounds?
If the role or the internship is Java-focused, use Java. Many platforms allow several languages, but a Java role may ask follow-up questions about the language. Java is more verbose, so practise the idioms until typing them is automatic.
Which Java collections matter most for entry-level rounds?
ArrayList, HashMap, HashSet and ArrayDeque cover most problems. Add PriorityQueue, TreeMap and Comparator once those are comfortable. Be ready to explain why you chose one structure over another, and what its typical operation costs are.
Will a free online internship count toward my JC Bose YMCA internship requirement?
That is not stated in the published training rules, which describe T&P-approved industry or R&D lab internships. Ask the T&P Cell in writing and keep their answer. Until then, treat a short online programme as supplementary experience, with no assumption of credit.
How do I know whether I am ready after two weeks?
Use your tracker. If you solve easy problems within target time on the first run and medium problems within roughly 1.5 times target, with fewer repeated error categories in your log, you are in reasonable shape for a screening round. If one category still dominates, spend extra days on it.
What if I freeze on a problem during the test?
Write the brute-force solution first so you have something that works, then optimise if time remains. Partial credit is common on automated platforms, and a working O(n²) answer often beats an unfinished clever one.
Do I need to know Spring or other enterprise frameworks for the first coding round?
Usually not. Coding rounds test problem solving with core Java. Framework knowledge appears later, in interviews or in project work, so keep it for after the screening stage.
How should I handle input and output for online Java tests?
Read the platform’s instructions on class names and input methods during practice, not on test day. Practise with BufferedReader for large inputs and always check the exact output format required.
Related Java & Enterprise Software guides
- St. Joseph University Students: Working on a Java Internship Remotely Across Time Zones
- Spicer Adventist University Students: Understanding Agile and Scrum as a Java Intern
- Vignan's University Students: Adding Docker Basics to Your Java Internship Skill Set
- All Java & Enterprise Software internship guides
Ready to put this into practice?
Join the free two-week CareerSwami online internship in Java & Enterprise Software. The internship, the offer letter and the completion certificate are free.




