2016 Spring recruit Android Development intern (NetEase media) written test

Source: Internet
Author: User
Tags sqlite database

First, single choice

1. The following are not part of the Network layer protocol

    • Tcp
    • Ip
    • Ipx
    • Icmp

2. On the status of activity recovery, the error is

    • In Onsaveinstancestate, Activity automatically collects the status of all controls in the view tree
    • The activity's member variables need to be manually saved for recovery
    • Custom view controls can implement onrestoreinstancestate and onsaveinstancestate for activity status callbacks
    • Onsaveinstancestate is not suitable for persisting data

3. In the Publish-subscribe (PUBLISH-SUBSCRIBE) message model, when a Subscriber subscribes to a topic, all Subscribers are notified when a new message is reached on the subject. Which of the following design patterns is best for this model?

    • Adapter (Adapter)
    • Bridge mode
    • Status (state)
    • Viewer (Observer)

4. In a request paging system, the FIFO page replacement algorithm, if the trend of a page is 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, when the number of physical blocks assigned to the job is 3, the fault rate is

    • 40
    • 60
    • 80
    • 100

5. For sleep () and wait (), one of the following describes the error is ()

    • Sleep is a thread-class method, and wait is a method of the object class
    • Sleep does not release object locks, wait discards object locks
    • Sleep pauses the thread, but the monitoring state remains and is automatically restored after the end
    • Wait to enter the waiting lock pool only after the Notify method is issued for this object to get the object lock into the running state

6. In the isolation of the following transactions, it is possible to avoid Phantom reads

    • Read UNCOMMITTED
    • Read Committed
    • Read Repeatable
    • Serializable

7. Run the B.java, the result of the output is ()

Public class A {
Public Static int J = method2();
public int I = Method ();
public int k = 0;
Public A () {
System. Out. println (1);
    }

Private int method () {
System. Out. println (2);
return 2;
    }
Public Static int method2 () {
System. Out. println (3);
return 3;
    }
}

Public class B extendsa{
public int m=method3 ();
Public Static int n=method4();
public int t=0;
Public B () {
System. Out. println (4);
    }
public int method3 () {
System. Out. println (5);
return 5;
    }
Public Static int method4 () {
System. Out. println (6);
return 6;
    }
Public static void Main (string[]args) {
System. Out. println (7);
A a=new B ();
    }
}

    • 7,3,2,1,6,4,5
    • 3,6,7,2,1,5,4
    • 7,3,6,2,1,5,4
    • 3,2,1,7,6,5,4

8. If the JVM parameters of a Java process are configured as follows:-xms1g,-xmx2g,-xmn500m,-xx:maxpersize=64m,-xx:+useconcmarksweepgc–xx:survivorratio=3, What is the final allocation size of the Eden area?

    • 64M
    • 500M
    • 300M
    • 100M

9. Is the following expression illegal?

    • list<? Extends Number>foo=new arraylist<double> ();
    • list<? Super Number>foo=new arraylist<integer> ();
    • list<? Super Integer>foo=new arraylist<number> ();
    • list<? Extends Integer>foo=new arraylist<integer> ();

10. Which of the following data structures is a non-linear structure?

    • Queue
    • Stack
    • Linear table
    • Two-fork Tree
Second, multi-choice

11. The following statements are correct:

    • A case where the solution of a sub-problem can not be merged by the Division and Treatment method
    • The dynamic programming method usually obtains the optimal solution from the bottom-up method.
    • Random algorithm run time may occur when no solution is found
    • Using the KMP algorithm, retrieve the substring T in the string s (value "Zuzxzuy"), if the first "mismatch" (S[i]!=t[j]), the next time the match is started, the value of I may be 15

12. "Refined sort", that is, a pair of numbers do not carry out two or more than two times the comparison, the following is "refined" sort of IS

    • Insert Sort
    • Merge sort
    • Select sort
    • Heap Sort

13. Which of the following types can be thrown by a throw statement

    • Error
    • Exception
    • Throwable
    • Object

14. The following statements are correct

    • StringBuilder is not thread-safe
    • Java classes can use both abstract and final declarations
    • HashMap, use Get (key) ==null to determine if the HashMap contains this key
    • Volatile keyword does not guarantee atomicity on variable operations

