DEV Community

Shivansh Srivastava
Shivansh Srivastava

Posted on

Interview Experience--- OSource Software Developer 6-8 LPA 2YOE 29/11/24

1. i) diff bw Abstraction and Encapsulation and ii) write the code for them iii) explain

my code--

class Employee{

private string name; //encapsulation
public string Name{
get{return value ;}
set{name=value};
}
}

abstract class Shape{
{
public abstract void Draw()
}
{
class circle :Shape
public override void Draw(){
Console.WritLine("drawing Circle");
}
}

can abstract class have non abstract methods

Do u know virtual keyword when and how to use

for Given Code
public interface A { public void MethodA(); }
public interface B { public void MethodB(); }
public class C : A,B
{

}

How to replace this interface to classes and all code .

my ans---
public class A { public void MethodA(); }
public class B { public void MethodB(); }
public class C : A
{

}
pubic class c : B
{

}

How you do exceptional handling . why finally . What we write inside in finally block.

string s="shivansh";
char[] result=new char[s.Length];

for(int i=0;i<s.Length;i++){
result[]=s[i];
}

return string(result);

What is diff between datatable and datareader

Null query Execute

Constant and static difference

have you worked on webforms

write a query to fetch top 3 names from a table

i wrote this ------- subqueryy select Max(c1) from t1 where c1 (select max(c1) from t1 where c1<(select c1) from t1))

SELECT TOP 3 CustomerName
FROM customers

write program to reverse a string

string s="shivansh";
char[] ans=new char[s.Length];
for(int i=0;i<s.Length;i++)
{
ans[i]=s[s.Length-1];

}

return string(ans);

*Give Output not clear about the exact question but answered *

private string msg="hello";
public class Hey(){
Console.WriteLine(msg)
}

string msg="world";
Console.WriteLine(msg);

give Output

string s ="test";
for(int i=0;i<s.Length;i++)
{
string newS=s[i]+"";
Console.WriteLine(newS);
}

give output

in mvc project what is return type
not clear about the exact question but answered

my asnwwr was IActionResult

How to protect a class to be inherited

my ans was sealed keyword

there is 2 same name class can we inherit one from another

About Stored Procedure how to replace stored Procedure

Result yet to come -- my feeling ---negative

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay