Summary of technical basic interview questions (test)

 

http return code explanation:

http://blog.csdn.net/x_chengqq/article/details/51160498

Random visit:

200 normal

400 Bad Request

403 access is Forbidden

404 file or directory not found

405 Method Not Allowed

304 forced cache

302 Temporary redirect Moved Temporatily

301Moved Permanently

500 Server Internal Error

503Service Unavailable Service unavailable

504 Gateway Timeout

505HTTP Version Not Supported The server does not support the HTTP version specified in the request

 

explain:

1xx - information prompt

2xx - success

3xx - redirect

4xx - Client Error

5xx - server error

 

 

Python basics:

1.list_value = ["1", "2", "3", "55", "66"]

Reverse order returns 1.list_value[::-1] 2.list_value.reverse()

2. What is the return value of list_value[:-1] ["1", "2", "3", "55"]

3. Statement:

list_value = ["1", "2", "3", "55", "66"]

[list_value.append("k") for item in list_value]

Can the statement be executed normally? What is the result after execution? Is there a problem with the syntax?

Answer: It can be executed normally, infinite loop, which will lead to memory leak

4. Statement

list_value = ["1", "2", "3", "55", "66"]

a = "a"

print [a.join(item) for item in list_value]

return what? Answer: ['6a6', '5a5', '3', '2', '1']

5. How to judge a folder is a package?

A: Include the __init__.py file

6. How much does the following statement return:

lam = lambda x, y: x + y * y

print lam(10, 20)

Answer: 410

7. Do you know python anonymous functions? Answer: lambda

8. How to replace the following function methods with anonymous functions

def g(x):

     return x+1

Answer: g = lambda x: x+1

9. Determine whether a string is a palindrome

Answer: s = "abcdcba" s == s[::-1] String flip

10. Randomly generate 100 numbers, and then write to the file

import random

with open("1.txt", 'wb') as f:

    for i in range(1, 101):

        n = random.randint (1, 100)

        f.write(str(n)+"\n")

11. Deduplicate the list

a = [1, 3, 2, 2, 1, 5, 5, 3]

print list(set(a))

 

 

Database basics:

1. Ask a grouped query

A table has fields (company) - company, employee, employee number (primary key), find out how many employees each company has?  

The actual group query is to use the company field: select count(company) from employee group by company;

2. What symbolic link is used for strings in Oracle? 

Oracle uses || this symbolic connection string such as 'abc' || 'd' 

3. How does Oracle perform paging? 

Oracle uses rownum for paging, which is the most efficient paging method, and hibernate also uses rownum for oralce paging 

select * from 

  ( select rownum r,a from tabName where rownum <= 20 ) 

where r > 10 

4. Briefly describe the use of dml, ddl, and dcl in oracle 

Dml data manipulation language, such as select, update, delete, insert 

Ddl data definition language, such as create table, drop table, ALTER, etc. 

Dcl data control language, such as commit, rollback, grant, invoke, etc. 

5. The difference between Delete and truncate  

delete is generally used to delete a small number of records, and it is a committed transaction that uses a rollback segment and is displayed. And truncate is used to delete a large amount of data, and implicitly commits the transaction, which is much faster than using delete

6. What statement does Oracle use to assign permissions to users?  

GRANT TO statement

7. Which one of exits and in is more efficient to execute in the ORALCE database?  

Exits are more efficient than in

8. How to show only duplicate data, or not to show duplicate data

   显示重复:select * from tablename group by id having count(*)>1

   Do not show duplicates: select * from tablename group by id having count(*)=1

 

 

java basics:

1.map traversal

for(Map.Entry entry:map.entrySet()){

Systerm.out.println(entry.getKey(), entry.getValue())

}

2.list traversal

for(int i = 0 ; i < list.size() ; i++) {

  system.out.println(list.get(i));

}

3.list deduplication

1. The set collection is deduplicated 2. After traversal, the judgment is assigned to another list collection if(!newList.contains(cd)){newList.add(cd);}

4. Difference between abstract class and interface

5. The realization principle of java polymorphism (belonging to more difficult problems)

Answer: Use abstract classes, interfaces to achieve polymorphism

6. Singleton Pattern

 

 

 

LINUX basics:

1. What are the commonly used linux commands grep, more, tail -f, cat, less , ll, ls, ps, tail

2. How to see threads, find threads

ps -ef |grep 'xxxxx'

3. How to read disk information

df -h

4. Check the network and find a port

netstat -an | findstr 80

tasklist | findstr pid

5. How to view the processes occupying port 8080

 lsof -i:8080

6. The permission of a file is: d-rwx_r--_r--, what does it mean?

If the permission is expressed in numerical form, the octal number is: 744 , the file attribute is the d directory 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326230533&siteId=291194637