DotNet By Ajay — New: ES2025 cheat-sheet is live!
Showing posts with label Interview Question. Show all posts
Showing posts with label Interview Question. Show all posts

February 15, 2023

February 13, 2023

What is mean by Shadowing?

Shadowing:

The terms "Shadowing", is defined in VB.Net. In C#, this is known as new keyword.

February 9, 2023

SQL Delete Records within a specific range

SQL Delete Query with BETWEEN condition:

Here i want to delete record from table with in specific range.

September 13, 2022

HackerRank: SQL Basic Select "apanese Cities' Attributes"

Question:
Query all attributes of every Japanese city in the CITY table. The COUNTRYCODE for Japan is JPN.

September 12, 2022

HackerRank: SQL Basic Select BY ID

Question:

Query all columns for a city in CITY with the ID 1661.

September 11, 2022

HackerRank: SQL Basic Select All

Question:

Query all columns (attributes) for every row in the CITY table.

September 10, 2022

HackerRank: SQL Basic Select 2

Question:

Query the NAME field for all American cities in the CITY table with populations larger than 120000. The CountryCode for America is USA.

September 9, 2022

HackerRank: SQL Basic Select 1

QUESTION:

Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.

March 13, 2021

SQL Interview Question : Find the output of

 DECLARE @EMP_ID BIGINT=NULL

IF(@EMP_ID = NULL)

BEGIN

     PRINT 'PLEASE ENTER VALID EMPLOYEE ID'

END

ELSE

BEGIN

     PRINT 'VALID EMPLOYEE ID'

END

SELECT COUNT(*) + COUNT(*)

 - COUNT always returns an int data type value.

 - COUNT(*) returns the number of items in a group. This includes NULL values and duplicates.

September 13, 2020

OOP's Interview Question: What is OOP in C#?

Here i am discussing about, "OOP's related inter question's are asked up to fresher level".

September 7, 2020

SQL Interview Question: How to create another table using existing table?

Here i am discussing about, "How to create another table using existing table?" or "How to create Duplicate table in SQL Server?". There is a simple SQL Query to create duplicate table. I have tried and tested. Hope this work for you-

August 23, 2020

Interview Question : What is the ideal way to check if a database exists on a SQL Server using T-SQL?


There is various ways to check database is exists or not in SQL Server. I am sharing with you below Queries tested by me.

February 12, 2019

Interview Question : How to get a list of SQL Server Agent Jobs in SQL Server ?

Here i am writing  a simple query to find the list of all Jobs currently running on SQL Server. We can write below simple query to find the "sysjobs" on each server.

September 13, 2018

How would you count occurrences of a char within a string?


In many interviews, i faces a problem with the getting count of occurrences of a char within a string. Mostly i ignored these question and i replied like "Sorry, I don't know &  Sorry, i cannot reply".

Finally, i mind it and write a simple code as below :


using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CharOccuranceInString
{
    class Program
    {
        static void Main(string[] args)
        {
            #region Occurance of char in a string using c#
            
            string source = "abcaadbcdbbcd";
            int countA = 0;
            int countB = 0;
            int countC = 0;
            int countD = 0;
            foreach (char c in source)
            {
                if (c == 'a') countA++;
                if (c == 'b') countB++;
                if (c == 'c') countC++;
                if (c == 'd') countD++;
            }

            Console.WriteLine("Occurance of a=" + countA.ToString() +
                                   "\n Occurance of b=" + countB.ToString() +
                                   "\n Occurance of c=" + countC.ToString() +
                                   "\n Occurance of d=" + countD.ToString());

            Console.ReadKey();
            #endregion

        }
    }
}