DB related
- Has a view got its own data? No, if it is not a materialized view.
- Does indexing view always result performance increase? No, for example, the table underlying is modified frequently, the indices have to be updated frequently, which result performance decrease.
- Views that reference multiple tables generally perform much faster with an indexed viewbecause the join between the tables is preconstructed.
? Aggregations performed in the view are precalculated and stored as part of the index; again,this means that the aggregation is performed one time (when the row is inserted or updated),and then can be read directly from the index information.
-
? Inserts and deletes have higher overhead because the index on the view has to be updated immediately; updates also have higher overhead if the key column of the index is affected by the update.
- Views that reference multiple tables generally perform much faster with an indexed viewbecause the join between the tables is preconstructed.
-
What is the difference between user defined function and stored procedures
- Can return a value of most SQL Server data types. Excluded return types include text, ntext,image, cursor, and timestamp.
- Can’t have “side effects.” Basically, they can’t do anything that reaches outside the scope of the function, such as changing tables, sending e-mails, or making system or database parameter changes.
-
What is the SQL Server agent?
-
The main engine behind anything in SQL Server that is scheduled. Utilizing this service, you can schedule jobs to run on a variety of different schedules. These jobs can have multiple tasks assigned to them and can even branch into doing different tasks depending on the outcome of some previous task. Examples of things run by the SQL Server Agent include backups as well as routine import and export tasks.
-
-
What is the SQL Server Browser?
Supports advertising your server so those browsing your local network can identify your system has SQL Server installed.
What is the the default port?
that the IP NetLib will listen on is 1433.
In how many ways can you see SQL Server query result?
3, File,Grid,Text
What is SSIS used for?-
With SSIS, a tremendous amount of the coding (usually in some client-side language) that had to be done to perform complex data extracts or imports.Previously, Data Transformation Service DTS
-
-
What is the INNER,LEFT,RIGHT, AND FULL JOINS and what is their difference with CROSS JOIN?
-
PLEASE BE CAREFUL ON ‘ON ’ STATEMENT, WHEN YOU SPECIFY JOIN CONDITION.
-
CROSS JOIN DOESN’T HAVE ON STATEMENT, IT JUST GIVES CARTESIAN PRODUCT OF THE TWO.
-
-
WHAT IS THE WILD CARD IN SQL? %, FOR EXAMPLE. LIKE ‘GOOG%’
-
What is the difference between WHERE and HAVING?
WHERE is applied to each row before row is considered in GROUP BY, HAVING is applied on results of GROUP BY.
12. What is the difference between INSERT and INSERT INTO? None, since INTO is optional.
13. How do you insert default values into table column? Using DEFAULT keyword
INSERT INTO PERSON VALUE(1,NULL,DEFAULT)
13. What is the INSERT INTO… SELECT for?
Select results are inserted. No need to specify VALUES.
14. Simplify following inner join.
SELECT *
FROM HumanResources.Employee e
INNER JOIN HumanResources.Employee m
ON e.ManagerID = m.EmployeeID;SELECT *
FROM HumanResources.Employee e, HumanResources.Employee m
WHERE e.ManagerID = m.EmployeeID;The first one is the ANSI standard, the following is not, but supported by all the major SQL platforms.
15. In MS Sql server, what is the alternative way of using left and right join?
By using *= and =* which are stands for LEFT JOIN and RIGHT JOIN. For example, left join can be
SELECT e.EmployeeID, m.EmployeeID AS ManagerID
FROM HumanResources.Employee e, HumanResources.Employee m
WHERE e.ManagerID *= m.EmployeeID;
16. Alternatively how are you going to write CROSS JOIN.
By using ,. For example.
SELECT *
FROM Film f, Actors a;which gets cross join of a and f.
17. What is the difference between UNION and JOIN?
UNION ‘concatenates’ the query results.
18. What is the object naming convention in ms sql.
[[[ServerName].DatabaseName.]SchemaName.]ObjectName
19. What is the scheme?
is stands for ownership.
AI questions
1. What is the A* algorithm?
2. What is the AO* algorithm, and what is its difference with A* graph?
Testing BlogJet
I have installed an interesting application – BlogJet. It’s a cool Windows client for my blog tool (as well as for other tools). Get your copy here: http://blogjet.com
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination.” — Albert Einstein
Some questions
1. What is the iterative software development method?
2. What is agile software development method?
3. What is RUP? What are the its parts?
4. What is the TDD, test driven development method?
Load testing tools
Rational Robot, JMeter, LoadRunner are a few of them
JSP life cycle
Translated: The JSP file has been translated and compiled as a Servlet.
Initialized: Prior to handling the requests in the service method the container calls the jspInit() to initialize the Servlet. Called only once per Servlet instance.
Servicing: Services the client requests. Container calls this method for each request.
Out of service: The Servlet instance is out of service. The container calls the jspDestroy() method.
Signed applet
A signed applet can become a trusted applet, which can work outside the sandbox.
Very common questions
Tell me about yourself or about some of the recent projects you have worked with? What do you consider your most significant achievement? Why do you think you are qualified for this position? Why should we hire you and what kind of contributions will you make?
Â
􀂃 Design concepts and design patterns: How you understand and applied them.
􀂃 Performance and memory issues: How you identified and fixed them.
􀂃 Exception handling and best practices: How you understand and applied them.
􀂃 Multi-threading and concurrent access: How you identified and fixed them.
Â
Why are you leaving your current position?
􀂃 Do not criticize your previous employer or coworkers or sound too opportunistic.
􀂃 It is fine to mention a major problem like a buy out, budget constraints, merger or liquidation.
􀂃 You may also say that your chance to make a contribution is very low due to company wide changes or looking for a more challenging senior or designer role.
memory leaks
In Java, typically memory leak occurs when an object of a longer lifecycle has a reference to objects of a short life cycle.This prevents the objects with short life cycle being garbage collected. The developer must remember to remove the references to the short-lived objects from the long-lived objects. Objects with the same life cycle do not cause any issues because the garbage collector is smart enough to deal with the circular references
How would you improve performance of a Java application?
Pool valuable system resources like threads, database connections, socket connections etc. Emphasise on reuse of threads from a pool of threads. Creating new threads and discarding them after use can adversely affect performance. Also consider using multi-threading in your single-threaded applications where possible to enhance performance. Optimze the pool sizes based on system and application specifications and requirements.
􀂃 Optimize your I/O operations: use buffering (Refer Q21 in Java section) when writing to and reading from files and/or streams. Avoid writers/readers if you are dealing with only ASCII characters. You can use treams instead, which are faster. Avoid premature flushing of buffers. Also make use of the performance and scalability enhancing features such as non-blocking and asynchronous I/O, mapping of file to memory etc offered by the NIO (New I/O).
􀂃 Minimize network overheads by retrieving several related items simultaneously in one remote invocation if possible. Remote method invocations involve a network round-trip, marshalling and unmarshalling of parameters, which can cause huge performance problems if the remote interface is poorly designed.
ô€‚ƒ Establish whether you have a potential memory problem and manage your objects efficiently: remove references to the short-lived objects from long-lived objects like Java collections etc to minimise any potential memory leaks. Also reuse objects where possible. It is cheaper to recycle objects than creating new objects each time. Avoid creating extra objects unnecessarily. For example use mutable StringBuffer/StringBuilder classes instead of immutable String objects in computation expensive loops as discussed in Q17 in Java section. Automatic garbage collection is one of the most highly touted conveniences of Java. However, it comes at a price. Creating and destroying objects occupies a significant chunk of the JVM’s time. Wherever possible, you should look for ways to minimise the number of objects created in your code:
ô€‚ƒ If repeating code within a loop, avoid creating new objects for each iteration. Create objects before entering the loop (i.e. outside the loop) and reuse them if possible.Â
􀂃 For complex objects that are used frequently, consider creating a pool of recyclable objects rather than always instantiating new objects. This adds additional burden on the programmer to manage the pool, but in select cases can represent an order of magnitude performance gain.
􀂃 Use lazy initialization when you want to distribute the load of creating large amounts of objects. Use lazy initialization only when there is merit in the design.
􀂃 Where applicable apply the following performance tips in your code:
􀂃 Use ArrayLists, HashMap etc as opposed to Vector, Hashtable etc where possible. This is because the methods in ArrayList, HashMap etc are not synchronized (Refer Q13 in Java Section). Even better is to use just arrays where possible.
􀂃 Set the initial capacity of a collection (e.g. ArrayList, HashMap etc) and StringBuffer/StringBuilder appropriately. This is because these classes must grow periodically to accommodate new elements.
So, if you have a very large ArrayList or a StringBuffer, and you know the size in advance then you can
speed things up by setting the initial size appropriately. (Refer Q15, Q17 in Java Section).
Minimise the use of casting or runtime type checking like instanceof in frequently executed methods
or in loops. The “casting” and “instanceof” checks for a class marked as final will be faster. Using
“instanceof” construct is not only ugly but also unmaintainable. Look at using visitor pattern (Refer
Q11 in How would you go about…? section) to avoid “instanceof” construct.
􀂃 Do not compute constants inside a large loop. Compute them outside the loop. For applets compute it
in the init() method.
􀂃 Exception creation can be expensive because it has to create the full stack trace. The stack trace is
obviously useful if you are planning to log or display the exception to the user. But if you are using your
exception to just control the flow, which is not recommended, then throw an exception, which is precreated.
An efficient way to do this is to declare a public static final Exception in your exception class
itself.
􀂃 Avoid using System.out.println and use logging frameworks like Log4J etc, which uses I/O buffers
(Refer Q21 in Java section).
􀂃 Minimise calls to Date, Calendar, etc related classes.
􀂃 Minimise JNI calls in your code.
-
Recent
-
Links
-
Archives
- August 2009 (1)
- July 2009 (2)
- April 2009 (4)
- March 2009 (6)
- February 2009 (5)
- January 2009 (4)
- December 2008 (3)
- November 2008 (35)
- October 2008 (20)
-
Categories
-
RSS
Entries RSS
Comments RSS