15. Which of the following events will directly cause the Linux system to switch from the user state to the kernel state

    • Response Control interrupts
    • Compile the program source code
    • Execute system call
    • View System logs

16. Assuming that the system operates on a single channel and uses a short job first algorithm, there are j1,j2,j3,j4 a total of four jobs to arrive at the same time, then which of the following conditions of the average turnover rate of 10 minutes?

    • Execution Time:

J1:1 min

J2:5 min

J3:9 min

J4:13 min

    • Execution Time:

J1:1 min

J2:4 min

J3:7 min

J4:10 min

    • Execution Time:

J1:2 min

J2:4 min

J3:6 min

J4:8 min

    • Execution Time:

J1:3 min

J2:6 min

J3:9 min

J4:12 min

17. Which of the following logic may cause a ANR (applicationnot response) Error:

    • Make a network request on the broadcast Onreceiver
    • Read the SQLite database in the activity's OnCreate
    • Handling bitmap encoding in Intentservice's onhandleintent
    • Frequent in-memory GC

18. The storage type of local variables allows:

    • Auto
    • Static
    • extern
    • Register

19. Which of the following different database types does not belong to the relational database category

    • Mongodb
    • PostgreSQL
    • Redis
    • HBase

20 below about the HTTP protocol description, which is correct

    • Post requests are typically used to modify resources on the server, and there is no limit to the amount of message data sent, which is submitted by Form
    • HTTP return Code 302 means permanent redirect, need to update URI
    • 206 return codes can be used for power-down continuation
    • HTTP1.1 provides long-lasting connectivity and pipeline operations and proactive notification capabilities, with significant performance improvements over http1.0

Three

21. How do I make the service run in the background in a non-root environment? What is the problem with long-term background running? How to optimize?

22. The CPU frequency of a computer is 500MHZ,CPI 5 (that is, it takes 5 time periods to execute each instruction). Assuming that the data transfer rate for a peripheral is 0.5mb/s, the interrupt mode is used to transmit data to the host, 32 bits is the transmission unit, the corresponding interrupt service program contains 18 instructions, and the other cost of the interrupt service is equivalent to the execution time of 2 instructions. Please answer the following questions. , it is required to give the calculation process.

(1) In the interrupt mode, what percentage of the CPU time is spent on the peripheral I/O for the processor?

(2) When the data transmission rate of the peripheral reaches 5mb/s, the DMA mode is used to transmit the data. Assuming that each DMA transfer size is 5000B and that the total cost of DMA preprocessing and post-processing is 500 clock cycles, what percentage of CPU time does the CPU use for that peripheral I/O? (assuming there is no conflict between DMA and CPU)

23. There is a user-state process A, its virtual memory page for 1kb,a occupies 64 pages, the memory capitalization for the 128KB,A process will be the son to memory page and the number of physical memory block corresponding to the following relationship:

Page number physical memory block number

0 4

1 9

2 5

3 8

Please answer the following questions according to the above information and give the calculation process:

1) What is the physical address of the virtual address 015D?

2) What is the virtual address corresponding to the physical address of 113C?

3) Process A has a job length of 8 pages, trying to access the virtual address 2a3d and save the integer 1 to the address of the physical address space, and then try to read the saved data from the address, will the a process this two times the memory access process can be normal execution? and explain why.

24. Based on the idea of fast sequencing, implement the following functions to find out the number of K in an array (K starts from 0)

Input format:

Input has several test case compositions

Each test case consists of several lines

The first line of each test case input array size n, with the required K

1<n<2^16,0<=k<n

Subsequent n rows enter a number per line

N=0 represents the end of the test

Output format:
The number required for each test case output topic

Cases:

Input:

1 0 #注释: Test Case 1

100

5 2 #注释: Test Case 2

2

10

93

41

32

0 0# Comment: End

Output:

100

32

25. There is a microblogging-like app that needs to be cached locally: User information (user name, user ID, user's Weibo post, and release time), as well as management (friend name, friend ID, Weibo post for friends, and release time), use Android SQLite to create a local database , requires: Establish a primary foreign key constraint, assuming that all tweets are plain text messages.

2016 Spring recruit Android Development intern (NetEase media) written test

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.