Ten internal programming questions of Dark Horse javaSE

Source: Internet
Author: User

The following 10 programming questions can be done first to check your basic level.
If you can finish it all. It means that the knowledge of JavaSE is okay.
After learning JavaEE well, you will be able to find a good job in the future.
If you have any questions, please leave a message in our forum. We will answer your questions in a timely manner.

1: (Java basics)
A company uses a public phone to transmit data information, which is an integer smaller than 8 digits. To ensure security, encryption is required during transmission. The encryption rules are as follows:
First, sort the data in reverse order, add 5 to each number, and then replace the number with the remainder divided by 10. Finally, the first and last digits are exchanged.
Specify any integer smaller than 8 digits and print the encrypted result on the console.

2: (how to implement the same functions as API)
Public static String round (String str, int digit)
Parameter 1: A string consisting of digits and decimal points. For example, "12.568"
Parameter 2: number of decimal places rounded. Example: 2
Return Value: the string value after rounding the condition. "12.57"
Note: You must compile your own algorithm for string operations. You cannot use Java's ready-made API methods for rounding.

3: (measure the test taker's knowledge about the function of string)
Returns the maximum number of identical substrings of two strings.
For example, the maximum identical string of "sadabcdfghjkl" and "werabcdtyu" is: abcd

4: (recursive use)
Rabbit problem: a rabbit has been born every month since 3rd months after birth,
After the third month, the bunny gave birth to another rabbit every month. If the Rabbit does not die,
Q: What is the rabbit logarithm in 20th months?
You can use recursion or other methods, but you need to explain why you choose.

5: (use of Map sets)
In the "cbxzbvavdvgd" string, each letter appears for a (1) B (2) c (1) d (2) g (1) v (3) x (1) z (1)

6: (You Need To Know About The Quick Sort Algorithm)
Please implement a quick sorting by yourself

7: (understanding of data structure stack)
Implement chain storage for one stack

8: (IO stream and recursive usage)
Copy the content of the source directory under the d directory to the E directory.
Note: The source directory may contain directories.

9: (use of reflection)
ArrayList <Integer> list = new ArrayList <Integer> ();
Store a String type object in the ArrayList of Integer type.

10: (there is no standard answer to open questions. Key points: logical thinking and self-learning .)
If you have to learn a new language, speak your mind.

 

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.