Software Development and Programming Careers (Official Discussion Thread)

Joined
Jan 21, 2013
Messages
3,416
Reputation
514
Daps
7,621
Reppin
NULL
I've been watching tech interviews on youtube. I would listen to the instructions and try to code the solution myself.

https://www.youtube.com/watch?v=xC8CGv1CyFk

my code:

Code:
#include <iostream>
#include <vector>
#include <string>
#include <math.h>

struct Point {
    int x, y ;   
} ;

int distance( const Point& p1, const Point& p2 ) {

    int a = (p1.x - p2.x) * (p1.x - p2.x) ;
    int b = (p1.y - p2.y) * (p1.y - p2.y) ;
    return sqrt( a + b ) ;
}

Point findClosestCoin( const Point& yourPosition, const std::vector<Point>& coins ) {

    int shortest = 1000 ;
    int idx = 0, i = 0 ;

    for( const Point& p : coins ) {   

        if( distance( yourPosition, p ) < shortest ) {
            shortest = distance( yourPosition, p ) ;
            idx = i ;
        }           

        i++ ;   
    }

    return coins[ idx ] ;
}

int main( int argc, char** argv )
{

    Point myPosition{ 10, 0 } ;
    std::vector<Point> coins ;
    coins.push_back( Point{ 1, 2 } ) ;
    coins.push_back( Point{ 10, 2} ) ;
    coins.push_back( Point{ 22, 3} ) ;
    coins.push_back( Point{ 3, 4 } ) ;
    coins.push_back( Point{ 4, 1 } ) ;
    coins.push_back( Point{ 5, 1 } ) ;

    auto shortestPoint = findClosestCoin( myPosition, coins ) ;

    std::cout << "closestCoin: (" << shortestPoint.x << "," << shortestPoint.y << ")" ;

   std::cin.get() ;
   return 0 ;
}

https://www.youtube.com/watch?v=cdCeU8DJvPM

Code:
namespace bullshytutility
{

    struct Tuple {
        int a ;
        int b ;
    } ;

    bool search( const std::vector<int>& container, int target ) {

        for( auto itr : container ) {

            if( itr == target )
                return true ;
        }

        return false ;
    }

    int findMissingInt( const std::vector<int>& a, const std::vector<int>& b ) {

        if( a.size() == 0 || b.size() == 0 )
            return -1 ;

        for( auto i : a ) {

            if( !search( b, i ) )
                return i ;           
        }

        return -1 ;
    }
}

int main() {

    std::vector<int> a{ 4, 12, 9, 5, 6 } ;
    std::vector<int> b{ 4, 9, 12, 6 } ;

    auto c = bullshytutility::findMissingInt( a, b ) ;

    std::cout << "Missing Number: " << c << '\n' ;   

    return 0 ;
}

I've been forcing myself to learn spring boot to get a job but webdev is mad boring. I'm having way more fun doing competitive challenges in c++.
 
Joined
Jan 21, 2013
Messages
3,416
Reputation
514
Daps
7,621
Reppin
NULL


My super sloppy solution:

Code:
namespace bullshytutility
{

    struct Meeting {
        std::string name ;
        int hours ;
    } ;

    bool sortByHours( const Meeting& lhs, const Meeting& rhs ) { return lhs.hours < rhs.hours ; }

    std::vector<Meeting> optimizeMeetingTime( const std::vector<Meeting>& meetings, int availableTime ) {

        std::vector<Meeting> shortMeetings ;

        for( auto meeting : meetings )
            if( meeting.hours < availableTime )
                shortMeetings.push_back( meeting ) ;       

        std::sort( shortMeetings.begin(), shortMeetings.end(), sortByHours ) ;
       
        std::vector<Meeting> optimizedMeetings ;
        std::vector<Meeting>::iterator meeting = shortMeetings.begin() ;

        for( int sum = 0 ; sum < availableTime ; ) {

            if( sum + (*meeting).hours > availableTime )
                break ;
           
            sum += (*meeting).hours ;
            optimizedMeetings.push_back( (*meeting) ) ;           
            ++meeting ;           
        }       

        return optimizedMeetings ;
    }
}

