Anda di halaman 1dari 5

Version 1.

[WEB PROGRAMMING PRACTICE QUESTIONS]

January 27, 2012

Cart Application
The following figures show the user interface for the first two pages of a cart application. Here the first page allows the user to add an item to the Cart, and the second page displays the items in the cart and allows the user to update the quantity or remove an item.

Fig 1 Index Page

Fig 2 The Cart Page

Talent Transformation Group

MindTree Ltd

Version 1.0

[WEB PROGRAMMING PRACTICE QUESTIONS]

January 27, 2012

Description I. II. III. Index page (Fig 1) when gets loaded, lists down all the CDs (description and price) & Add To Cart hyperlink as shown in the Fig 1 Add to Cart link when clicked, adds the item to the cart and the cart page gets displayed as shown in Fig 2. Update action in the Cart Page is used to update the quantity. To change the quantity, enter the new quantity and click on the Update button. The application should change the quantity and update the amount. Java Script Validation for Quantity in the Cart page should be performed to check and give alert message for the following violations o Should not be empty. o Should allow only numeric values o Should allow value in between 1 and 99 only Remove Item button in the cart page when clicked, removes the item row from the cart and displays back the same page. Continue Shopping button in the cart page when clicked takes the user back to the Index page where he can add more items to the cart. Checkout button in the cart page when clicked displays the total price of all the items in the cart next to it on the same page. (The result has not been shown in the Fig 2)

IV.

V. VI. VII.

Assumptions / Hint I. II. III. IV. User has disabled per-session cookies. Hint: Use URL encoding CD list as displayed in fig 1 need not come from database. Assume that all the data is stored in memory and no database has been used. Hint: the Cart object is a business object that is used to store all of the items for the users cart. If the client has multiple browser windows open, it is possible (though highly unlikely) that two threads from the same client will access the session object at the same time. As a result session object is not completely thread-safe. Propose and implement a solution for this.

Talent Transformation Group

MindTree Ltd

Version 1.0

[WEB PROGRAMMING PRACTICE QUESTIONS]

January 27, 2012

View & Delete Cookies


The web application is used to show all cookies for the current server. It also allows deleting all the cookies.

Fig 3 The Cookies Page Description I. II. III. The Cookies page (Fig 3) when gets loaded, lists down all the cookies (Name and value) stored for the current server. Add cookies add this button to the page which when clicked adds some cookie. Delete cookies add a button to the page which when clicked deletes all the cookies.

Assumptions / Hint I. II. Test out the feature by accessing the page if the cookies are getting added and deleted. You can choose to add any cookie of your choice for Add cookies feature.

Talent Transformation Group

MindTree Ltd

Version 1.0

[WEB PROGRAMMING PRACTICE QUESTIONS]

January 27, 2012

The Download Application


It is an application that lets registered user download sound files from a website. The user interface for the Download application consists of three pages. The index page lets a user select a CD. Then, if the user hasnt already registered with the site, the Register page registers the user by gathering the users first name, last name, and email address. Once the user is registered, the Download page lets the user select a song to download. If, for example, the user clicks on the MP3 link to the right of a song, that song is downloaded and played.

Fig 4 Index Page

Fig 5 Register Page

Fig 6 Download Page


Talent Transformation Group 4 MindTree Ltd

Version 1.0

[WEB PROGRAMMING PRACTICE QUESTIONS]

January 27, 2012

Description I. Check User is used to check if the user has already registered. o Reads the product code from the index page o Add the product code to the session o Read the User object from the session. The User object is NULL and a cookie named emailCookie is not available from the previous sessions redirect to the Register page The User object is NULL but the cookie exists, which means the user has registered before. -read the User data and sets the user object to the session and redirect to the requested products download page. The User object exists which means either the emailCookie was available or the user has already registered in this session - redirect to the requested products download page. Register is used to register a user o Creates a User object from the user entries and adds this object to the session object. o Creates a persistent cookie emailCookie that stores the users email address for 2 years and adds it to the response object. Then, if your browser has cookies enabled, you wont have to register each time you use this application. Otherwise, you will have to register each time you use this application. o Using the product code, forward to the appropriate download page Download page provides a place to download the selected album songs.

II.

III.

Assumptions / Hint I. II. III. IV. V. VI. VII. Set the default session timeout to 1 minute i.e. the session will be invalidated if a client doesnt access the session object within 1 minute. If a user requests the root directory of the application, the Index page should get displayed. Assume that each album has four digit album id which the index page sends as request parameter. MP3 files under an album will be placed under the path as /music/sound/<product_id>/*.mp3 You should be able to track the session even if the cookies are disabled in the browser. User object gets created after successful registration. Assume that the user details are stored in memory. You can store it as List<User>

***
Talent Transformation Group 5 MindTree Ltd

Anda mungkin juga menyukai