The first problem is to do with dealing with database concurrency, see this blog post for a good explanation.
Two isn't really a problem, as he will simply login from his home computer and create a new session. Most web apps support multiple same user sessions. If that's not the behaviour you want, you have to do some work. Not if that is the desired behaviour.
Prob_2:这是网络应用程序的标准问题。在 asp.net 中,有很多方法可以利用 global.asax 检查给定用户是否已经登录。这是教程,其中包含所有答案 - 让自己崩溃:)
Prob_1: Unless there is a lock-in approach to editing the data (the data is locked when you read it and untill you're done no-one can edit, in that case the other admins wouldn't have been able to edit while our guy was on his coffee-break) when the guy comes back and updates the values (assuming that all the values currently on screen will be overridden when click update on this app) there's no reason why the value you're talking about should not be 2.
Nevertheless, said so I suspect that:
my answer doesn't make any sense - I am trying to interpret your question to my best but there's good chances smt is getting lost in translation.
the interviewers wanted you to say something about the session timeout which expires during the coffee-break
Prob_2: this is a standard problem of web-apps. In asp.net there's plenty of ways of checking if a given user is already logged in leveraging global.asax. Here's a tutorial with all the answers - knock yourself out :)
发布评论
评论(2)
第一个问题是处理数据库并发性,请参阅 this博客文章 以获得很好的解释。
两个并不是真正的问题,因为他只需从家用计算机登录并创建一个新会话即可。大多数网络应用程序支持多个相同的用户会话。如果这不是您想要的行为,那么您必须做一些工作。如果这是所需的行为,则不会。
The first problem is to do with dealing with database concurrency, see this blog post for a good explanation.
Two isn't really a problem, as he will simply login from his home computer and create a new session. Most web apps support multiple same user sessions. If that's not the behaviour you want, you have to do some work. Not if that is the desired behaviour.
问题_1:除非有一种锁定方法来编辑数据(当您读取数据时,数据会被锁定,直到您完成为止,没有人可以编辑,在这种情况下,其他当我们的人回来并更新值(假设当前屏幕上的所有值都将是)时,管理员将无法编辑(当我们的人在喝咖啡休息时)当点击这个应用程序上的更新时被覆盖)没有理由你所说的值不应该是2。
尽管如此,我怀疑:
Prob_2:这是网络应用程序的标准问题。在 asp.net 中,有很多方法可以利用 global.asax 检查给定用户是否已经登录。这是教程,其中包含所有答案 - 让自己崩溃:)
Prob_1: Unless there is a lock-in approach to editing the data (the data is locked when you read it and untill you're done no-one can edit, in that case the other admins wouldn't have been able to edit while our guy was on his coffee-break) when the guy comes back and updates the values (assuming that all the values currently on screen will be overridden when click update on this app) there's no reason why the value you're talking about should not be 2.
Nevertheless, said so I suspect that:
Prob_2: this is a standard problem of web-apps. In asp.net there's plenty of ways of checking if a given user is already logged in leveraging global.asax. Here's a tutorial with all the answers - knock yourself out :)