论坛首页 招聘求职论坛

北京亚马逊 java职位笔试题 分析

浏览 14939 次
精华帖 (1) :: 良好帖 (1) :: 隐藏帖 (0)
作者 正文
   发表时间:2010-07-08  
上海-猎头1 写道


四年以上Java软件工程师这么难找?
我是一名上海猎头,最近使用各种手段去猎人,老大要求的是4年以上J2EE相关经验,大专以上学历,在各种招聘网站和论坛上找了好几天,真的那么难找!我才做猎头没几天,郁闷死我了!
下面贴上招聘要求,如有符合要求的可以随时联系我!!!

猎头职位描述:
1,进行业务需求分析,系统设计和软件概要设计
2,进行软件详细设计和编码实现,确保安全,质量和性能
3,维护和升级现有软件产品,快速定位并修复现有软件缺陷
4,负责相关产品的文档编写
猎头职位要求:
1,本科以上学历,计算机软件或相关专业
2,四年以上J2EE项目开发经验
3,熟练掌握J2EE,包括Spring,Spring mvc,iBatis,Struts,Esb等框架,熟悉Linux,Cache,HTML,UML等相关技术
4,熟悉软件过程,热爱程序员工作,有技术追求
5,具有良好的团队合作精神,愿意分享,并积极上进
6,学习能力强,踏实肯干
7,有互联网,金融,支付等行业经验者优先
工作地点是:杭州和上海
绝对是正经的工作!!!

另外,我还有Q群
━═☆Java EE☆═━ 1894459     0/200
≮JavaEye初级程序员 7736086   190/200
大家看着加啊,都是Java程序员!都是javaeye的

你透露一点待遇方面的情况,会有人联系你的
0 请登录后投票
   发表时间:2010-07-08  
terrylrvin 写道
上海-猎头1 写道


四年以上Java软件工程师这么难找?
我是一名上海猎头,最近使用各种手段去猎人,老大要求的是4年以上J2EE相关经验,大专以上学历,在各种招聘网站和论坛上找了好几天,真的那么难找!我才做猎头没几天,郁闷死我了!
下面贴上招聘要求,如有符合要求的可以随时联系我!!!

猎头职位描述:
1,进行业务需求分析,系统设计和软件概要设计
2,进行软件详细设计和编码实现,确保安全,质量和性能
3,维护和升级现有软件产品,快速定位并修复现有软件缺陷
4,负责相关产品的文档编写
猎头职位要求:
1,本科以上学历,计算机软件或相关专业
2,四年以上J2EE项目开发经验
3,熟练掌握J2EE,包括Spring,Spring mvc,iBatis,Struts,Esb等框架,熟悉Linux,Cache,HTML,UML等相关技术
4,熟悉软件过程,热爱程序员工作,有技术追求
5,具有良好的团队合作精神,愿意分享,并积极上进
6,学习能力强,踏实肯干
7,有互联网,金融,支付等行业经验者优先
工作地点是:杭州和上海
绝对是正经的工作!!!

另外,我还有Q群
━═☆Java EE☆═━ 1894459     0/200
≮JavaEye初级程序员 7736086   190/200
大家看着加啊,都是Java程序员!都是javaeye的

你透露一点待遇方面的情况,会有人联系你的





确实
既然是猎头就应该主动联系程序员
若想被程序员主动联系确实需要非常大的诱惑才行
你要主动出击
貌似我偏题了
0 请登录后投票
   发表时间:2010-07-08  
一般会用 搜索引擎 统计分析日志。
0 请登录后投票
   发表时间:2010-07-08  
dasheng 写道
mercyblitz 写道
第一个HashMap<userID,page_type_id>,因为日志是顺序添加的,比如:
userID page_type_id
123    home                1
456    production          2
123    home                3

那么第一个HashMap保存['123','home'],同理,第三行标示用户‘123‘在相同页面刷新,那么可以跳过(等同于HashMap保存了这个值的话),如果没有遇到相同的话,
比如:
userID page_type_id
123    home                4
123    production          5
这样路径就变成了home-production,Map=['123','home,production'],如果在第N行,用户123的路径,没有在home-production的话,比如:
userID page_type_id
123    detail              N
那么,这个时候第一个HashMap=['123','home,production,detail'],第二HashMap保存[‘home,production,detail‘,1](count=1).

