As a .NET junior programmer you might think that you don’t know enough C# to land an interview, and I did too in the beginning. But you just need some basic coding skills, and your personality and your interest in the company or technology is an equal factor for success. It can be overwhelming and discouraging to look at all the different parts of programming and thinking you need to learn everything. This is not the case.

If you’re average, you will compete with the average, and that is where the big bulk of your competition lies. I will tell you about a few concepts in C# and .NET that is not common in junior developers. This will make you stand out from the crowd in a C# interview and will also make you valuable to recruit. If you focus on becoming knowledgeable a few important things, instead of mediocre at everything, it will go a long way. Quality over quantity!

You don’t have to know everything here, trying it out and showing your interest and some knowledge is often enough. As a senior developer and an interviewer I would be impressed with you if you talked about these things in an interview! Don’t worry, you can do this, and welcome to .NET and C#!

1. LINQ – Write readable code.

LINQ stands for Language-Integrated Query and is a query-language within C# that is used to write queries, for example filtering a list or getting a result from a database. It comes in two forms: query form and lambda form. I would recommend to start with the lambda form as it’s most commonly used. However, if you know some SQL the query form is very similar to SQL.

// List of colors. We're going to find all 
// the colors starting with the letter 'b'

var colorList = new List<string>() { 
   "red", 
   "orange", 
   "blond", 
   "bone", 
   "blue", 
   "white" 
};

// Here is the LINQ (Lambda Form)

IEnumerable<String> resultList = colorList
   .Where(x => x.StartsWith("b"));

// Or write like this (Query Form)

IEnumerable<String> resultList = from c in colorList
            where c.StartsWith("b")
            select c;
 
// Print the result

foreach (var result in resultList)
{
 Console.WriteLine(result);
}
    
// OUTPUT: 
// blond
// bone
// blue

With LINQ you can write very clean code and it will make you move away from clumsy loops and array handling. Knowing this shows that you care about writing readable code far beyond any beginner!

Just copy past this code into Visual Studio or VSCode and try it. Aim to know a few of the most common functions such as Select, Where, Any and OrderBy.

2. Databases – the core of any application.

So speaking of LINQ – it interacts very naturally to a database. There is something called an ORM (Object-relational mapping) which does the heavy lifting of connecting your code to a database. From this connection you can write LINQ directly to the database and get data from it. So LINQ and database skills go hand-in-hand.

People are a bit adverse to learning databases and SQL because it’s generally seen as old and boring. The SQL language has not changed significantly for decades. This is actually not because it’s boring, it’s because there hasn’t been made anything better than SQL since then!

Knowing a bit of SQL and a database such as SQL Server will make you stand out very well, because of the rarity of the skill, but also because it’s heavily demanded. This is a rare combination because skill rarity usually means that more people chose this skill to become more attractive, but this is not the case with databases. So there’s a lot of potential for you here!

A poorly designed database is often the point of most performance problems and with proper SQL code and table design you can speed up applications by many hundreds of percent!

Setting up an SQL database can be a bit complicated, you can try it online using sites like jdoodle. You can also create a free SQL Server database in Azure. Aim to know how to create a table, what the datatypes are, and how to make a basic SELECT and WHERE query in SQL – which we also did in the LINQ above.

3. Logging – how do you quickly find and fix the problem?

The key with logging is to provide as much contextual information in your error as possible. Contextual means data that is relevant to the error at the time it happened. You want to have data passed to the function, the time of crash, the line the code crashed on and of course the specific error that happened. By having this you can reproduce the error and not simply guess what happened. Having good logging will save you hours in finding errors and frustration.

public void BadLogging(string data)
{
 try
 {
 // Doing X
 }
 catch(Exception ex)
 {
 _logger.Error(ex, "Error!");
 }
}


public void GoodLogging(string data)
{
 try
 {
 // Doing X
 }
 catch (Exception ex)
 {
 _logger.Error(ex, $"Error when doing X in GoodLogging(data: {data}) at {DateTime.UtcNow}", data);
 }
}

Many logging frameworks does the heavy lifting of showing you where the error happened, and at what time etc, so this code is just a visual demonstration, but this functionality is up to configuration and also the framework itself. Choosing the correct logging framework can make all the difference.

Try out Serilog, log4net or Nlog. Knowing logging means you know how to find and fix errors and produce something that works as intended!

4. Testing – prevent disasters in production.

There’s a difference between unit and integration testing. Unit Testing is to test a code on it’s own, for example a class or a function. Integration Testing is to test a sequence of functionality or an entire app, such as testing an API that connects to a database.

It’s very useful to have both. Having useful test coverage gives you confidence that the code works as intended and you can deploy with far less risk to messing up your production environments. It also increases safety and stability of the code when multiple people are working on a larger project since it’s impossible for everyone to know everything about a project and when you make a code change you might break something by mistake — and this happens to everyone. Properly testing a project can save you a lot of pain by mitigating mistakes and disasters!

In Visual Studio you can create a Unit Test project and try it out. Knowing the value of testing and showing interest in it will make you a great asset to the company!

Twitter
YouTube
Facebook
LinkedIn
Instagram
RSS

Popular articles


Business Bro 7 YouTube

Check out my YouTube Channel - tips for increasing your salary, work satisfaction and knowledge. I will help you achieve your goals. You can do anything if you put your mind to it!

🎥 Link: BusinessBro7 - Youtube Channel

Startups vs Big Tech Company - The best Work Place for Junior and Senior programmers?