Ebeworld’s Weblog

Trying to create

Declarative vs Procedural Programming

Procedural programming requires that the programmer tell the computer what to do. That is, how to get the output for the range of required inputs. The programmer must know an appropriate algorithm.

Declarative programming requires a more descriptive style. The programmer must know what relationships hold between various entities.

January 10, 2009 Posted by ebeworld | Interview Questions | | No Comments Yet

When to use GridView and when to use Repeater?

Control – Capability wise 

GridView – Read/Edit
DataList – Read/Edit
Repeater – Read Only
DetailsView – Read/Edit/Create
FormView – Read/Edit/Create

 

Feature wise

Feature

Repeater

DataList

GridView

Table layout

No

No

Yes

Flow layout

Yes

Yes

No

Column layout

No

Yes

No

Style properties

No

Yes

Yes

Templates

Yes

Yes

Columns/optional

Select/ Edit/Delete

No

Yes

Yes

Sort

No

No

Yes

Paging

No

No

Yes

December 18, 2008 Posted by ebeworld | C# | | No Comments Yet

C# and Java static constructors

Where should be initialize the static field? If we do it non static initializer, each time when object created the static field will be initialized and that not efficient and may undo what we have done in up to that moment. The solution is to use static constructor. in Java, it is used when class is loaded and written as[it is called static block] 

static{

//..something

}

but in C#, it is accomplished by real static constructor

static MyClass{

//.. do something

}

November 22, 2008 Posted by ebeworld | Interview Questions | | No Comments Yet

DB query optimization questions

1. Some where statement can be done using join statement. For example.
SELECT A.NAME FROM A,B
WHERE A.NAME=B.NAME; 
 
SELECT A.NAME FROM A JOIN B
   ON A.NAME=B.NAME;
 
which one the faster?
2.
 

November 1, 2008 Posted by ebeworld | Database, Interview Questions | | No Comments Yet

Performance: C++ vs Java

Java byte code runs after JVM optimize it, therefore in some cases, if user is doing the repetitive tasks again and again, Java code might be faster than C++ code.For example.

1. creating new object and deleting it for substantial times. In this case JVM use previously not yet garbage collected objects, such as 1st generation, 2nd generation candidates.

2. Repetative function calling. http://kano.net/javabench/ has quite good examples.

3. Experienced C++/Java  programmers write codes for human readability. For example

Person* manager=new Person();

//..Do something with managerand finish

delete(manager);

Person* worker=new Manager();

//..Do something with worker and finish

delete(worker);

Here C++ would allocate 2wice. But JVM would walk though byte code and figure out there are in fact only one is needed and use it again. Because of readability C++/Java developers wouldn’t dare to use one object for worker and manager, but Java code with same readability would be optimized and might run faster than its C++ code.

November 1, 2008 Posted by ebeworld | Interview Questions, Java | | No Comments Yet

DB related

 

  1. Has a view got its own data? No, if it is not a materialized view.
  2. 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.
    1. Views that reference multiple tables generally perform much faster with an indexed viewbecause the join between the tables is preconstructed.

    2. ? 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.

    3. ? 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.

  3. What is the difference between user defined function and stored procedures

    1. Can return a value of most SQL Server data types. Excluded return types include text, ntext,image, cursor, and timestamp.
    2. 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.

  4. What is the SQL Server agent?

    1. 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.

  5. What is the SQL Server Browser?


    1. Supports advertising your server so those browsing your local network can identify your system has SQL Server installed.


  6. What is the the default port?


    1. that the IP NetLib will listen on is 1433.


  7. In how many ways can you see SQL Server query result?


    1. 3, File,Grid,Text



  8. What is SSIS used for?

    1. 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

  9. What is the INNER,LEFT,RIGHT, AND FULL JOINS and what is their difference with CROSS JOIN?

    1. PLEASE BE CAREFUL ON ‘ON ’ STATEMENT, WHEN YOU SPECIFY JOIN CONDITION.

    2. CROSS JOIN DOESN’T HAVE ON STATEMENT, IT JUST GIVES CARTESIAN PRODUCT OF THE TWO.

  10. WHAT IS THE WILD CARD IN SQL? %, FOR EXAMPLE. LIKE ‘GOOG%’
  11. 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.

October 31, 2008 Posted by ebeworld | Interview Questions | | No Comments Yet

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?

October 19, 2008 Posted by ebeworld | Interview Questions, Java | | No Comments Yet

Load testing tools

Rational Robot, JMeter, LoadRunner are a few of them

October 19, 2008 Posted by ebeworld | Interview Questions, Java | | No Comments Yet

JSP life cycle

Explain the life cycle methods of a JSP?

Pre-translated:Before the JSP file has been translated and compiled into the Servlet.
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.
 

 

October 15, 2008 Posted by ebeworld | Interview Questions, Java | | No Comments Yet

Signed applet

A signed applet can become a trusted applet, which can work outside the sandbox.

October 14, 2008 Posted by ebeworld | Interview Questions, Java | , | No Comments Yet