int main() {

    std::vector<bullshytutility::Meeting> meetings{ 
        bullshytutility::Meeting{ "Meet Subordinates", 2 },
        bullshytutility::Meeting{ "Fire Janitor", 1 },
        bullshytutility::Meeting{ "Meet Clients", 3 },
        bullshytutility::Meeting{ "Bang Secretary", 1 },
        bullshytutility::Meeting{ "Bang HR Lady", 2 },
        bullshytutility::Meeting{ "Meet Boss", 4 }
        } ;
   
    auto optMeetings = bullshytutility::optimizeMeetingTime( meetings, 3 ) ;   

    for( auto i : optMeetings ) 
        std::cout << "Name: " << i.name << "\nHours: " << i.hours << "\n\n" ;   

    std::cin.get() ;
    return 0 ;
}
 

Water

Pro
Joined
Aug 14, 2014
Messages
726
Reputation
235
Daps
2,291
Just had my first tech interview since I landed my current job out of college and I bombed that shyt man :mjcry:..

The behavioral and technical portions werent too bad but the whiteboarding came and destroyed me.... I went totally blank. Couldnt remember how to do anything

Humbled the hell outta me. Copped a years subscription to leetcode, I'm never letting this ish happen to me again:wow:
 
Last edited:

DJSmooth

Superstar
Joined
Oct 22, 2015
Messages
3,974
Reputation
1,229
Daps
23,674
Just had my first tech interview since I landed my current job out of college and I bombed that shyt man :mjcry:..

The behavioral and technical portions werent too bad but the whiteboarding came and destroyed me.... I went totally blank. Couldnt remember how to do anything

Humbled the hell outta me. Copped a years subscription to leetcode, I'm never letting this ish happen to me again:wow:

Here you go.

Tech Careers: New Year Gift - Curated List of Top 75 LeetCode Questions to Save Your Time

Loading...



Don't go too deep into algorithms. You'll never be asked to write a suffix tree or a balanced tree, or even Dijkstra's shortest path algorithm. You need to know the following algorithms: sorting (quick, merge, counting, radix -sort algorithms), binary search, DFS, BFS, DSU (might be useful, and it's a pretty easy data structure), stacks, min/max stack, queues, heaps, linked lists, KMP, hashes (Rabin-Karp). Segment Tree and/or Binary Indexed Tree (aka Fenwick tree) might be useful, and even though you probably won't be asked to implement them, it's still good to know that they exist, what operations they allow to perform, and what the runtime complexities of those operations are.
 

Water

Pro
Joined
Aug 14, 2014
Messages
726
Reputation
235
Daps
2,291
Here you go.

Tech Careers: New Year Gift - Curated List of Top 75 LeetCode Questions to Save Your Time

Loading...



Don't go too deep into algorithms. You'll never be asked to write a suffix tree or a balanced tree, or even Dijkstra's shortest path algorithm. You need to know the following algorithms: sorting (quick, merge, counting, radix -sort algorithms), binary search, DFS, BFS, DSU (might be useful, and it's a pretty easy data structure), stacks, min/max stack, queues, heaps, linked lists, KMP, hashes (Rabin-Karp). Segment Tree and/or Binary Indexed Tree (aka Fenwick tree) might be useful, and even though you probably won't be asked to implement them, it's still good to know that they exist, what operations they allow to perform, and what the runtime complexities of those operations are.


Good looking out bro. Much appreciated ! :wow:
 

Pyrexcup

Superstar
Joined
Dec 30, 2012
Messages
4,746
Reputation
765
Daps
14,814
Reppin
NULL
Anyone here work as a sales engineer/solutions architect/solutions engineer or another similar role dev/client facing role?

I currently work as a solutions architect and im looking to leave the current company I work earliest when i hit my 1 year mark in October 2020 but the latest Q1 2021. I essentially do pre sales and post sales non technical engineering and a few other things. luckily my company gives me the freedom to spend 30% of the time on personal projects where I do programming, so far im writing scripts to automate tasks we do at work and I also spend time at home brushing up on my programming skills. I got a bachelor in management information system so know the basics of computer science.

The dilemma im having now is im not really sure what job I want to go for once i leave my current one as it's kind of jack of all trades. But I want to plan accordingly so once i start job hunting i have the skills needed for the industry

My gameplan over the next 10 months or so is to:
improve programming skills
improve terminal skills
improve git skills
Learn react
Learn docker and kubernetes

Those are the skills im seeing being posted for those type of jobs in general and software development. 1. Do you guys recommend any additional framework/tool or skills I should learn 2. Do you guys have any recommendation for specific jobs i should look for apart from the above i mentioned? I don't think im able to land a Soft dev job unless I go hard but i can land something similar
 
Top