0% found this document useful (0 votes)
198 views5 pages

Digital Core Java Test - Junior Developer PDF

The document contains 4 coding tests for a junior developer position. Test 1 asks for the expected output of a program that sequences numbers in an array. Test 2 asks to complete code to remove duplicate numbers from an array, returning the unique values separated by commas. Test 3 asks to write code that prints numbers from 1-50, printing "H" for multiples of 3, "E" for multiples of 5, and "HE" for multiples that are both. Test 4 asks a SQL query question to select students from Malaysia who took the Java subject, ordered by most recent training date.

Uploaded by

christianto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
198 views5 pages

Digital Core Java Test - Junior Developer PDF

The document contains 4 coding tests for a junior developer position. Test 1 asks for the expected output of a program that sequences numbers in an array. Test 2 asks to complete code to remove duplicate numbers from an array, returning the unique values separated by commas. Test 3 asks to write code that prints numbers from 1-50, printing "H" for multiples of 3, "E" for multiples of 5, and "HE" for multiples that are both. Test 4 asks a SQL query question to select students from Malaysia who took the Java subject, ordered by most recent training date.

Uploaded by

christianto
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Java Test – Junior Developer

Full Name
Date

Note:

• Allocated Time: 1 hour


• We tolerate minor syntax issue as this is written test. What we want to see is your
logic.
Test 1: Java Programming

What is the expected output of the following program?

public class MyClass {


public static void main(String args[]) {
int[] numbers = {1,7,2,4,8,5};
sequencingNumbers(numbers);
}

public static void sequencingNumbers (int ... p){


int paramLength = p.length / 2;
int number;
int index;

for(int a = 0;a < p.length; a++){

if(a < paramLength){


index = p.length - 1 - a;
number = p[index];
p[index] = p[a];
p[a] = number;
}

System.out.print(p[a] + ";");
}

}
}

Expected Output:-
Test 2: Java Programming

Complete the Java function below to removing the duplicates from the array

public static void main(String[] args)


{
int[] numbers = {1, 2, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 5, 5, 5, 5, 5, 8};
System.out.print("The value is " + removeDuplicate(numbers));
}

public static String removeDuplicate (int[] p)


{
//complete your program here

Expected Output:-

The value is 1,2,3,4,5,6,8


Test 3: Java Programming

Write Java code to be able to print below result:

1. Loop an integer value from 1 to 50


2. If the value modulus 3 == 0 then ONLY print “H”
3. If the value modulus 5 == 0 then ONLY print “E”
4. If the value modulus 3 == 0 AND value modulus 5 == 0 then ONLY print “HE”
5. If not meet above condition, just print the value

Expected output:

1
2
H
4
E
H
7
8
H
E
11
H
13
14
HE
16
17
18
19
E

Test 4: SQL Query

Given 2 tables below:-


STUDENT_TABLE
STUDENT_CODE FIRST_NAME DOB CITY COUNTRY
STUD001 Gavin 12-09-1996 KUALA MALAYSIA
LUMPUR
STUD002 Malvina 04-02-1997 PETALING MALAYSIA
JAYA
STUD003 Wendy 28-11-1996 GEORGE MALAYSIA
TOWN
STUD004 Rex 31-08-1997 BANGKOK THAILAND

SCORE_TABLE

STUDENT_CODE SUBJECT SCORE TRAINING_DATE


STUD002 JAVA 100 2019-01-02
STUD001 C++ 99 2019-01-03
STUD002 SQL 60 2019-01-02
STUD004 JAVA 78 2019-01-02
STUD001 JAVA 88 2019-01-03
STUD001 SQL 90 2019-01-03
STUD004 SQL 78 2019-01-02
STUD003 SQL 88 2019-01-02

Write a query to get the list of students from Malaysia who took JAVA subject and order
from the most recent training date to oldest date.
Expected Output:-

STUDENT_CODE SUBJECT SCORE TRAINING_DATE


STUD001 JAVA 88 2019-01-03
STUD002 JAVA 100 2019-01-02

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy