MySQL management interview questions

Category: Unix/Linux Questions    |    2 views    |    Add a Comment
  1. How do you show the currently running queries? - SHOW FULL PROCESSLIST;
  2. How do you kill a MySQL query? - See the ID of it from the question above, then KILL id. You can separate multiple IDs by space.
  3. I need to find out how many client connections were aborted by MySQL server. - It’s displayed in SHOW STATUS query, alternatively accessible via mysqladmin extended-status.
  4. What does SET SQL_AUTO_IS_NULL =1 do? - you can find the last inserted row for a table that contains an AUTO_INCREMENT column by issuing WHERE auto_increment_column IS NULL

Share/Save/Bookmark

 

Basic shell scripting questions

Category: Unix/Linux Questions    |    1 views    |    Add a Comment
  1. How do you find out what’s your shell? - echo $SHELL
  2. What’s the command to find out today’s date? - date
  3. What’s the command to find out users on the system? - who
  4. How do you find out the current directory you’re in? - pwd
  5. How do you remove a file? - rm
  6. How do you remove a - rm -rf
  7. How do you find out your own username? - whoami
  8. How do you send a mail message to somebody? - mail
  9. How do you count words, lines and characters in a file? - wc
  10. How do you search for a string inside a given file? - grep string filename
  11. How do you search for a string inside a directory? - grep string *
  12. How do you search for a string in a directory with the subdirectories recursed? - grep -r string *
  13. What are PIDs? - They are process IDs given to processes. A PID can vary from 0 to 65535.
  14. How do you list currently running process? - ps
  15. How do you stop a process? - kill pid
  16. How do you find out about all running processes? - ps -ag
  17. How do you stop all the processes, except the shell window? - kill 0
  18. How do you fire a process in the background? - ./process-name &
  19. How do you refer to the arguments passed to a shell script? - $1, $2 and so on. $0 is your script name.
  20. What’s the conditional statement in shell scripting? - if {condition} then … fi
  21. How do you do number comparison in shell scripts? - -eq, -ne, -lt, -le, -gt, -ge
  22. How do you test for file properties in shell scripts? - -s filename tells you if the file is not empty, -f filename tells you whether the argument is a file, and not a directory, -d filename tests if the argument is a directory, and not a file, -w filename tests for writeability, -r filename tests for readability, -x filename tests for executability
  23. How do you do Boolean logic operators in shell scripting? - ! tests for logical not, -a tests for logical and, and -o tests for logical or.
  24. How do you find out the number of arguments passed to the shell script? - $#
  25. What’s a way to do multilevel if-else’s in shell scripting? - if {condition} then {statement} elif {condition} {statement} fi
  26. How do you write a for loop in shell? - for {variable name} in {list} do {statement} done
  27. How do you write a while loop in shell? - while {condition} do {statement} done
  28. How does a case statement look in shell scripts? - case {variable} in {possible-value-1}) {statement};; {possible-value-2}) {statement};; esac
  29. How do you read keyboard input in shell scripts? - read {variable-name}
  30. How do you define a function in a shell script? - function-name() { #some code here return }
  31. How does getopts command work? - The parameters to your script can be passed as -n 15 -x 20. Inside the script, you can iterate through the getopts array as while getopts n:x option, and the variable $option contains the value of the entered option.

Share/Save/Bookmark

 

Linux application programming questions

Category: Unix/Linux Questions    |    3 views    |    Add a Comment
  1. Explain the difference between a static library and a dynamic library? - Static library is linked into the executable, while a dynamic library (or shared object) is loaded while the executable has started.
  2. How do you create a static library? - If you have a collection of object (.o) files, you can do it by running ar command. Generally a static library has a .a extension, and you can link it into an executable by providing -l libraryname to gcc.
  3. Where should the developed libraries be installed on the system? - GNU recommends /usr/local/bin for binaries and /usr/local/lib for libraries.
  4. What’s LD_LIBRARY_PATH? - It’s an environment variable that lists all the directories which should be searches for libraries before the standard directories are searched.
  5. How do you create a shared library? - Create the object file with -fPIC for position-independent code, then run gcc with -shared option.
  6. How do you install a shared library? - Run ldconfig in the standard directory that it’s installed in.
  7. What does ldd do? - It shows a list of installed shared libraries.
  8. How do you dynamically load a library in your app? - Use dlopen()
  9. What does nm command do? - It reports the list of symbols in a given library.

Share/Save/Bookmark

 

Basic Java interview questions

Category: JAVA Questions    |    5 views    |    Add a Comment

Why do you prefer Java?Answer: write once ,run anywhere.

2. Name some of the classes which provide the functionality of collation?

Answer: collator, rulebased collator, collationkey, collationelement iterator.

3. Awt stands for? and what is it?

Answer: AWT stands for Abstract window tool kit. It is a is a package that provides an integrated set of classes to manage user interface components.

4. why a java program can not directly communicate with an ODBC driver?

Answer: Since ODBC API is written in C language and makes use of pointers which Java can not support.

5. Are servlets platform independent? If so Why? Also what is the most common application of servlets?

Answer: Yes, Because they are written in Java. The most common application of servlet is to access database and dynamically construct HTTP response

Share/Save/Bookmark