接下来,又遇到了用户“123”的话,把第一个HashMap['123','home,production,detail']的值替换掉,重复前面的做法,当路径符合三节的时候,把用户123在一个HashMap上面的值取出来,跟第二个HashMap[‘home,production,detail‘,1]的键(‘home,production,detail‘)比较,如果有的话,+1,如果没有的话,添加新的key给第二个HashMap。

不知道楼主明白了吗?
感谢mercyblitz的回复,大概看明白你的思路了,不过有一点需要讨论,你说找到一个三节路径的用户后,新增加该用户的记录把原来的替换,重新开始。我的理解是三节路径是前后包含的关系的。比如用户123 的 访问路径是 home,production,detail,support,download.那么可能的三节路径是home,production,detail;production,detail,support;detail,support,download;所以我认为需要先遍历一遍日志文件,得到所有不同的用户的路径。然后按前后包含的方法来遍历所有的用户的路径。最后才加入第二HashMap。不知道对不对,希望高手继续讨论,谢谢!


三节路径已经定死了,就两个,楼主是不是想多了?

0 请登录后投票
   发表时间:2010-07-08  
map1: <userId, List(page_type_id)>
map2: 对map1中List.size >3 的算出可能的三节路径做为key, value就是其数字,遍历一个userId,存在就+1
0 请登录后投票
   发表时间:2010-07-08   最后修改:2010-07-08

综合了各位的意见,在jdk1.5下,实现了该算法,大家帮看看是否符合要求:

 

public class LogRecord { //日记记录

 private String trip1 = "";

 private String trip2 = "";

 private String trip3 = "";

 public String getTrip1() {
  return trip1;
 }

 public void setTrip1(String trip1) {
  this.trip1 = trip1;
 }

 public String getTrip2() {
  return trip2;
 }

 public void setTrip2(String trip2) {
  this.trip2 = trip2;
 }

 public String getTrip3() {
  return trip3;
 }

 public void setTrip3(String trip3) {
  this.trip3 = trip3;
 }

 @Override
 public boolean equals(Object obj) { //日志是否相等
  // TODO Auto-generated method stub
  if (this == obj)
   return true;
  if (obj == null)
   return false;
  if (getClass() != obj.getClass())
   return false;

  final LogRecord other = (LogRecord) obj;

  if (trip1.equals(other.trip1) && trip2.equals(other.trip2)
    && trip3.equals(other.trip3))
   return true;
  else
   return false;
 }

 @Override
 public String toString() {
  // TODO Auto-generated method stub
  return "[" + trip1 + "--" + trip2 + "--" + trip3 + "]";
 }

 public LogRecord(String trip1, String trip2, String trip3) {
  super();
  this.trip1 = trip1;
  this.trip2 = trip2;
  this.trip3 = trip3;
 }

 @Override
 public int hashCode() {    //计算hash值
  // TODO Auto-generated method stub
  final int prime = 31;
  int result = 1;
  result = prime * result + ((trip1 == null) ? 0 : trip1.hashCode());
  result = prime * result + ((trip2 == null) ? 0 : trip2.hashCode());
  result = prime * result + ((trip3 == null) ? 0 : trip3.hashCode());
  return result;

 }

}

 

主体类:

 

import java.util.ArrayList;
import java.util.HashMap;

public class Amason {

 private static HashMap<String, ArrayList> map = new HashMap<String, ArrayList>();
 private static HashMap<LogRecord, Integer> mapCount = new HashMap<LogRecord, Integer>();

 public static void Inital() { //初始化数据
  putPages("123", "home");
  putPages("234", "product spec");
  putPages("456", "support");
  putPages("123", "download center");
  putPages("456", "home");
  putPages("456", "download center");
  putPages("234", "download center");
  putPages("123", "support");
  putPages("456", "support");
 }

