Monday, 15 July 2024

Interview Questions 2024

 1-  Angular - promise vs observable

2-boxing vs unboxing

3-int vs Integer in c#

4- what cassandra role in ur project

5-sql funtions vs stored proc

6- script to delete duplicate record execpt 3 no of record

7-get  employee highest salary 

8-linked server in sql ,how to query from one db to another db

9-how to mask password in sql

10-reference vs value type

11- what are the ref  and value data type

12-web api return type

13- factory design pattern

14 -interface vs abstract 

15-when we have to use abstract in ur project

16-primitive data type in c#

17-Ienumerable vs Iqurable

18-how garbage collection works

19-Generics in c#

20- git tag

21-git flow

22-sprint velocity

23-story

24-jira

25 -cicd

26-sonar qube

27-ansible

28-how to create pipeline

29-what services you have used in aws

30-lambda funtion in ur project

31-what things we can do via lamda

32-heimdal data

33-why .net core 6 then 3.1

34-find the employee and manager name by empid,empanme,managerid

35 find the employee level by query  and recursive method empid,empname,managerid ,level

if level is 1 for emp who is ceo and not having manager, and manager level will 2 then empl level will

be 3

36-moq and nunit

27-how to access lambda funn via url and non url from code

28-ec2 use in project

29-how to deploy  in ec2 

30 -how to make syncronous communication via microservices

31-aws loadbalncer

32-aws serverless coading

33-aws native apps

34-design pattern  -creational,structural,behavioural

35- what is user story and how to define

36 how to define user strory what we write

37- how to write acceptance criteria

38 -git commands

39 -how .net core app deploy /host to servers

40- congnito ,saml in aws lamda

41- Redis cache clustering , sliding expiration

42-library used to integrate in .net core

43- what is middleware

44- app.use vs app.run

45- what authentication mechanishm used in aws lambda and api gateway

46-jwt authentication

47-sns and sqs in aws

48-how to write unit test cases and how to mock

49 - how to write unit test cases with aws lambda function

50-how to integrate aws sns ,sqs from .net code

51- how to deploy .net web api to aws lambda

52 -automapper and dapper

53 how to define mapping in ef

54- hot debug aws lambda fn in local visual studio

55- how lambda function trigger for web api

56- truncate vs delete

57-write linq to find the second highest salryy in entitiy

58- default values for first and firstordefault

59-aws dsor

60 -how to find the estimate of project 

61- what challenges you have faced in your project

62- what guidance you have given to your junior

63- primary can be combination of multiple columns

64- look and say 1 11 21  series

65- find the vowels count from string input  in linq

66- find the second highest salary using linq

67 - DB context code

68- how to deploy the code first appoach to db

69- find top 3 highest salary by department wise from employee and department table

70 -how to off foreign key constraint in table for deleting dependent table

71- builder and chain of responsibility pattern

72 how to write unit test case for webapi ,api lambda funtion, and database project, and DAL layer

73- ngtemplate vs ngcontainer

74- factory design pattern

75- forkjoin in angualr

76-table vs temp vs cte

77-write linq from emp and deptid  find the all employee having dept and not deptid

78- how to send mail and message via aws sns and sms if aws sms is failed then how to get notification

79- pivot in sql

80-Dependency injection in angular and c#

89- web hooks in angular

90-ng hook cycle

91-  subject in angular

92- how to transfer value from one component to other if they are not link together

93-leg and lead in sql

94-decorator

95-how to add properties from common place in .net core/ef

96- ngcontent,ngtemplate vs ngcontainer in angular

97-content projection in angular

98-remove duplicate character from string

99- find second highest no from array

100-can we create multiple router-outlet in anglar

101- how to use commone style css to apply only defined component in angualr

102-pattern in microservices 

103 how to make microservices as non failure or fault tolerance

104 how to do deploy service to make non stopped

105- cqrs and saga, circuit breaker

106- command pattern

107-use custom  directive in angular

108- Addtrasnient vs addscopped

109 -Oauth

110 -S3 library used in .net

111 - perforamnce tuning in sql 

112 what checks in code review and query

112- .net core 3.1 vs 6 vs 8

113 angualr latest version comparison

114- clousure in javascript

115 -API versioning different type of version  like url ,api header,parameter

116-how to divide microservices 

117- dictionary vs list which one has good time complexity

118- generic func vas delegate func

119 - how to handle synchronous and ashncronous libraray  to make it run Task.Run

120 UML

121-what things you have to done to improve the process for client and company level?

122- manager and employee query self join

123 -azure function app vs logic app

124- cte  vs temp variable vs table variable

125 - combine two list having nos and string

126- routing in angular

1- problem faced in lif and project

2- what isgood thing in life and project

3- how to managee mentor junior

4- mistake in life and what learn


dependenc inject framewrok problem stametn how to resolve more focus  on this

rest api microsriveses all question related to real project scenarios

cicd and sonar qube how implemented docker  in project,aws and code refactor tool

thread safety yin .net 

caching in real scenario

join before 5 min







public void PrintCharOcurrnace()

