Saturday, March 10, 2007

C/C++/JAVA / JSP QUESTIONS

1. Difference between arrays and pointers?
2. What is the purpose of realloc( )?
3. What is static memory allocation and dynamic memory allocation?
4. How are pointer variables initialized?
5. Are pointers integers?
6. What is a pointer variable?
7. What is a pointer value and address?
8. What is a method?
9. What are the advantages of the functions?
10. What is the purpose of main( ) function?
11. What is an argument? differentiate between formal arguments and actual arguments?
12. What is a function and built-in function?
13. What is modular programming?
14. When does the compiler not implicitly generate the address of the first element of an array?
15. What are the characteristics of arrays in C?
16. Differentiate between a linker and linkage?
17. What are advantages and disadvantages of external storage class?
18. Diffenentiate between an internal static and external static variable?
19. What are the advantages of auto variables?
20. What is storage class and what are storage variable?
21. Which expression always return true? Which always return false?
22. Write the equivalent expression for x%8?
23. Why n++ executes faster than n+1?
24. What is a modulus operator? What are the restrictions of a modulus operator?
25. What is the difference between a string and an array?
26. Is it better to use a pointer to navigate an array of values,or is it better to use a subscripted array name?
27. Can the sizeof operator be used to tell the size of an array passed to a function?
28. Is using exit() the same as using return?
29. Is it possible to execute code even after the program exits the main() function?
30. What is a static function?
31. Why should I prototype a function?
32. How do you print an address?
33. Can math operations be performed on a void pointer?
34. How can you determine the size of an allocated portion of memory?
35. What is a “null pointer assignment” error? What are bus errors, memory faults, and core dumps?
36. What is the difference between NULL and NUL?
37. What is the heap?
38. Can the size of an array be declared at runtime?
39. What is the stack?
40. When should a far pointer be used?
41. What is the difference between far and near?
42. Is it better to use malloc() or calloc()?
43. Why should we assign NULL to the elements (pointer) after freeing them?
44. When would you use a pointer to a function?
45. How do you use a pointer to a function?
46. Can you add pointers together? Why would you?
47. What does it mean when a pointer is used in an if statement?
48. Is NULL always defined as 0?
49. What is a void pointer?
50. What is a null pointer?
51. How many levels of pointers can you have?
52. What is indirection?
53. How do you print only part of a string?
54. How can I convert a string to a number?
55. How can I convert a number to a string?
56. What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
57. How can you check to see whether a symbol is defined?
58. How do you override a defined macro?
59. What is #line used for?
60. What is a pragma?
61. What are the standard predefined macros?
62. How can type-insensitive macros be created?
63. How many levels deep can include files be nested?
64. Can include files be nested?
65. Can you define which header file to include at compile time?
66. What is the difference between #include and #include “file”?
67. Is it better to use a macro or a function?
68. How are portions of a program disabled in demo versions?
69. What is the benefit of using an enum rather than a #define constant?
70. What is the benefit of using #define to declare a constant?
71. Can a file other than a .h file be included with #include?
72. How can you avoid including a header more than once?
73. What will the preprocessor do for a program?
74. What is a macro, and how do you use it?
75. What is Preprocessor?
76. How can I make sure that my program is the only one accessing a file?
77. How can I open a file so that other programs can update it at the same time?
78. How do you determine whether to use a stream function or a low-level function?
79. What is the difference between text and binary modes?
80. How can you restore a redirected standard stream?
81. How do you redirect a standard stream?
82. How can I search for data in a linked list?
83. How can I sort a linked list?
84. What is hashing?
85. What is the quickest searching method to use?
86. What is the easiest searching method to use?
87. How can I sort things that are too large to bring into memory?
88. What is the quickest sorting method to use?
89. What is the easiest sorting method to use?
90. What is the benefit of using const for declaring constants?
91. Can static variables be declared in a header file?
92. What is the difference between declaring a variable and defining a variable?
93. Is it acceptable to declare/define a variable in a C header?
94. When should a type cast not be used?
95. When should a type cast be used?
96. How can you determine the maximum value that a numeric variable can hold?
97. How reliable are floating-point comparisons?
98. Can a variable be both const and volatile?
99. When should the volatile modifier be used?
100. When should the register modifier be used? Does it really help?



Top JSP interview questions

Categories: Interviews, Java, JSP

