You are on page 1of 4

SENIORS INTERVIEW QUESTIONS

Do all questions in 2 hours (Max) total 30marks (Pass Mark 24) Names: Date Question 1 (html-css presentation and php processing); 10 points Generate a grid similar to the one below using PHP, Html, Tables and CSS . (Numbers increment columns first). In this grid change the cell background as follows.
0 1 2 3 3 7 3 8 3 9 4 0 4 1 4 2 7 8 7 9 8 0 8 1 19 1 10 2 80 8 99 1 90 2 91 2 98 5 99 5 90 6 91 6 92 6 97 9 98 9 99 9

1. 2. 3. 4. 5.

First column is cyan [----] First row is yellow [----] multiples of 8 are orange [----] square values are red [----] prime numbers are black [----] (text is white) Number of rows and columns are up to you If color overlap the later dominates i.e. 64 is red instead of orange.

Question 2a (php & database); 8 points Build a simple web page with one text box and a search button. When submitted your form will process as described in (Question 3) and display results as follows.
1. Display search phrase and first 30 records. Also indicate how many results exist. Highlight perfect match words as Bold. Highlight misspelled match words with Bold and italics. Display the score that the record has on the search phrase. Display records ordered by score descending. (Highest score first)

2. 3. 4. 5.

Question 2b (AJAX); 8 points Using a javascript library of your choice. Make a call to a server side script ( onclick ). Update two separate divs using separate parts of the results returned. The server side script pulls record number 8 from question 3 below. The diagram below illustrates the required result.

Question 3 (Database); 4 points To be used in (Question 2). On your localhost using, user name guest with password interview, create a mysql database called Interview. Inside it a table messages with the following structure id (primary key) message (var char - 255) date created (current time) date modified ( current time - auto-update) populate it with 200 records of random data . Use this table to search for records. Your search should meet the following requirements. Search for the words in any given order This is a search phrase and A search phrase this is. Tag records with a score values in the following order; (1) all words in the same order, (2) all words in any order, (3) most search words with mismatched word misspelled, (4) most words with highest count, i.e. 5 matches of 3/4 search words then 4 matches of 3/4 search words, (5) most search words. Consider records which match at least 30% of the search words. Your queries should be optimized to minimize load and data transferred.

MARKING SCHEME:
Php manual : http://192.168.0.98/php mysql manual : http://192.168.0.98/mysql java manual : http://192.168.0.98/java Time taken: 3 Marks.

Question 1: (10 marks) Table generation code PHP; Clean HTML & CSS: Number setup and presentation Row and column colors & logic: Square and octal colors & logic: Prime number colors & logic: CSS allocation logic overall: Rules: 1. No marks overall if table is hard-coded. 2. No marks for colors if not using CSS. 3. No marks for fixed logic, e.g. using (if($x == 4)). Question 3: (4 marks shared between 2a and 2b) Mysql Command Line manipulation. Queries used to extract data

1 point; 1 point; 1 point; 1 point; 2 points; 2 points 1 point;

1 point; 3 points;

Rules: 1. No query marks if all computation is in application e.g. using select * from messages Question 2a: (8 marks) HTML form and PHP processing Security against SQL injection 1 point; Query generation logic and general search algorithm 2 points; Result manipulation and scoring logic 1 point; Result presentation 2 points; Error handling/ reporting and user controls 1 point; Rules: 1. No marks if page not loading. 2. No marks if DB is not being used. Questions 2b (8 marks) Java input control and general code implementation

1 point;

Query generation logic and general search algorithm Result manipulation and scoring logic Result presentation Error handling/reporting and user controls

2 points; 1 point; 2 points; 1 point;

Rules: 1. No marks if program is not running. 2. No marks if DB is not being used.

You might also like