 public static void putPages(String userid, String page) {//把原始数据放到hashmap中
  if (map.get(userid) == null) {
   ArrayList<String> list = new ArrayList<String>();
   list.add(page);
   map.put(userid, list);
  } else {
   ArrayList<String> list = map.get(userid);
   list.add(page);
  }

 }

 public static void putRecord(LogRecord record) { //对每个用户的路径进行分析
  if (mapCount.get(record) == null) {
   mapCount.put(record, new Integer(1));
  } else {
   Integer count = mapCount.get(record);
   count = count + 1;
   mapCount.put(record, count);
  }
 }

 public static void putUserTrack() {

  for (String usrid : map.keySet()) {
   ArrayList<String> list = map.get(usrid);

   int size = list.size();
   if (size > 2) {
    for (int i = 0; i < size && i + 2 < size; i++) {  //路径是前后包含关系
     LogRecord record = new LogRecord(list.get(i), list
       .get(i + 1), list.get(i + 2));
     putRecord(record);
    }
   }
  }
 }

 public static void getCommonTrack() {  //简单打印出结果
  System.out.print(mapCount.keySet());
  System.out.print(mapCount.values());
 }

 public static void main(String[] args) {
  Inital();
  putUserTrack();
  getCommonTrack();
 }
}

 



0 请登录后投票
   发表时间:2010-07-08  
mercyblitz 写道
第一个HashMap<userID,page_type_id>,因为日志是顺序添加的,比如:
userID page_type_id
123    home                1
456    production          2
123    home                3

那么第一个HashMap保存['123','home'],同理,第三行标示用户‘123‘在相同页面刷新,那么可以跳过(等同于HashMap保存了这个值的话),如果没有遇到相同的话,
比如:
userID page_type_id
123    home                4
123    production          5
这样路径就变成了home-production,Map=['123','home,production'],如果在第N行,用户123的路径,没有在home-production的话,比如:
userID page_type_id
123    detail              N
那么,这个时候第一个HashMap=['123','home,production,detail'],第二HashMap保存[‘home,production,detail‘,1](count=1).

接下来,又遇到了用户“123”的话,把第一个HashMap['123','home,production,detail']的值替换掉,重复前面的做法,当路径符合三节的时候,把用户123在一个HashMap上面的值取出来,跟第二个HashMap[‘home,production,detail‘,1]的键(‘home,production,detail‘)比较,如果有的话,+1,如果没有的话,添加新的key给第二个HashMap。

不知道楼主明白了吗?






看了你的回答,我现在才看懂了题目什么意思了,呵呵。
0 请登录后投票
   发表时间:2010-07-08  
dasheng 写道

综合了各位的意见,在jdk1.5下,实现了该算法,大家帮看看是否符合要求:

 

public class LogRecord { //日记记录

 private String trip1 = "";

 private String trip2 = "";

 private String trip3 = "";

 public String getTrip1() {
  return trip1;
 }

 public void setTrip1(String trip1) {
  this.trip1 = trip1;
 }

 public String getTrip2() {
  return trip2;
 }

 public void setTrip2(String trip2) {
  this.trip2 = trip2;
 }

 public String getTrip3() {
  return trip3;
 }

 public void setTrip3(String trip3) {
  this.trip3 = trip3;
 }

 @Override
 public boolean equals(Object obj) { //日志是否相等
  // TODO Auto-generated method stub
  if (this == obj)
   return true;
  if (obj == null)
   return false;
  if (getClass() != obj.getClass())
   return false;

  final LogRecord other = (LogRecord) obj;

  if (trip1.equals(other.trip1) && trip2.equals(other.trip2)
    && trip3.equals(other.trip3))
   return true;
  else
   return false;
 }

 @Override
 public String toString() {
  // TODO Auto-generated method stub
  return "[" + trip1 + "--" + trip2 + "--" + trip3 + "]";
 }

 public LogRecord(String trip1, String trip2, String trip3) {
  super();
  this.trip1 = trip1;
  this.trip2 = trip2;
  this.trip3 = trip3;
 }