{


string str = "abcddeeffgg";


Dictionary<char,int> dict= new Dictionary<char,int>();


char[] strChar= str.ToCharArray();


for(var c in strChar)

{

  if(dict.Contains(c))

   dict[c]= dict[c]+1;

   else

   dict.Add(dict[c],1);

}


foreach(var d in dict)

{

   Console.WriteLine(d.Key  + " " + d.Value);

}


}



string str= "abcddeeffgg";





Write a SQL query to return the result of only 

latest order from each year of every customer, 

DB Column name which print as

 output is: CustName, CustAddress, OrderDate

 

 

Tables Info: 

 

TblCust: CustID, CustName, CustAddress, OrderID

 

TblOrder: OrderID, OrderNumber, OrderDate


Select * from TblCust c inner join TblOrder o on 

c.OrderID=o.OrderID 

group by OrderDate

order by o.OrderDate desc


;with cte

{

  select DenseRank() over(Partition By Customer order by Cast( o.orderdate,year ) desc) rnk

  c.CustName , c.CustAddress, o,OrderDate from

TblCust c inner join TblOrder o on 

c.OrderID=o.OrderID 

}

select  CustID, CustName, CustAddress, OrderID

 from cte  where rnk =1



a=15

fucnton  (int a)


int[] arr ={1,2,3...10}


 --traverse array 

- take 1 or second in seq then add with next no and

-  store the index temp and no key value

-if found then reurn the key value pair


int[] arr =[1,2,3...10]



for()



class 







2*3


interface IOperation

{

 int Multiply(int a,int b);

}


public class Calcultor : IOperation

{

  public int Multiply(int a,int b)

{

 return a*b;

}

}


public class Custorm

{

 private IOperation _opration;

public Custorm( IOperation operation)

{

if 

_operation=operation;

}


public int Get()


{

 _operation.Multiply(2,3);

}

}


service.AddScopped<IOperation, Calculator>();




T1,T2

id, id foreinkey


select * from T1 inner join on T1.status=T2.status


var result= from T in T1

            join T2 

            on T.status.equals(T2.status)

            select id,status


Get

Upesert

Delete



T1,T2



1  -

2,

3

;with Cte as 

(

  select ROw_number() over(partion by id,name,phone order by id) rnnk from T1 inner join 

)

select * from cte where rnk >=1


#temp id(10) , name , employee - id name(1 lac )



   select * from #temp t right join employee e on  t.id=e.id

  where t.id is not null






public Inteface IFruit

{

public string GetColor();

public string GetColor(string str );

}


public class Apple :IFruit

{

  public string GetColor()

{

 return "red";

}


public string GetColor(strnig str)

{

 return "red";

}


}


public class Orange :IFruit

{

public string GetColor()

{

 return "orange";

}

public string GetColor(strnig str)

{

 return "red";

}


}



public class Main


{

 Ifruit fruti= new Orange();


fruite.Getcolor();



}



EMployee



var query= from s in emp.Distinct

           select s.Take(2).OrderByDesceding()  rec

           from r in rec

           select rec.Take(1).OrderbyAscending()



              









public class MultLcs<T> where 

{

   public async Task< int> Mul(int x,int y)

{



return await 

}

}


public interface IOperation

{

  int Mul(int x,int y);


}


public class NumberCls 

{

private IOperation _operation;

   public NumberCls(IOperation operation)

{

   _operation=operation;

}


public Task<int> Method()

{

  return await  _operation.Mult(3,4);



}

}


  delegate del =(x,y)=>{

return x*y;

}


del(4,5)


1 11 21 1211 111221 312211


one , one one 


1

1+10




emp 

empid ,name salary,deptid


dept

dpid,name



with Cte as

(select Dense_Rank() over(partition by deptid order by salary desc) rnk ,*)

select * from cte where rnk<=3



salary


10000  -1

8000 -2

7000-3

7000-3

6000-4


string




public int GetCount(string str)

{

    string[]  v= ['a','i','o','e','u'];

    char[] cr= str.ToCharArray();


  await  var q= from s in v

           join from i in cr

           on s.equaly(i)

           select cr.ToList().Count()

           

  

  

}



interface IOperatoin

{


void DoPayment(string str);



}



public class DebitCard :IOperation

{

public void DoPayment(string str)

{

  

}

}


public class CreditCard :IOperation

{

public void DoPayment(string str)

{

  

}

}


public class VoucherCard :IOperation

{

public void DoPayment(string str)

{

  

}

}







a=2

b=3


a= a+b; =5

b=a-b =2


a=a-b;=3


c =a; = 2

a=b; =3

b=c


*

**

***

****


int j=1;

for(int i=0;i<10; i++)

{

for(k=0;k<=j;k++)

  Console.WriteLine(*);


j =j+1

  

}





var query= from e in Employee

           join d in Dept

          on e.deptid equals d.deptid

         select e



public class Employee<T>

{  public T GetValue( T value)

{

  return value;

}

}

forkjoin


empid 


1  1

2  2

2

3


deptid

1

2

3

4


inteface IOperation

{

   bool DoPayment();


}


public class DebitCard\{

 bool DoPayment()

{


}

}


public class CreditCard\{

 bool DoPayment()

{


}

}


