Summary of the questions asked in the interview

There have been several interview opportunities recently, and the relevant questions will be briefly summarized after the interview.

Because it is written in the resume that it will be simple python programming. Will write some simple python scripts. interview was asked

What is the way to iterate over a dictionary in python?

Answer: My answer is one-sided, I only know how to traverse through a for loop. After checking the information later, I learned that there are roughly the following ways to traverse the dictionary

These three methods are generally used: keys(), values(), items()
Upgraded methods: iterkeys(), itervalues(), iteritems()

It is verified that the traversal efficiency of the upgraded method is relatively high, and the memory consumption is relatively small.

Ordinary method traversal, keys(), items() also occupy a large amount of memory. Among them, items traversing the dictionary takes the longest and is the least efficient.

What are the methods for positioning elements?

Answer: There are eight element positioning methods: id, name, class, tag, link, partial link, xpath, css

How does webdriver implement page jumping?

A: I myself think that there are different situations for this to be divided.

1. Web pages are nested web pages. One web page is nested with another web page, which can be jumped by frame. Specifically, the switch_to_frame() method is used.

2. The specific steps of the browser multi-window are as follows:

a) It can be obtained by using current_window_handle by getting the current window handle (i.e. unique identifier for each window)

b) Find the handles of all windows and get them through the method window_handles

c) Traverse the windows in step 2, find the corresponding window and use the switch_to_window() method to switch

3. Paging processing

 Method: Get all the page numbers, and then turn the page

4. Historical Navigation

Open a new page:

 driver.navigate().to();

Return to the original page through historical navigation:

driver.navigate().forward();

driver.navigate().back();

How to upload files in webdriver?

 A: Just locate the upload button and add the local file path through send_keys . Both absolute and relative paths are fine, the key is that the uploaded file exists.


Q: At present at work (I am currently employed) I feel that I have a better grasp of technical skills, because I have used the Linux system a lot, so I asked me about some Linux related skills.

What are the ways to view the contents of a file? (I think the interviewer mainly wanted to know the related methods of log viewing, but I didn't answer the point at the time)

A: Many, open directly with vi, cat, more (in fact, there are tail or head commands to check I didn't think of it at the time)

The interviewer then asked if there was anything else?

A: I usually come into contact with these three

Interviewer: Then tell me the difference between more and cat?

Answer: I don't use more much (suddenly I feel that I can't do anything, so stupid!), cat is used more

Interviewer: What's the downside of cat?

A: It is fine to view small files, but if the file is too large or the content of the file is too long, it is impossible to view the specific file content, and cannot search for specific characters, etc. (After checking later, I found that more is more powerful, you can turn pages, and you can search for specific character content)

Interviewer: What is the difference between bin and sbin?

After pondering, I realized that I had forgotten what I had known before because I had not used it for a long time, so I couldn't answer it.

Check the information when you come back:

In the Linux system, there are two important directories: bin and sbin, including /bin, /usr/bin/ and /sbin, /usr/sbin/ respectively. 

bin: 

bin is the abbreviation of binary, which mainly places the necessary executable files of the system, such as: 

cat、cp、chmod df、dmesg、gzip、kill、ls、mkdir、more、mount、rm、su、tar等。 

/usr/bin: 

Mainly place the necessary executable files for application tools, such as: 

c++、g++、gcc、chdrv、diff、dig、du、eject、elm、free、gnome*、 gzip、htpasswd、kfm、ktop、last、less、locale、m4、make、man、mcopy、ncftp、 newaliases、nslookup passwd、quota、smb*、wget等。 

/sbin: 

Mainly place the necessary programs for system management, such as: 

cfdisk、dhcpcd、dump、e2fsck、fdisk、halt、ifconfig、ifup、 ifdown、init、insmod、lilo、lsmod、mke2fs、modprobe、quotacheck、reboot、rmmod、 runlevel、shutdown等。 

/usr/sbin: 

Mainly place the necessary programs for network management, such as: 

dhcpd、httpd、imap、in.*d、inetd、lpd、named、netconfig、nmbd、samba、sendmail、squid、swap、tcpd、tcpdump等

The interview time was not long, and I felt that what I had mastered was not very comprehensive. In short, my ability was indeed not very good.

Interview summary:

My own ability is not good, mainly because many knowledge points are only understood, not in-depth study and not much practice. There will be more practice in the future.

Interview result: cool

Summary of interview experience:

You must be familiar with what is written on your resume, and it won't be really embarrassing to be asked. . . Think about it later. . .

Elementary school students in the testing world need to learn a lot. If there is something wrong with the above, please point out and correct it.

Guess you like

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