1. Can you make use of a ServletOutputStream object from within a JSP page?
2. Can a JSP page instantiate a serialized bean?
3. Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?
4. What is the page directive is used to prevent a JSP page from automatically creating a session?
5. How do you prevent the Creation of a Session in a JSP Page and why?
6. How do I include static files within a JSP page?
7. How can I implement a thread-safe JSP page?
8. How do I mix JSP and SSI #include?
9. Can a JSP page process HTML FORM data?
10. What JSP lifecycle methods can I override?
11. How do I perform browser redirection from a JSP page?
12. Is there a way to reference the “this” variable within a JSP page?
13. Can I stop JSP execution while in the midst of processing a request?
14. How do I use comments within a JSP page?
15. How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
16. How does JSP handle run-time exceptions?
17. How do I use a scriptlet to initialize a newly instantiated bean?
18. How can I enable session tracking for JSP pages if the browser has disabled cookies?
19. How can I declare methods within my JSP page?
20. How can I set a cookie and delete a cookie from within a JSP page?
21. Is there a way I can set the inactivity lease period on a per-session basis?
22. How does a servlet communicate with a JSP page?
23. How do I have the JSP-generated servlet subclass my own custom servlet class, instead of the default?
24. How do you pass control from one JSP page to another?
25. How do you restrict page errors display in the JSP page?
26. How do you call stored procedures from JSP?
27. How do you connect to the database from JSP?
28. What is Declaration?
29. What is difference between scriptlet and expression?
30. What is jsp:use bean. What are the scope attributes & difference between these attributes?
31. What are the implicit objects in JSP & differences between them?
32. What are Custom tags. Why do you need Custom tags. How do you create Custom tag?
33. What is the difference between include directive & jsp:include action?
34. What are advantages of JSP?
35. What is JSP?
36. Can a single JSP page be considered as a J2EE application?
37. How to call EJB from JSP.
38. What is the architecture of JSP?
39. What is the difference between servlet session and jsp session?
40. Why should we setContentType() in servlet ?what is the use of that method?
41. When jsp is compiled into servlet, where the servlet is actually stored(storage location)?
42. How to generate BAR & PIE Graphs using JSP code…?
43. What is the diff. b/n declaring members in and declaraing in jspinit() method ?
44. How to check the value in the text field is not a number
45. what is the use of extends in jsp…we we want to import a class in current jsp file which i am working how can i do that …if i use extnds for that means how can i do that…pls explain me this
46. I have a String name & Map m, in my bean class. I have get & set methods on both. To Display the String name, i do The above one works fine. Te below one, displays the entire Map contents I know the KEY, how do i display the VALUE for that KEY
47. What is the difference between , pagedirective include, action tag include ?
48. What are the default objects provided by JSP container? Other than page, request, session and context objects.
49. What is the default scope of jsp tags?
50. When many Users are browsing the same application at the same time and they click the “Submit” button will many objects be created for each and every User?
51. What is the difference between Difference between doGet() and doPost()?
52. How do we perform redirect action without using response.sendRedirect(” “);
53. A] Is the response.sendRedirect ends the existing session? B] If I logged in to a site ( say a.com) & then in same browser window I type the url for another site (say b.com), then does my session gets ended on first site ( a. com ) ?
54. How to overwrite the init and destroy method in a jsp page.
55. Where do we use hidden variables and url rewriting? and wat is the difference between them?
56. What is the difference between session and cookie ?
57. How to pass java script array to jsp page?
58. What is the difference betweeen JSP forward and servlet forward methods?
59. Where can we find the compiled file of jsp in the directory struture.
60. How we abort jsp page from a servlet
61. What is difference between getAttribute() and getParameter()?
62. What is the diff. b/w PAGE,APPLICATION and SESSION implicit objects of JSP?
63. Wat is the difference between and in jsp..wen translate into servlet..wer it is stored in servlet..can we create global variables in jsp..if yes then how??
64. How can i restrict the user from Clicking of Back button in any browser
65. In one class i stored the key and values in the hashmap.so using key value i have to check wheter the value for key is correct or not.so how to retreive the key and values in jsp page
66. What is the differnce between application server and web server
67. What is use of implict Objects?why the container is given those one?
68. How to delete cookies in JSP?
69. In Oracle table some fields are “null”.By default it will show as “null” in JSP page text box.But i dont want that. I want as blank textbox.What i can do for that?
70. In Internet explorer if we give a jsp , How the server will know it has to execute?
71. How the jsp changes will be effected in servlet file after converting?
72. When to use struts technology? What type of applications are developed using struts frame work?
73. What is the need of taglibraries?
74. Explain online banking system using java.that means i need architecture of online banking system.please sir i want full details
75. Text in textarea cant be copy by anyone while it is running in the browser (i.e,the text cant be copy and then paste on the other page) give me suggestion?
76. How can i clear values in sessions. if i open a jsp page it is containing previous values. then i need to open a new page then only i am getting a fresh page
77. What data is stored in the variable appname when we give the folowing statement String appname=(”manager”.equalsIgnoreCAse(request.getContextPath()))?”/manager”:”/portal”;
78. Web browser concept using jsp
79. Why we can’t implement interface in JSP? Why we can only extend classes in JSP?
80. How can we implement logoutpage using jsp ..? and Is there any method to force the browser to show the same page again and again after logout..?
81. How to Upload a textfile from JSP to Servlet
82. My html form contains an INPUT “text” element that accepts Date, i want to catch that date and want to query it using JSP? In short, how can i use that HTML form element with Prepared Statements in JSP?
83. Types of indexing used in oracle applications ? and when and how we decide to implement indexing to database ?
84. What is the need of implicit objects?
85. When we design some login form how we manage security for those forms?which technology used for that purpose?
86. How Do you implement interface in JSP?
87. How can initialize interface in JSP?
88. How do u maintain a Session?
89. What is the differences between JSP LifeCycle and Servlet LifeCycle?
90. Can I call an interface in a JSP?
91. What is the Difference between sendRedirect() and Forward?
92. I want to place two buttons one for save and one for delete.i am using DispatchAction as controller,how can i find which button i am pressing and how to diffrentiate?
93. What is JSP
94. What is the difference betweeen a statis and dynamic include?
95. How can my JSP communicate with java class file
96. I want to accomplish the following scenario: 1) user submits a jpg/gif file from an html form (using in the form, the user can browse to a file of their choice) 2) upload the jpg/gif file through a combination of Java and JSP’s 3) put the jpg/gif into a database on a server and/or into a folder on my local system.
97. How to pop up a jsp page?refreshing every two seconds.
98. What is difference between scriptlet and expression
99. What does < %= obj.getXXX() %> the following expression get evaluated to ?
100. How can we move from one JSP page to another(mean using what tecnique?)

No comments:

Post a Comment