public class DebitCardFactory

{

public string type="debit"


    public IOperation CustomeMethod(string type)

{


   return new DebitCard();

}

}


public class CreditCardFactory

{

public string type="credit"


    public IOperation CustomeMethod(string type)

{


   return new DebitCard();

}

}







aws sdk

aws eventbridge

aws kinesis


mirror maker mm2

aws glue

kafka cli

vpc

security in aws 

kafka cluster clie through

lambda

terraform

aws iam

infrastruction as code  java

firehouse




Given a binary string (containing only "1" or "0"), find the minimum number of flips required to get a homogenious binary string (consisting of all "1"s or all "0"s). A flip is considered to be changing a series of similar characters.

 

Eg. 00111000011110 => 2



arr0 = 00

arr1=

arrf= 11

arr = 







public int GetFlips(string str)

{


  char[] arr = str.ToCharArray();

  char[] arr0 ;

char[] arr1;

   

int counter1=0

int counter2=0

int zeroCount=0

int oneCount=0

   for(int i=0;i<arr.Lenth; i++)

{


    if(arr[i]=='0' )

{

    zeroCount=zeroCount+1;

continue;

}

else if(zeroCount>0)

{

counter1=counter1+1;

zeroCount=0;

}




 if(arr[i]=='1' )

{

    oneCount=oneCount+1;

continue;

}

else if(oneCount>0)

{

counter2=counter2+1;

oneCount=0;

}


if(counter1<counter2)

{

retunr   counter1

}

else

return counter2

)





public class EmployeeBAL:IEmployeeBAL

{

  public int AddEmployee(Employee emp)

{

      int noRecords=_Dal.AddEmployee(emp);

     return noRecords;

}

}


Employee emp =new Employee();


emp.Id=1;


emp.Name= "Test";


Moq. <IEmployeeBAL>.AddEmployee() return = 


Assert.





List<int> templist = 

new List<int>() { 5, 7, 13, 24, 6, 9, 8, 17 };


var query= 



credit:IPayment,

debit:IPayment



interface IPayment

{

 void DoPayment();

}



IFruit


class Apple :IFruit

{

 getColor()

{

  retrun "Red

}

}

class Orange:IFruit

{

 getColor()

{

  retrun "organgge

}



Applet ojbj = new Orange()


delage void Add(T v ,)


with Cte as

{

  select Dense_Rank() over(partionby City order by salary desc) rnk,City,Salary

}

select * from cte where rnk =1



const arr = [1, 2, 3, 4, 5];


for (let i = 0; i < arr.length; i++) {

  setTimeout(function () {

    console.log(i);

  }, 1000);

}



oops

.net core host, servers asp.net core

approached to modernaize a monoalithign to microservice

async await

unit testing

code review di,

task vs thread

api gateway setup - using from code

sqs

add scoped ,addtransient

DI concept

how to call api end point hosted in lambda

how to deploy deploy functions

ORM

Fault tolerance in cloud

code refactor make testablity

Cors

api gateway

Avalavility zone

ssh

code smells quesions

load balancer

difference b/w thread and asynchronous programming

Iquerable vs Ienumerable

hastable vs dictionary

maintain session between multiple servers

and managing reqest through load balancer

diff b/w inproc and outproc session

content negotiation 

overloading vs overriding

how to improve the performance of our api

how to secure api

how to use httphandler and httpmodule in asp.ent 

concecpt in .net core

sticky session

different feature of api gateway

instead of sns can we use differnt componnet to send msg

what is serverless

how lambda trigger in differnt ways

aws lambda advantanges and disadvantages


- arraylist vs List which one is fast

-how you manage memory management in c#

-how garbage collection works

-difference between collection and collection.generic

-do we need to close sql and file connectoins

-do we have default constructor in abstract

-when abstract constructor called

-what is need of static constructor which type of variable we initialise in static constructor

-how jwt created

-how to decode the jwt in api and front end side

-what is configureawait and getawaiter

-How Addscopped and addtransient

-azure cicd, resource creation like ami, service bus

-concurrent dictoinary


-how to create immuatable class

-how to make immuatable jwt token

-how to implment multithreading in webapi

-how to tune sql proc

-how to tune webapi performance

-what architecure pattern you have followed in microservices project on each services

-



    • BMO Capital Markets heavily relies on Microservice Architecture for its various Trading Systems. Actively working on designing, architecting and developing the post trade processing (swap & hedge) Prime Brokerage where we have various microservices written in C# .NET Core connected to REDIS cache, SQL Server and communicating each other via Kafka. Different microservices for listening to stream, processing, netting using different strategies, matching and finally booking into the external trading platforms. Sending data to AWS via Kafka replicator from on-prem as part of hybrid system for various reporting and data analytics using data lakes. Designed and implemented Prime Brokerage POC hybrid project to integrate onprem and AWS by sending data securely via SFTP on the cloud S3 bucket that triggered a lambda function to read the file contents of different format and put it back to another bucket monitored by another lambda function to get the position from third party softwares hosted on the EC2 and connected to RDS. All the AWS resources were provisioned via CDK scripts in NodeJS.

No comments:

Post a Comment