The C# programming language is a simple, modern, general-purpose, object-oriented programming language. Having a basic familiarity with the programming language used on the job is a prerequisite for quickly getting up to speed.
Public
Public
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
DESCRIPTION
Write a function that checks if a given sentence is a palindrome. A palindrome is a word, phrase, verse, or sentence that reads the same backward or forward. Only the order of English alphabet letters (A-Z and a-z) should be considered, other characters should be ignored.
For example, IsPalindrome("Noel sees Leon.") should return true as spaces, period, and case should be ignored resulting with "noelseesleon" which is a palindrome since it reads same backward and forward.
ANSWER
EVALUATION
Compilation OK and all test cases pass, great!
Example case: Correct answer
Lowercase single word: Correct answer
Any case single word: Correct answer
Sentence: Correct answer
Last answer
1
using System;
2
public class Palindrome
3
{
4
public static bool IsPalindrome(string str)
5
{
6
stringorg="";
7
foreach (char c in str.ToLower())
8
if (char.IsLetter(c)) //ignore anything except alphabet
9
org += c; //create new string just alphabet
10
11
char[] temp = org.ToCharArray();
12
Array.Reverse(temp); //reverse the string
13
string reverese = new string(temp);
14
return org == reverese; //compare two string
15
}
16
17
public static void Main(string[] args)
18
{
19
Console.WriteLine(IsPalindrome("Noel sees Leon."));
The majority of today's office-based jobs require an understanding of numerical information (numbers, tables, charts) and the ability to rationalize them.
Public
Public
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
DESCRIPTION
How old is John if, in 38 years, he will be 3 times as old as he is today?
The C# programming language is a simple, modern, general-purpose, object-oriented programming language. Having a basic familiarity with the programming language used on the job is a prerequisite for quickly getting up to speed.
Strings
Strings
The string data structure is used to represent text. It is one of the most commonly used data structures. Therefore, every programmer should be skilled at string manipulation.
Public
Public
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
DESCRIPTION
Write a function that finds the zero-based index of the longest run in a string. A run is a consecutive sequence of the same character. If there is more than one run with the same length, return the index of the first one.
For example, IndexOfLongestRun("abbcccddddcccbba") should return 6 as the longest run is dddd and it first appears on index 6.
ANSWER
EVALUATION
Compilation OK and all test cases pass, great!
Example case: Correct answer
Word with single longest run: Correct answer
Word with 200 letters: Correct answer
Performance test on a large word: Correct answer
Last answer
1
using System;
2
3
public class Run
4
{
5
public static int IndexOfLongestRun(string str)
6
{
7
intstartFlag=-1, lengthRun=0;
8
for (int i = 0; i < str.Length; )
9
{
10
var tmp = str[i]; // temporary variable
11
int longestIndex = i;
12
while ((str[i] == tmp) && (++i < str.Length)) // it will check how many character are the same and it should not goes more than string size
jQuery is a fast, small, popular, and feature-rich JavaScript library. It provides functions that make it easier for developers to traverse HTML documents, create animation, support different browsers, handle events, and use Ajax.
JavaScript
JavaScript
JavaScript is the programming language of HTML and the web. It's an essential skill for any programmer working with websites and web technologies.
ThisPublic
Public
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
DESCRIPTION
Fix the bugs in the JavaScript code without removing the setTimeout function. The code currently alerts undefined instead of anchor inner contents.
SQL is the dominant technology for accessing application data. It is increasingly becoming a performance bottleneck when it comes to scalability. Given its dominance, SQL is a crucial skill for all engineers.
Conditions
Conditions
Conditional statements are a feature of most programming and query languages. They allow the programmer to control what computations are carried out based on a Boolean condition.
Public
Public
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
DESCRIPTION
A table containing the enrollment year has incorrect data in records with ids between 20 and 100.
Select all queries below that, for the faulty records, set the year to 2015.
ANSWERCorrect answer | Candidate's selection
UPDATE enrollments SET year = 2015 WHERE id IN (20, 100);
UPDATE enrollments SET year = 2015 WHERE id >= 20 AND id <= 100;
UPDATE enrollments SET year = 2015 WHERE id BETWEEN 20 AND 100;
UPDATE enrollments SET year = 2015 WHERE id >= 20 OR id <= 100;