 @Override
 public int hashCode() {    //计算hash值
  // TODO Auto-generated method stub
  final int prime = 31;
  int result = 1;
  result = prime * result + ((trip1 == null) ? 0 : trip1.hashCode());
  result = prime * result + ((trip2 == null) ? 0 : trip2.hashCode());
  result = prime * result + ((trip3 == null) ? 0 : trip3.hashCode());
  return result;

 }

}

 

主体类:

 

import java.util.ArrayList;
import java.util.HashMap;

public class Amason {

 private static HashMap<String, ArrayList> map = new HashMap<String, ArrayList>();
 private static HashMap<LogRecord, Integer> mapCount = new HashMap<LogRecord, Integer>();

 public static void Inital() { //初始化数据
  putPages("123", "home");
  putPages("234", "product spec");
  putPages("456", "support");
  putPages("123", "download center");
  putPages("456", "home");
  putPages("456", "download center");
  putPages("234", "download center");
  putPages("123", "support");
  putPages("456", "support");
 }

 public static void putPages(String userid, String page) {//把原始数据放到hashmap中
  if (map.get(userid) == null) {
   ArrayList<String> list = new ArrayList<String>();
   list.add(page);
   map.put(userid, list);
  } else {
   ArrayList<String> list = map.get(userid);
   list.add(page);
  }

 }

 public static void putRecord(LogRecord record) { //对每个用户的路径进行分析
  if (mapCount.get(record) == null) {
   mapCount.put(record, new Integer(1));
  } else {
   Integer count = mapCount.get(record);
   count = count + 1;
   mapCount.put(record, count);
  }
 }

 public static void putUserTrack() {

  for (String usrid : map.keySet()) {
   ArrayList<String> list = map.get(usrid);

   int size = list.size();
   if (size > 2) {
    for (int i = 0; i < size && i + 2 < size; i++) {  //路径是前后包含关系
     LogRecord record = new LogRecord(list.get(i), list
       .get(i + 1), list.get(i + 2));
     putRecord(record);
    }
   }
  }
 }

 public static void getCommonTrack() {  //简单打印出结果
  System.out.print(mapCount.keySet());
  System.out.print(mapCount.values());
 }

 public static void main(String[] args) {
  Inital();
  putUserTrack();
  getCommonTrack();
 }
}

 

大家帮看看,这样解决行不行?有没有更好的思路!!!!

 

0 请登录后投票
   发表时间:2010-07-08  
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;


public class Log {



public static void main(String[] args){
//保存用户 访问 日志链
Map userLogMap = new HashMap();
//保存每个用户链的计数
Map countMap = new HashMap();
//假设日志保存到 log中
List log = new LinkedList();
//浏览每一个日志
for(int i = 0 ;i<log.size(); i++){
UserLog ul = (UserLog)log.get(i);
//取得用户的访问链
List tmp  = (List)userLogMap.get(ul.getUserId());

if(tmp==null){
tmp = new LinkedList();
}
//把用户的访问放到访问链中
tmp.add(ul.getPage());
//比要计数的链长了就把第一个去掉
if(tmp.size() > 3){
tmp.remove(1);
}
//正好等于要计数的链长度时计数
if(tmp.size() == 3 ){
//取得链中的路径,并计数后放到 map中
StringBuffer pagePath = new StringBuffer();
for(int j =0 ;j<tmp.size();j++){
pagePath.append(tmp.get(i)).append(",");
}
Long count = (Long)countMap.get(pagePath.toString());
if(count==null){
countMap.put(pagePath.toString(), 1);
}else{
countMap.put(pagePath.toString(), count+1);
}
}
userLogMap.put(ul.getUserId(), tmp);
}

}
}
class UserLog{
String userId;
String page;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getPage() {
return page;
}
public void setPage(String page) {
this.page = page;
}

}

随便写了一段,没有测试。
0 请登录后投票
   发表时间:2010-07-09  
倒,难道要规范用户的访问习惯,使他们访问一定都是按顺序访问?
0 请登录后投票
论坛首页 招聘求职版

跳转论坛:
Global site tag (gtag.js) - Google Analytics