Wednesday, 23 August 2017

Questions

1- value type and reference type

2- ref and  out

3-struct and class

4-indexers in c#

5-can we override the static methods?

6-asp.net page life cycle.

7-session min and max timeout

8-Session management in webapi

9-Action filters in mvc

10- mvc life cycle

11- Ihttphandler and ihttpmodule and processrequest

12- Function ans subroutines in c#

13- In a HashTable Key cannot be null, but Value can be

14- Difference between MyArr.GetUpperBound(1) 

15-http://withoutbook.com/online_test.php?quiz=71&quesNo=40&subject=Top%2040%20C%23.NET%20Online%20Practice%20Test%20%7C%20Multiple%20Choice
http://www.logicguns.com/c-sharp-objective-questions/?page=6

16- Extension method bentfits over normal static methods

17-deadlock in sql server and application

18- if there is common method - 
mymethod(var par);
mymethod(dyanmaic par);

abc obj =new abc();
obj.mymethod("str");
obj.mymethod(1);

which method will be called?

16- Difference between Convert.ToString() and ToString()
Convert.ToString() handles null values but ToString() doesn't

17- why Idispose interface we use

18- using keyword in c# and where u will use in the project

19-Code first approach in Entity framework

20-hasmany and map in entity framework

21- dirty read in sql server

22- architecture of the project

23-why Angularjs why not jquery in project

24-:Refine process in scrum

25-which one we have choose entity framework vs ado.net

26-which technology you will use in c# for making an application having 1000 users

27-name -"mydb" in context class in entity framework

28- Paging in entity framwork

29- How entity framework work for database means first delete db or make the new db

30-HttpPolling in webapi which method will be called first httpget ,httpPost etc..

31-if there are multiple httpModule then how to change httpHandler to different httpHandler.

32-There is Pancard validation first five charter is Alphabetic and next 4 character is numeric and last character is alphetbetic then write the unit test cases for the pancard

33-How to use unit testing and mock for db connections

34- dirty in Angularjs

35- Type script in angularjs

36- If there is below Cricket table

Team Result
A Win
A Win
A Lost
A Die
B Die
B Lost
C Win
C Lost


write the query to give result like this

Team Win Die Lost total
A 2 1 1 4
B 0 1 1 2
C 1 0 1 2


select  [Team], Win,Die,Lost,(Win+Die+Lost) as total from
(select Team,Result from Cricket) t1
pivot
(
Count(Result) for Result in (Win,Die,Lost))
 as t2


37- ng-show vs ng-if

38-shift and unshift in javascript

39-array in javascript and find the element in without using index

40-push and pop in javascript

41-how to differentiate between property and prototype and object

42-immediate function ,explicitly or implicitly function in javascript

43-div+lablel in css

44- how to change style of table having 5 row and 2 column without using 
css and id.
.trtd::

45.  :: in angularjs
46 closure in javascript

47-one time binding vs two way binding

48- double colon :: in angularjs

49-Content negotiation in web api

50- multicast delegate,anonymous method

51-Throttling in wcf

52- Covariance and contranvariance

53- How to autoincrement the id without identity?

54- cluster index and non clustered index

55- foreign key can not be null  and other values in other table it will give the error
constraint error

56 - What Page_PreRender do in asp.net

57-how to get current thread id from thread pool


58- write code in c# for java script alert  like page.script

59- when SaveStateComplete will call in page life cycle

60- background worker in c#

61- how to get nodes from xml using c#
<Countries>
<Country> india
<states>
<karntka>
<Countries>
<Country>

62- how to get assembly info using reflection of current project

63- IRouteConstraint in mvc

64- Route table would it work for web application ?

65- In angular js if we have implemented ng-route then if we changing the url in browser then should it give the internal server error or not?

66- static methods in abstract class

67- internal modifier in data member of class

68-what isReusable do in IHttphandler?

69- Protected,internal ,protected internal ,private, public

Here is a Short and simple Matrix to memorise the above concept.
Accessbility Matix to RememberSame AssemblyDifferent Assembly
Access Modifer TypeShort NameSame ClassDifferent ClassAny class(inherits previous assembly class)
ProtectedPYesNoYes
InternalIYesYesNo
Protected InternalPIYesYesYes

protected internal means "protected OR internal" (any class in the same assembly, or any derived class - even if it is in a different assembly).


namespace TestOps
{
    class Program
    {
        static void Main(string[] args)
        {

            X objX = new X();
            objX.m1();

            //other than m1 no other method called
            
        }
    }

  

   
}


namespace TestOps
{
   public class Z:X
    {

