download:The Python engineer interview is taught by senior interviewers
What to learn as a Python server engineer, what to ask in an interview, and what to prepare for? Don’t worry, don’t be afraid, don’t be entangled, this course will systematically comb your interview knowledge, increase your chances of success in the interview, improve your back-end development skills, solve your various problems before the interview, so that your technical strength and interview skills can be improved.
Suits the crowd
Python Server Engineer (Back-end Engineer)
Beginner/Intermediate Web developers and full stack developers
Developers using the Python language
(Operation and Maintenance engineer, crawler Engineer, data analyst, etc.)
Technical reserve requirements
Master the Python programming language
Be able to use Python for website development and understand how websites work
Public Book() {}
copy
public Book(String id, String name, String price, String auth,
String publish, String description) {
super();
this.id = id;
this.name = name;
this.price = price;
this.auth = auth;
this.publish = publish;
this.description = description;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getAuth() {
return auth;
}
public void setAuth(String auth) {
this.auth = auth;
}
public String getPublish() {
return publish;
}
public void setPublish(String publish) {
this.publish = publish;
}
Copy the code
}
import java.util.LinkedHashMap; import java.util.Map; import cn.huiyu.ben.Book; public class BookDao { private static Map
bookMap = new LinkedHashMap
(); Private BookDao() {} static{bookmap. put(“1”, new Book(“1″,”1111″,”11.0″,”zqwang”,”111 “,”111111111″); BookMap. Put (” 2 “, new Book (” 2 “, “2222”, “22.0”, “zqwang”, “222 press”, “222222222”)); BookMap. Put (” 3 “, the new Book (” 3 “, “3333”, “33.0”, “zqwang”, “333 press”, “333333333”)); }
copy
public static Map<String,Book> getBooks(){
return bookMap;
}
public static Book getBook(String id){
return bookMap.get(id);
}
Copy the code
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(“text/html; charset=utf-8”); Map
Map = bookdao.getBooks (); for(Map.Entry
entry : map.entrySet()){ Book book = entry.getValue(); response.getWriter().write(“”+book.getName()+” “); } response.getWriter().write(” “);
copy
Cookie [] cs = request.getcookies (); Cookie findC = null; if(cs! =null){ for(Cookie c : cs){ if("last".equals(c.getName())){ findC = c; }} if(findC == null){response.getwriter ().write(" I have not read any book!" ); }else{response.getwriter ().write(" You have read books:Copy the code
“); String[] ids = findC.getValue().split(“,”); for(String id : ids){ Book book = BookDao.getBook(id); response.getWriter().write(book.getName()+” “); }}}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(“text/html; charset=utf-8”); String id = request.getParameter(“id”); String id = request.getparameter (“id”); Book book = BookDao.getBook(id); If (book==null){response.getwriter ().write(” Find this book! ); return; } else {response. GetWriter (), write (” is the title: “+ book. GetName () +” “); The response. GetWriter (). The write (” the author: “+ book. GetAuth () +” “); The response. GetWriter (). The write (” price: “+ book. GetPrice () +” “); Response.getwriter ().write(” publishing :” +book.getPublish()+””); Response.getwriter ().write(” “+book.getDescription()+””); }
copy
/ / 2. Send the cookie custody last seen book / / -- -- -- 1 -- - > 1 / / 1, 2, 1 - > 2, 1 / / 2, 1, 3, 2, 1 - > 3, 2, 1/3, 2, 1-4 31 - > 4 31 / / 4 31 --3,4,2 --> 3,4,2 String ids = ""; Cookie [] cs = request.getCookies(); Cookie findC = null; if(cs! =null){ for(Cookie c : cs){ if("last".equals(c.getName())){ findC = c; }} if(findC == null){ids += book.getid (); String [] olds = findc.getValue ().split(",");}else{String [] olds = findc.getValue ().split(","); StringBuffer buffer = new StringBuffer(); buffer.append(book.getId()+","); for(int i = 0; i<olds.length && buffer.toString().split(",").length<3 ; i++){ String old = olds[i]; if(! old.equals(book.getId())){ buffer.append(old+","); } } ids = buffer.substring(0, buffer.length()-1); } Cookie lastC = new Cookie("last",ids); lastC.setMaxAge(3600*24*30); lastC.setPath(request.getContextPath()); response.addCookie(lastC); }Copy the code