Monday, 22 September 2014

Memcached interview questions and answers

Memcached interview questions and answers

What is Memcached?
It is component which stored the data temporary for 1 Hour/ 6 Hour/1 Day etc. When we integrate the Memcached with our application, performance of application increased.
OR
Memcached is open source, high-performance distributed memory object used for caching so that execution can be enhanced at nth level.



How Memcached Works?
  • Try to get to get the detail of user, Browser send the request to application.
  • Application call the Memcached for particular user.
  • If Result found in Memcached, Return the result from Memcached.
  • If Result Not found in Not Memcached, Application send the request to database and save the result in memcached.
  • Each Memcached have one unique key.
  • Get/Set the data works on the behalf of key.
  • you can also delete one or more keys.
  • You can also assign tags to one/more keys.



Who is Author of Memcached?
Danga Interactive


In which Language Memcached is Written?
'C' Language


What is offical website of Nginx?
http://www.memcached.org/


When Memcached's initial version launched?
May 22, 2003




What is the Best Usage of Memcached?
  • Easy to install in windows as well as in unix system.
  • it offers API integration for all the major languages like Java, PHP, C/C++, Python, Ruby, Perl etc
  • Improve the performance of web application by caching
  • Reduce the burden of Db server
  • You can delete one/more values.
  • you can update the values of keys.
  • You can use use "Tags" for keys.



How to install Memcached?
Click Here


Memcached Commands
Connecting to Memcached server with telnet Command?
telnet hostName portNumber


How to get the value of key?
get key


How to set the value of Key?
set key 0 900 4
Format: set [key] [flags] [exptim] [bytes] [noreply]


How to add the value in Key?
add key 0 900 4
Format: add [key] [flags] [exptim] [bytes] [noreply]


How to replace the value of Key?
replace key 0 900 4
Format: replace [key] [flags] [exptim] [bytes] [noreply]


How to append the value of Key?
append key 0 900 4
Format: append [key] [flags] [exptim] [bytes] [noreply]


How to prepend the value of Key?
prepend key 0 900 4
Format: prepend [key] [flags] [exptim] [bytes] [noreply]


How to delete the Key?
delete key 


How to show the Stats?
stats


How to get the Version?
Version


How to close the connection?
quit

Wednesday, 17 September 2014

UNIX Commands Interview Questions and Answers

UNIX Commands Interview Questions and Answers

Question: How to create readonly file?
touch fileName.txt
chmod 400 fileName.txt


Question: How to get the OS in unix?
uname -a


Question: How do you know if a remote host is alive or not?
ping www.example.com
telnet www.example.com


Question: How to copy from one host to another host?
scp file.zip username@hostname:/foldername


Question: How do you find which process is taking how much CPU?
top


Question: How do you check how much space left in current drive
dh-h

Question: How to Restart Apache over the SSH?

/etc/init.d/apache2 restart


Question: How to Stop Apache over the SSH?

/etc/init.d/apache2 stop


Question: How to Start Apache over the SSH?

/etc/init.d/apache2 start


Question: How to Restart Httpd over the SSH?

service httpd restart


Question: How to Stop Httpd over the SSH?

service httpd stop


Question: How to Start Httpd over the SSH?

service httpd start


Question: Import database from sql file to mysql?

mysql –u username –p databasename tablename < sqlfilename.sql


Question: How to delete ALL files including sub directory in current directory with prompting each time?

rm –r *


Question: How to display first 7 lines of file?

head -7 fileName.txt


Question: How to display Last 7 lines of file?

head -7 fileName.txt


Question: How to reverse a string in unix?

echo "Web technology expert notes" | rev


Question: How to unzip a file in Linux?

unzip –j file.zip


Question: How to test if a zip file is corrupted in Linux?
unzip –t file.zip


Question: How to find hidden files in current directory?
ls -lrta


Question: How to check if a file is zipped in Unix?
file file.txt //file.txt: ASCII text


Question: How to check all the running processes in Unix?
ps –ef


Question: find all files in current and subdirectories which contains 'webtechnology' name?
find . -name 'webtechnology'


Question: How to make any script file executable?
chmod 755 *.sh


Question: How to kill process in unix server?
kill -9 #pid