|
My Public Key (GPG)
|
My Sign|
Travel Snaps|
Blog
|
Fork my (GitHub) projects!
|
Kundavai Kesavan
Sample qns for: I'm just fresher | oops | yahoo! | cognizant | consim | advanced? | generic | Zend Frame Works
For better readability set , Font{Face:Courier New;Size:11}
MySQL
Design for a `comments` module of a blog.
UTF-8 acceptance for `comments` column
mysql> SELECT * FROM INFORMATION_SCHEMA.CHARACTER_SETS WHERE CHARACTER_SET_NAME='utf8';
+--------------------+----------------------+---------------+--------+
| CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION | MAXLEN |
+--------------------+----------------------+---------------+--------+
| utf8 | utf8_general_ci | UTF-8 Unicode | 3 |
+--------------------+----------------------+---------------+--------+
MyISAM - What? Why? How?
Speed-Up the MySQL server.
Performance tuning configuration for various types of engines
Increasing buffer size:
mysql> show variables like '%BUFFER_SIZE%';
+-------------------------+---------+
| Variable_name | Value |
+-------------------------+---------+
| bulk_insert_buffer_size | 8388608 |
| innodb_log_buffer_size | 1048576 |
| join_buffer_size | 131072 |
| key_buffer_size | 16384 |
| myisam_sort_buffer_size | 8388608 |
| preload_buffer_size | 32768 |
| read_buffer_size | 258048 |
| read_rnd_buffer_size | 258048 |
| sort_buffer_size | 65528 |
+-------------------------+---------+
Truncate Vs Delete on various engines
Replication - What? Why? How?
SQL Optimization
mysql> show variables like '%SLOW_%';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| log_slow_queries | OFF |
| slow_launch_time | 2 |
+------------------+-------+
2 rows in set (0.00 sec)
EXPLAIN EXTENDED SELECT
What? Why? How ?
Query to fetch records sets for LATEST e_action,e_id from TBL_EVENT for all user_name in TBL_USER.
mysql> DESC TBL_EVENT;DESC TBL_USER;
+----------+-------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+-------------------+----------------+
| e_id | tinyint(4) | NO | PRI | NULL | auto_increment |
| e_action | varchar(22) | YES | | NULL | |
| e_time | timestamp | YES | | CURRENT_TIMESTAMP | |
+----------+-------------+------+-----+-------------------+----------------+
3 rows in set (0.00 sec)
+-----------+---------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------------------+------+-----+---------+----------------+
| user_id | tinyint(3) unsigned | NO | PRI | NULL | auto_increment |
| user_name | varchar(16) | NO | UNI | | |
| e_id | tinyint(4) | NO | | | |
+-----------+---------------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
Concurrent INSERT's. How it is operated?
Web-Service
WDDX
wddx_add_vars . Add variables to a WDDX packet with the specified ID
wddx_deserialize . Alias of wddx_unserialize
wddx_packet_end . Ends a WDDX packet with the specified ID
wddx_packet_start . Starts a new WDDX packet with structure inside it
wddx_serialize_value . Serialize a single value into a WDDX packet wddx_serialize_value("PHP to WDDX packet example", "PHP packet");
wddx_serialize_vars . Serialize variables into a WDDX packet
wddx_unserialize . Unserializes a WDDX packet
SOAP-WSDL
Auth in WSDL
PHP-Security
SQL Injection - How to handle
DATA Leak
DATA Manupulation
DATA corruption
PHP-OOPs
Polymorphism in PHP
Design a parent/child for geometric shapes of
SQUARE
Rectange
Circle
Pass by Value & Reference ( for functions)
PHP 5/4
PHP 5.0 Vs PHP 4.0
__sleep() & __wakeup()
Magic methods
PHP Core
Add an Extn to PHP #code it, compile it,make bin , share it with world
== & === #dont answer this compares values,that compares value with type.
mysql_pconnect() #dont answer this checks for any opened connection and use it.
Program solving skills
Algorithm to solve the following problems.
Scenario 1:
In a world of population N,election is going to elect a president.
Each person has a vote & is gurranted of 100% voting.
The winner must be an absolute and comes from `K` nominations.
returnVote() is ready to use for your algorithm,returns the last vote.ie, one among K.
Polling starts at time T(0) and ends at T(N-1).
Aware that the N is very High approching at 10^30 and K too approch at 2^32.
Help us to solve this scenario by suggesting some algorithms.
Also justify the best one over Time and Space.
Scenario 2:
It is found that there is a two dimensional world exists.
To analayze that wonderful world,scientists design some bots & drop such a two A,B from a copter.
___ ___
|*_*| |*_*|
----- -----
| | |= | | |=
| A | | | B | |
____|___|____|____________________|___|__|_____________
...u v w x y z ....
That world has some special propeties that a bot can stand on single unit space.
Say at x or y or some point and not on two points.
And movement allowed to one unit space at any point of time.ie, to either u or w from v.
Each bot has sent with a single flag,which they can plant anywhere,
and it can be identified by the other.
After their analysis, the bots need to get together themselves and reports to people in our earth.
Bots are clone of each other and runs per they programmed.
Some expert guys have their algo for the following modules.
turnLeft() #returns nothing, but bot turn left
turnRight() #returns nothing, but bot turn right
moveNext() #returns nothing, but bot move to next unit space
plantFlag() #plant the flag.**BOT CRASHED IF CALLED SECOND TIME**
Control Structures of if-else,while,break,continue,switch can used, if need.
Once any one of the bot returns 'BOT' , the game is OVER.
Help us to design the algorithm returnNext() for the bots.
#desc:returns object in next unit space of facing direction,either of ENUM[NULL,FLAG,BOT]
#auth:you
#date:today
returnNext(){
}
|
Return to Kesavan Muthuvel's home page. Please send comments on these web pages to hi@kesavan.info (or) Feedback here
CopyLeft |
|