       public void m8()
       {
           m1();
           m3();
           //proteced internal can be called in different assembly but in derived class
           m5();

       
       }
    }
}

-----------------------------------
different assemply

namespace C2
{
    public class X
    {

        public void m1()
        {

        }
        private void m2()
        {

        }
        protected void m3()
        {

        }

        internal void m4()
        {

        }
        protected internal void m5()
        {

        }

    }
}




namespace C2
{
    public class Y : X
    {
        public void m7()
        {

            m1();
            //m2();
            m3();
            m4();
            m5();
        }
    }
}





Find Employees With Salary Higher Than Their Department Average

TEmployee
EmpId Desingation Name 1 SE A 2 SE B 3 SE C 4 SE D 5 TL X 6 TL Y 7 TL Z
TEmpSalary
EmpId Salary 1 1000 2 1100 3 1000 4 1200 5 1200 6 2000 7 7000
;with cte as ( select E.EmpId,E.Name,S.Salary,E.Desingation from TEmployee E inner join TEmpSalary S on E.EmpID= S.EmpID ) select t1.Empid,t1.Name,t1.Salary,t1.Desingation from cte t1 where Salary> (select AVG(t2.Salary) from cte t2 where t1.Desingation=t2.Desingation)
Explain Aggregation, composition, abstraction. 2. When will aggregation used and composition. 3. Explain encapsulation. 4. Explain Loose coupling and tight coupling. 5. How to achieve Loose coupling. 6. Open and closed system...!! (Forgot question) 7. What is Enum ? can we extend enum from another. 8. Decorator design pattern. When to use decorator design pattern. 9. Singleton design pattern. Performance impact of lazy initialization. 10. Explain cloneble and serializable.
11- Find middle element of link list Create stack using queue as internal data structure.
12-why use locks instead of synchronization? How to stop a thread? Executor service ? rules of overriding? How to serialize singleton?  
Online Cab booking system
 you may offer to fill a windows form control using multithreading or reading and updating data into database using multithreading.
You will be asked to design code based upon the given problem. (refer below example). This is another round that tests your knowledge basically on following skills and marking will be done for each of these sections. So don't miss any of the following sections during coding.
1) Design logic : correct use of interfaces and abstract classes or correct design pattern is used or not based upon given problem. 2) Best practices: correctly name packages and classes using correct conventions. Data members should be private or final as required, methods should be public and don't forget to flaunt the use of try-catch at various points, add proper and clean comments, code indentation etc. 3) Test Cases: Do write at least 2-3 junit test cases if it is asked in the problem. It has got separate cutoff.  4) Database Storage/ DAO : You can use Spring Transaction or JPA or Hibernate to show data storage part, although it might not be mentioned in problem directly but at least design DAO to show that you have good knowledge of frameworks. 5) It Must Run Anyhow: Make sure that code is running and showing some output on console. It has separate cutoff.
6) Assumptions :You will be asked in problem statement to make assumptions on some part of the code. Its good practice to write down your assumptions in comments.
Following is an example of Designing Delhi Metro Railway System that was asked recently.
Click HERE to see example.
Multi-threading : practice upon creating threads in different ways, understand the wait(), notify() concepts in deep, re-entrant locks.. etc.
Polymorphism: method overriding and over-loading syntax and concepts.
Inheritance : Good understanding on implementing interface or Abstract classes and all the rules/syntax for implementing an interface or extending abstract classes. Some questions on up cast or downcast etc.
Enum : expect 1 or 2 questions on Enum.
Composition vs Aggregation
 Encapsulation vs Abstractions 
 Inheritence vs Composition 
 Singleton in presences of multiple class loaders 
 How paramgen is Garbage collected  
  
 Online movie database
design a system like a fee calculator system or movie ticket booking application system

Dirty read, Fantom read and non repeatable reads in case of Databases



70-How to restrict web api to json or xml formatter.

71- How to make define for-matter other than json and xml

72-select * from t1, t2 - it will be cross join

73-What is protocol security in wcf and web api

74- how to make web api intranet so that only company premises can access

75- How to make web api secure to authenticated user if some body is try to hack the web api
using token and identity

76-

 DI, patterns, web API, caching, exception handling, unit testing framework , oops, struct, security etc.
Interview Questions
  • 1. Real problems to apply design pattern 2. Oops: focus on inheritance , SOLID 3. DI 4. Algorithm based like array, card deck, sort/search
  • Asp.net architecture questions Asp.net Basic questions C# basic questions framework and code style related questions like usage of TDD , unity framework ,RegEx, CLI , Com-Intraoperabiilty  
 How would you test a file sync system
















No comments:

Post a Comment